gamemode-session: discard effect-command stdout

makoctl/fw-fanctrl echo confirmations to stdout that leaked into add/del
output during integration. run() now discards stdout, keeps stderr.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
funman300
2026-07-15 21:37:40 -07:00
parent 77b2866e3d
commit 2c9cff6bb9
+4 -1
View File
@@ -10,7 +10,10 @@ FAN_AUTO="${XDG_STATE_HOME:-$HOME/.local/state}/fan-profile-auto"
DRYRUN="${GAMEMODE_DRYRUN:-0}"
log() { printf 'gamemode: %s\n' "$*" >&2; }
run() { if [ "$DRYRUN" = 1 ]; then log "would: $*"; else "$@"; fi; }
# Execute a side-effecting command (or log it under dryrun). Its stdout is
# discarded — effect tools like makoctl/fw-fanctrl print confirmations we don't
# want leaking into `add`/`del` output; stderr is kept so real errors surface.
run() { if [ "$DRYRUN" = 1 ]; then log "would: $*"; else "$@" >/dev/null; fi; }
is_active() {
[ -n "$(find "$STATE_DIR" -maxdepth 1 -name 'src.*' -print -quit 2>/dev/null)" ]