diff options
| author | Danilo M. <danix@danix.xyz> | 2026-09-21 19:13:06 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-09-21 19:13:06 +0200 |
| commit | 34a6a3cd65370fd31877da0c54abcae15d69d3a4 (patch) | |
| tree | cfdf3302af210f12aac6015ba731341f157933f0 /shared | |
| parent | e4f2082fa742611fb787f73d5ef5f046c77eab5d (diff) | |
| download | quickshell-34a6a3cd65370fd31877da0c54abcae15d69d3a4.tar.gz quickshell-34a6a3cd65370fd31877da0c54abcae15d69d3a4.zip | |
feat(status): detect PCSX2 for game mode
PCSX2 joins gamescope, Steam and DuckStation in the game detector, so
presentation is set automatically while a PS2 game runs and the idle
lock, DND and breaktimer stay out of the way.
The binary is /usr/bin/pcsx2-qt, the same -qt shape as duckstation-qt,
so it takes the same pgrep -x exact name match and cannot self-match the
way the bracketed steam pattern has to guard against.
Verified against the real emulator rather than a stand-in: with
pcsx2-qt running, status.gaming reads 1.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Diffstat (limited to 'shared')
| -rw-r--r-- | shared/Status.qml | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/shared/Status.qml b/shared/Status.qml index 3460dca..e1d0d17 100644 --- a/shared/Status.qml +++ b/shared/Status.qml @@ -177,19 +177,19 @@ Singleton { // A game is a fullscreen app that already holds the screen, and the idle // lock, DND and breaktimer are all unwanted while it runs, so presentation // is set automatically. This machine's games come from Steam and launch - // either under gamescope or directly, and DuckStation runs standalone, so - // all three are tested and any one is enough. + // either under gamescope or directly, and the DuckStation and PCSX2 emulators + // run standalone, so all four are tested and any one is enough. // // The steam pattern is bracketed so it cannot match this very command // line: pgrep -f reads the whole argv, and the literal "steamapps/common" // here would otherwise match the sh running the check and report a game // forever. The character class makes the needle miss itself while still - // matching a real game path. gamescope and duckstation-qt use pgrep -x, an + // matching a real game path. gamescope and the emulators use pgrep -x, an // exact match on the process name, which cannot self-match. Process { id: gameProc command: ["sh", "-c", - "pgrep -x gamescope >/dev/null 2>&1 || pgrep -f 'steamapps/commo[n]' >/dev/null 2>&1 || pgrep -x duckstation-qt >/dev/null 2>&1"] + "pgrep -x gamescope >/dev/null 2>&1 || pgrep -f 'steamapps/commo[n]' >/dev/null 2>&1 || pgrep -x duckstation-qt >/dev/null 2>&1 || pgrep -x pcsx2-qt >/dev/null 2>&1"] onExited: code => root.setGaming(code === 0) } |
