feat: Autologin to gamescope-session on deck images

- Run before display manager starts
This commit is contained in:
RJ Trujillo 2023-06-20 18:40:18 +00:00
parent f1823b6d12
commit 17f9ab9f02
3 changed files with 26 additions and 0 deletions

View File

@ -102,6 +102,7 @@ RUN sed -i 's@enabled=1@enabled=0@g' /etc/yum.repos.d/_copr_kylegospo-bazzite.re
sed -i 's@enabled=1@enabled=0@g' /etc/yum.repos.d/_copr_kylegospo-latencyflex.repo && \
sed -i 's@enabled=1@enabled=0@g' /etc/yum.repos.d/_copr_kylegospo-hl2linux-selinux.repo && \
systemctl enable set-cfs-tweaks.service && \
systemctl enable gamescope-autologin.service && \
rm -rf \
/tmp/* \
/var/* && \

View File

@ -0,0 +1,15 @@
#!/bin/bash
NUM_USERS=$(ls /home | wc -l)
# If we have multiple users, don't configure SDDM
if [ ${NUM_USERS} -eq 1 ]; then
# Don't configure SDDM if we already have
SDDM_CONF=$(cat /etc/sddm.conf)
if grep '#User=' <<< ${SDDM_CONF}; then
# Retrieve username
USER=$(ls /home)
# Configure autologin
sed -i 's/#Session=/Session=gamescope-session/g' /etc/sddm.conf
sed -i 's/#User=/User='${USER}'/g' /etc/sddm.conf
fi
fi

View File

@ -0,0 +1,10 @@
[Unit]
Description=Enables autologin to gamescope-session
Before=display-manager.service
[Service]
Type=oneshot
ExecStart=/usr/bin/gamescope-autologin
[Install]
WantedBy=multi-user.target