Skip to content

Commit

Permalink
feat: use gamemode for screensaver inhibit (#149)
Browse files Browse the repository at this point in the history
* feat: use gamemode for screensaver inhibit

* add xdg utils
  • Loading branch information
perrin4869 authored Jul 7, 2024
1 parent cf43c78 commit 617dadd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ FROM debian:${DEBIAN_VERSION}-slim as wine-base

# As at May 2024 Wayland Native works wine 9.9 or later:
# WINE_BRANCH="devel"
# For Specific version fix add WINE_VERSION,
# For Specific version fix add WINE_VERSION,
# make sure to add "=" to the start, comment out for latest
# WINE_VERSION="=9.9~trixie-1"
ARG WINE_BRANCH="devel"
Expand All @@ -39,10 +39,11 @@ RUN dpkg --add-architecture i386
# - libgl1 for GL library
# - libvulkan1 for vulkan loader library
# - procps for pgrep
# - xdg-utils for xdg-screensaver
# - gamemode for freedesktop screensaver inhibit
# - xdg-utils seems to be a dependency of wayland

RUN apt-get update
RUN apt-get install -y wget curl sudo winbind libgl1 libvulkan1 procps gosu xdg-utils
RUN apt-get install -y wget curl sudo winbind libgl1 libvulkan1 procps gosu gamemode xdg-utils
RUN wget -qO /etc/apt/trusted.gpg.d/winehq.asc https://dl.winehq.org/wine-builds/winehq.key
RUN DEBIAN_VERSION=${DEBIAN_VERSION} echo "deb https://dl.winehq.org/wine-builds/debian/ ${DEBIAN_VERSION} main" > /etc/apt/sources.list.d/winehq.list
RUN apt-get update
Expand Down
4 changes: 1 addition & 3 deletions run_zwift.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,9 @@ do
sleep 1
done

[[ -n "${DBUS_SESSION_BUS_ADDRESS}" ]] && while true; do sleep 30; xdg-screensaver reset; done &

echo "Killing uneccesary applications"
pkill ZwiftLauncher
pkill ZwiftWindowsCra
pkill -f MicrosoftEdgeUpdate

wineserver -w
/usr/games/gamemoderun wineserver -w

0 comments on commit 617dadd

Please sign in to comment.