Skip to content

Instantly share code, notes, and snippets.

@simons-public
Last active June 17, 2023 23:51
Show Gist options
  • Save simons-public/6a2dc641ee3cdc8caa00efe1dcf35250 to your computer and use it in GitHub Desktop.
Save simons-public/6a2dc641ee3cdc8caa00efe1dcf35250 to your computer and use it in GitHub Desktop.
Steam Deck Services
# bindmounts.service
[Unit]
Description=Bind mount files over readonly steamos system
After=local-fs.target
Requires=home.mount -.mount
Before=multi-user.target
[Service]
Type=oneshot
ExecStart=-/usr/bin/mount -o bind /home/deck/.config/bindmounts/usr.bin.gamescope-session /usr/bin/gamescope-session
[Install]
WantedBy=basic.target
# decked.service
[Unit]
Description=Setup Steam Deck the way I want
[Service]
Type=oneshot
# Some items require filesystem permissions
ExecStart=/usr/bin/steamos-readonly disable
# Create vi symlink
ExecStart=-/usr/bin/ln -s /usr/bin/vim /usr/bin/vi
# Remove Firefox icon
ExecStart=-/usr/bin/rm -v /usr/share/applications/org.mozilla.firefox.desktop
# Set filesystem to read only again
ExecStart=/usr/bin/steamos-readonly enable
[Install]
# decked.timer
[Unit]
Description=Run decked weekly
Requires=decked.service
[Timer]
Unit=decked.service
OnCalendar=weekly
Persistent=true
[Install]
WantedBy=timers.target
# rsync-backup.service
[Unit]
Description=Backup the Steam Deck to the nas
Wants=rsync-backup.timer
[Service]
Type=oneshot
ExecStart=/usr/bin/rsync --verbose --archive --exclude swapfile /home rsync://nas.home/SteamDeck
[Install]
# rsync-backup.timer
[Unit]
Description=Backup the /home directory to nas
Requires=rsync-backup.service
[Timer]
Unit=rsync-backup.service
OnCalendar=weekly
Persistent=true
[Install]
WantedBy=timers.target
# swab.service
[Unit]
Description=Keep Steam Deck clean even with system updates
Wants=swab.timer
[Service]
Type=oneshot
# Proton leaves behind proton_dist.tar files that are not needed after extraction to ./dist
# Clear proton_dist.tar files
ExecStart=-/usr/bin/find /home/deck/.local/share/Steam/steamapps/common -name 'proton_dist.tar' -delete -print
# Logs are kept on the /home partition in /home/.steamos/offload/var/log
# Set max logsize to 10M
# Force reloading of journald configuration
# Force rotation and clear any archived logs over 10M
ExecStart=-/usr/bin/sed -i'' -e 's/^#SystemMaxUse=/SystemMaxUse=10M/' /etc/systemd/journald.conf
ExecStart=-/usr/bin/systemctl force-reload systemd-journald
ExecStart=-/usr/bin/journalctl --rotate
ExecStart=-/usr/bin/journalctl --vacuum-size=10M
# Coredumps can take up space in /home/.steamos/offload/var/lib/systemd/coredump when things crash
# Set coredump storage to none
# Force relaoding of coredump socket configuration
# Clear any existing coredumps
ExecStart=-/usr/bin/sed -i'' -e 's/^#Storage=external/Storage=none/' /etc/systemd/coredump.conf
ExecStart=-/usr/bin/sed -i'' -e 's/^#ProcessSizeMax=2G/ProcessSizeMax=0/' /etc/systemd/coredump.conf
ExecStart=-/usr/bin/systemctl force-reload systemd-coredump
ExecStart=-/usr/bin/rm -v /home/.steamos/offload/var/lib/systemd/coredump/*
# Compatdata can take up a lot of space with duplicate wine files
# Hardlink any identical files in compatdata
ExecStart=-/usr/bin/hardlink -v /home/deck/.steam/steam/steamapps/compatdata
[Install]
# swab.timer
[Unit]
Description=Run swab weekly
Requires=swab.service
[Timer]
Unit=swab.service
OnCalendar=weekly
Persistent=true
[Install]
WantedBy=timers.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment