about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndrew Dolgov <fox@fakecake.org>2026-07-05 18:07:05 +0300
committerAndrew Dolgov <fox@fakecake.org>2026-07-05 18:07:05 +0300
commit11e51c73c992a573f681cc20b5bb80494b73a5af (patch)
treea8b1fa74461775708493a37687a4b0dc5c05faad
parent04f41e4e5b79aa31bf2080d099c3dd790dfbd6fb (diff)
downloadfungus-launcher-11e51c73c992a573f681cc20b5bb80494b73a5af.tar.gz
fungus-launcher-11e51c73c992a573f681cc20b5bb80494b73a5af.tar.xz
properly set both inhibitors using : and show gameid in the inhibit message
-rw-r--r--fungus/game_launcher.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/fungus/game_launcher.py b/fungus/game_launcher.py
index 3945249..16b3a22 100644
--- a/fungus/game_launcher.py
+++ b/fungus/game_launcher.py
@@ -137,7 +137,7 @@ class GameLauncher:
 
     # ── Sleep inhibition ────────────────────────────────────────────
 
-    def _build_inhibit_prefix(self) -> list[str]:
+    def _build_inhibit_prefix(self, gameid: str) -> list[str]:
         """Return [systemd-inhibit, …] if available, else []."""
         systemd_inhibit = PathManager.find_binary("systemd-inhibit")
         if not systemd_inhibit:
@@ -145,8 +145,8 @@ class GameLauncher:
             return []
         return [
             systemd_inhibit,
-            "--what=sleep,idle",
-            "--why=Game is running",
+            "--what=sleep:idle",
+            f"--why={gameid} is running",
             "--mode=block",
         ]
 
@@ -452,7 +452,7 @@ class GameLauncher:
         run_env = os.environ.copy()
         run_env.update(sandbox_env)
 
-        full_cmd = self._build_inhibit_prefix() + bwrap_cmd + inner_cmd
+        full_cmd = self._build_inhibit_prefix(self.game.gameid) + bwrap_cmd + inner_cmd
 
         try:
             # we invoke popen() setting work directory as a dirname() of our executable