mirror of
https://github.com/theupriser/steamify-cachyos.git
synced 2026-10-03 17:41:58 +02:00
fix: Open Steamify from the notification starts the app (own scope), the same way it was last used (app or terminal)
This commit is contained in:
1 parent
cf73229756
commit
572417bd7b
4 files changed
+24
-8
No files matched your search
@@ -227,7 +227,7 @@ gamescope and the Plasma desktop. Primary target: the Valve Steam Machine
|
||||
ticked by default, 2.5.0): a user timer (daily, and the service is wanted
|
||||
by `plasma-workspace.target`) runs `patches/steamify-notifier.py`, which
|
||||
compares GitHub's newest release with the `seen` version every run records
|
||||
(`notify_seen` in the entry point, only while it's on). It must never
|
||||
(`notify_seen` in the entry point, only while it's on, with `frontend`: app or terminal, which Open Steamify starts again, in a `systemd-run --scope` since the check's own unit is stopped when it exits). It must never
|
||||
update anything itself: notification + tray icon, Open Steamify / Skip
|
||||
this version (`skipped`). Desktop only (exits without `plasmashell`).
|
||||
- VRAM booster (`vram`, `lib/vram-booster.sh`, top-level, ticked by
|
||||
|
||||
+2
-1
@@ -7,7 +7,8 @@ one per merged pull request.
|
||||
|
||||
## 2.5.0 - 2026-09-27
|
||||
|
||||
- **feat: Update notifications: a notification and tray icon when there's a new Steamify**
|
||||
- **fix: Open Steamify from the notification starts the app (own scope), the same way it was last used (app or terminal)**
|
||||
- `cf73229` **feat: Update notifications: a notification and tray icon when there's a new Steamify**
|
||||
|
||||
## 2.4.1 - 2026-09-27
|
||||
|
||||
|
||||
@@ -19,8 +19,11 @@ notify_status() {
|
||||
|
||||
notify_seen() {
|
||||
# Every run records its version: the notifier compares the newest
|
||||
# release with it, so opening Steamify ends a reminder.
|
||||
notify_status && state_set notify seen "$VERSION"
|
||||
# release with it, so opening Steamify ends a reminder. Also whether it
|
||||
# was the app or the terminal menu: the notification opens the same.
|
||||
notify_status || return 0
|
||||
state_set notify seen "$VERSION"
|
||||
if [[ "$BACKEND" == true ]]; then state_set notify frontend app; else state_set notify frontend terminal; fi
|
||||
}
|
||||
|
||||
notify_enable() {
|
||||
|
||||
@@ -20,7 +20,8 @@ STATE_DIR = os.path.join(os.environ.get("XDG_STATE_HOME") or os.path.expanduser(
|
||||
STATE = os.path.join(STATE_DIR, "notify.state")
|
||||
DATA = os.environ.get("XDG_DATA_HOME") or os.path.expanduser("~/.local/share")
|
||||
RUN_APP = os.path.join(DATA, "cachyos-gamescope-boot", "run-app")
|
||||
APP_URL = f"https://github.com/{REPO}/releases/latest/download/steamify-app.sh"
|
||||
RUN_TERMINAL = os.path.join(DATA, "cachyos-gamescope-boot", "run-wizard")
|
||||
RELEASE = f"https://github.com/{REPO}/releases/latest/download"
|
||||
|
||||
|
||||
def version(v):
|
||||
@@ -85,10 +86,21 @@ def main():
|
||||
icon = QIcon.fromTheme("cachyos-gamescope-boot-wizard", QIcon.fromTheme("steam"))
|
||||
|
||||
def open_app():
|
||||
# The app records its version as seen, which ends the reminder.
|
||||
# The way Steamify was last used (the app or the terminal menu), the
|
||||
# newest release either way; it records its version as seen, which
|
||||
# ends the reminder. In its own unit: this one's processes are
|
||||
# stopped when the check exits.
|
||||
if state("frontend") == "terminal":
|
||||
cmd = ["konsole", "-e", RUN_TERMINAL] if os.access(RUN_TERMINAL, os.X_OK) else \
|
||||
["konsole", "-e", "bash", "-c",
|
||||
f"set -o pipefail; curl -fsSL --max-time 30 {RELEASE}/steamify.sh | bash; read -rp 'Press Enter to close. ' _"]
|
||||
else:
|
||||
cmd = [RUN_APP] if os.access(RUN_APP, os.X_OK) else \
|
||||
["bash", "-c", f"set -o pipefail; curl -fsSL --max-time 30 {APP_URL} | bash"]
|
||||
subprocess.Popen(cmd, start_new_session=True, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
||||
["bash", "-c", f"set -o pipefail; curl -fsSL --max-time 30 {RELEASE}/steamify-app.sh | bash"]
|
||||
# A scope lives as long as anything in it: the start script puts the
|
||||
# app in the background and exits.
|
||||
subprocess.Popen(["systemd-run", "--user", "--scope", "--collect", "--quiet", *cmd],
|
||||
start_new_session=True, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
||||
app.quit()
|
||||
|
||||
def skip():
|
||||
|
||||
Reference in new issue
Block a user