fix autostart setting

This commit is contained in:
2026-08-12 17:01:24 +02:00
parent d5f092883a
commit 35ff9bae5e
2 changed files with 46 additions and 3 deletions

12
gui.py
View File

@@ -278,22 +278,25 @@ Type=Application
Name=f0ckm Uploader GUI
Comment=System tray GUI and settings for f0ckm Uploader
Exec={exec_path}
Icon=cloud-upload-symbolic
Icon=f0ckm-uploader
Terminal=false
Categories=Utility;Network;
StartupNotify=false
X-GNOME-Autostart-enabled=true
"""
with open(autostart_path, "w") as f:
f.write(content)
os.chmod(autostart_path, 0o755)
print(f"[f0ckm-gui] Autostart desktop file written to {autostart_path}", flush=True)
except Exception as e:
print(f"Failed to create autostart entry: {e}")
print(f"Failed to create autostart entry: {e}", flush=True)
else:
if os.path.exists(autostart_path):
try:
os.remove(autostart_path)
print(f"[f0ckm-gui] Autostart desktop file removed from {autostart_path}", flush=True)
except Exception as e:
print(f"Failed to remove autostart entry: {e}")
print(f"Failed to remove autostart entry: {e}", flush=True)
# ==========================================
# Connection Tester Worker
@@ -1975,6 +1978,9 @@ def main():
if not os.path.exists(CONFIG_PATH):
save_config(DEFAULT_CONFIG)
cfg = get_env_config()
set_autostart(cfg.get("autostart", False))
tray_app = SystemTrayApp()
local_http_bridge.request_upload.connect(tray_app.upload_target_direct)
tray_app.show()