From d8cdee91fed70262636f1b6427f778522ee279b5 Mon Sep 17 00:00:00 2001 From: Umbrix Developer Date: Sun, 18 Jan 2026 05:31:59 +0300 Subject: [PATCH] feat: window activation with xdotool --- lib/main.dart | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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