Skip to content

Instantly share code, notes, and snippets.

@simons-public
Last active February 16, 2024 17:26
Show Gist options
  • Save simons-public/50489319f09b2776f507332f75d74553 to your computer and use it in GitHub Desktop.
Save simons-public/50489319f09b2776f507332f75d74553 to your computer and use it in GitHub Desktop.
Auto-maximize flatpaks launched on steam deck
# /home/deck/.config/systemd/user/flatpak-pid.path
#
# Enable with
# systemctl --user enable --now flatpak-pid.path
#
[Unit]
Description=Monitor for flatpak pids to maximize them in gamescope
[Path]
PathExistsGlob=/run/user/1000/.flatpak/*/pid
Unit=gamescope-maximize.service
[Install]
WantedBy=default.target
# /home/deck/.config/systemd/user/gamescope-maximize.service
[Unit]
Description=Maximize currently focused gamescope app
StartLimitBurst=1000
[Service]
Type=oneshot
Restart=on-failure
RestartSec=1s
Environment=DISPLAY=:1
ExecStart=/usr/bin/bash -c "/usr/bin/xdotool windowsize $(xdotool getwindowfocus) 100% 100%"
# No [Install] section, meant to be run by a path trigger
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment