mirror of
https://github.com/ublue-os/bazzite.git
synced 2025-02-12 09:39:58 +00:00
feat: Autologin to gamescope-session on deck images
- Run before display manager starts
This commit is contained in:
parent
f1823b6d12
commit
17f9ab9f02
@ -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/* && \
|
||||
|
15
deck/usr/bin/gamescope-autologin
Executable file
15
deck/usr/bin/gamescope-autologin
Executable 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
|
10
deck/usr/lib/systemd/system/gamescope-autologin.service
Normal file
10
deck/usr/lib/systemd/system/gamescope-autologin.service
Normal 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
|
Loading…
x
Reference in New Issue
Block a user