revert: back to GTK defaults like original Hiddify

This commit is contained in:
Umbrix Developer
2026-01-18 06:05:19 +03:00
parent af21f6d16e
commit ee39acbeec
2 changed files with 1 additions and 47 deletions

View File

@@ -1,55 +1,9 @@
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:umbrix/bootstrap.dart';
import 'package:umbrix/core/model/environment.dart';
void main() async {
// Single instance check - BEFORE Flutter initialization
if (Platform.isLinux || Platform.isWindows) {
final lockFile = File('/tmp/umbrix.lock');
if (await lockFile.exists()) {
try {
final pidString = await lockFile.readAsString();
final pid = int.tryParse(pidString.trim());
if (pid != null) {
// Check if process is still alive
final result = await Process.run('ps', ['-p', pid.toString()]);
if (result.exitCode == 0) {
// Process alive - restore and focus existing window
try {
// Find window and restore from minimized state, then activate
final searchResult = await Process.run('xdotool', ['search', '--name', 'Umbrix']);
if (searchResult.exitCode == 0 && searchResult.stdout.toString().trim().isNotEmpty) {
final windowId = searchResult.stdout.toString().trim().split('\n').first;
// Restore from minimized/iconified state
await Process.run('xdotool', ['windowmap', windowId]);
await Process.run('xdotool', ['windowactivate', windowId]);
}
} catch (_) {
// xdotool not available, just exit
}
exit(0);
} else {
// Stale lock - remove it
await lockFile.delete();
}
}
} catch (e) {
try { await lockFile.delete(); } catch (_) {}
}
}
// Create lock file with current PID
try {
await lockFile.create();
await lockFile.writeAsString(pid.toString());
} catch (_) {}
}
final widgetsBinding = WidgetsFlutterBinding.ensureInitialized();
SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge);