diff --git a/lib/main.dart b/lib/main.dart index 5707f722..85930e00 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -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