feat: window activation with xdotool
This commit is contained in:
@@ -19,8 +19,12 @@ void main() async {
|
|||||||
final result = await Process.run('ps', ['-p', pid.toString()]);
|
final result = await Process.run('ps', ['-p', pid.toString()]);
|
||||||
|
|
||||||
if (result.exitCode == 0) {
|
if (result.exitCode == 0) {
|
||||||
// Process alive - just exit without trying to activate
|
// Process alive - try to focus existing window
|
||||||
print('Umbrix уже запущен');
|
try {
|
||||||
|
await Process.run('xdotool', ['search', '--name', 'Umbrix', 'windowactivate']);
|
||||||
|
} catch (_) {
|
||||||
|
// xdotool not available, just exit
|
||||||
|
}
|
||||||
exit(0);
|
exit(0);
|
||||||
} else {
|
} else {
|
||||||
// Stale lock - remove it
|
// Stale lock - remove it
|
||||||
|
|||||||
Reference in New Issue
Block a user