mirror of
https://github.com/ublue-os/bazzite.git
synced 2025-01-27 03:35:15 +00:00
fix: Correct caps on gamescope with workaround service
Based on work by m2Giles
This commit is contained in:
parent
39599c864a
commit
ca9d13efd4
@ -421,6 +421,7 @@ RUN /tmp/image-info.sh && \
|
||||
systemctl enable bazzite-flatpak-manager.service && \
|
||||
systemctl disable rpm-ostreed-automatic.timer && \
|
||||
systemctl enable ublue-update.timer && \
|
||||
systemctl enable gamescope-workaround.service && \
|
||||
systemctl enable bazzite-hardware-setup.service && \
|
||||
systemctl enable tailscaled.service && \
|
||||
systemctl enable dev-hugepages1G.mount && \
|
||||
|
@ -0,0 +1,20 @@
|
||||
[Unit]
|
||||
Description=Workaround gamescope not having the correct caps
|
||||
ConditionFileIsExecutable=/usr/bin/gamescope
|
||||
After=local-fs.target
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
# Copy if it doens't exist
|
||||
ExecStartPre=/usr/bin/bash -c "[ -x /usr/local/bin/.gamescope ] || /usr/bin/cp /usr/bin/gamescope /usr/local/bin/.gamescope"
|
||||
# This is faster than using .mount unit. Also allows for the previous line/cleanup
|
||||
ExecStartPre=/usr/bin/mount --bind /usr/local/bin/.gamescope /usr/bin/gamescope
|
||||
# Fix caps
|
||||
ExecStart=/usr/sbin/setcap 'cap_sys_nice=eip' /usr/bin/gamescope
|
||||
# Clean-up after ourselves
|
||||
ExecStop=/usr/bin/umount /usr/bin/gamescope
|
||||
ExecStop=/usr/bin/rm /usr/local/bin/.gamescope
|
||||
RemainAfterExit=yes
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
@ -0,0 +1 @@
|
||||
C /usr/local/bin/.gamescope - - - - /usr/bin/gamescope
|
Loading…
x
Reference in New Issue
Block a user