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()]);
|
||||
|
||||
if (result.exitCode == 0) {
|
||||
// Process alive - just exit without trying to activate
|
||||
print('Umbrix уже запущен');
|
||||
// Process alive - try to focus existing window
|
||||
try {
|
||||
await Process.run('xdotool', ['search', '--name', 'Umbrix', 'windowactivate']);
|
||||
} catch (_) {
|
||||
// xdotool not available, just exit
|
||||
}
|
||||
exit(0);
|
||||
} else {
|
||||
// Stale lock - remove it
|
||||
|
||||
Reference in New Issue
Block a user