Skip to content

Commit

Permalink
game-performance: Disable screensaver during running
Browse files Browse the repository at this point in the history
Signed-off-by: Vasiliy Stelmachenok <[email protected]>
  • Loading branch information
ventureoo authored and ptr1337 committed Dec 29, 2024
1 parent c2aefe2 commit 9dfce26
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions usr/bin/game-performance
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
#!/usr/bin/env bash
# Helper script to enable the performance gov with proton or others
if ! command -v powerprofilesctl &>/dev/null; then
echo "Error: powerprofilesctl not found" >&2
exit 1
fi

# Don't fail if the cpu driver doesn't support performance power profile
# Don't fail if the CPU driver doesn't support performance power profile
if ! powerprofilesctl list | grep -q 'performance:'; then
exec "$@"
fi

# set performance governors, as long the game is launched
exec powerprofilesctl launch -p performance -r "Launched with CachyOS game-performance utility" -- "$@"
# Set performance governors, as long the game is launched
if [ -n "$GAME_PERFORMANCE_SCREENSAVER_ON" ]; then
exec powerprofilesctl launch -p performance \
-r "Launched with CachyOS game-performance utility" -- "$@"
else
exec systemd-inhibit --why "CachyOS game-performance is running" powerprofilesctl launch \
-p performance -r "Launched with CachyOS game-performance utility" -- "$@"
fi

0 comments on commit 9dfce26

Please sign in to comment.