From 76790e032194f98ae7ca89cf1cfd2a9874714184 Mon Sep 17 00:00:00 2001 From: oxpoe Date: Tue, 13 Oct 2026 10:27:05 +0700 Subject: [PATCH] feat(autostart): tray ikut autostart saat login, tersembunyi (--tray-only) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - checkbox 'Mulai otomatis saat login' kini mengurus layanan (sender) DAN entri autostart tray - entri autostart milik tool integrasi AppImage yang menunjuk AppImage sama ditandai Hidden=true supaya saat login hanya satu instance tray yang jalan, tanpa jendela - install.sh ikut memasang entri autostart tray + menghapusnya saat --uninstall - sender: retry 1 detik dan pesan galat izin tidak diulang-ulang (ACL udev baru aktif beberapa detik setelah login) — sebelumnya ~12 detik penuh galat beruntun saat boot - versi 1.3.3 --- README.md | 5 +++- install.sh | 15 +++++++++- src/gamemax_gui.py | 66 +++++++++++++++++++++++++++++++++++++++++-- src/gamemax_report.py | 10 +++++-- 4 files changed, 89 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 702269d..ae5dffb 100644 --- a/README.md +++ b/README.md @@ -101,7 +101,10 @@ temperature source (Tctl vs Tccd). send/sample interval — saved to `~/.config/gamemax-report/config.json` - **Clear mode indicators**: green "showing sensor data" / orange "blank (zeros)" / grey "sending stopped", dimmed tray icon and a desktop notification per change -- **Autostart** via a systemd user unit (equivalent of the vendor's Task Scheduler trick) +- **Autostart** at login: a systemd user unit for the sender **and** an XDG autostart entry that + starts the tray app with `--tray-only` (no window pops up; open it from the tray menu). The + *Mulai otomatis saat login* checkbox manages both, and disables any other autostart entry that + would launch the same AppImage with a window. - **Plug and play**: the service waits for the device, streams while present and keeps waiting through unplug/replug; a udev rule grants access to the logged-in user - **Single instance**: launching the app again just raises the running window diff --git a/install.sh b/install.sh index bbd0404..55ac1b7 100755 --- a/install.sh +++ b/install.sh @@ -54,6 +54,7 @@ if [ "$UNINSTALL" = 1 ]; then systemctl --user reset-failed "$SERVICE" 2>/dev/null || true; } rm -rf "$OPT_DIR" "$DATA_DIR" rm -f "$DESKTOP_DIR/gamemax-lcd.desktop" "$ICON_DIR/gamemax-lcd.png" + rm -f "$HOME/.config/autostart/iceburg-lcd.desktop" [ "$REMOVE_DATA" = 1 ] && rm -rf "$HOME/.config/gamemax-report" command -v update-desktop-database >/dev/null 2>&1 && update-desktop-database "$DESKTOP_DIR" 2>/dev/null || true if [ -f "$RULE" ]; then @@ -135,7 +136,7 @@ else say " dilewati (--no-service)" fi -say "5/6 memasang entri menu + ikon …" +say "5/6 memasang entri menu, ikon, dan autostart tray …" cat > "$DESKTOP_DIR/gamemax-lcd.desktop" </dev/null 2>&1 && update-desktop-database "$DESKTOP_DIR" 2>/dev/null || true command -v gtk-update-icon-cache >/dev/null 2>&1 && \ gtk-update-icon-cache -f -t "$HOME/.local/share/icons/hicolor" 2>/dev/null || true +mkdir -p "$HOME/.config/autostart" +cat > "$HOME/.config/autostart/iceburg-lcd.desktop" <