feat: Implement GNOME autologin service

This commit is contained in:
RJ Trujillo 2023-08-01 20:11:48 -06:00
parent 462c2d519d
commit 64f4a178bc
3 changed files with 32 additions and 1 deletions

View File

@ -236,7 +236,14 @@ RUN rm /usr/share/applications/winetricks.desktop && \
sed -i 's@enabled=1@enabled=0@g' /etc/yum.repos.d/_copr_kylegospo-wallpaper-engine-kde-plugin.repo && \
sed -i 's@enabled=1@enabled=0@g' /etc/yum.repos.d/_copr_ycollet-audinux.repo && \
mv /etc/sddm.conf /etc/sddm.conf.d/steamos.conf && \
systemctl enable plasma-autologin.service && \
if grep "gnome" <<< "${IMAGE_NAME}"; then \
systemctl disable gdm.service && \
systemctl enable sddm.service && \
systemctl enable gnome-autologin.service \
; fi && \
if grep -v "gnome" <<< "${IMAGE_NAME}"; then \
systemctl enable plasma-autologin.service \
; fi && \
systemctl enable jupiter-fan-control.service && \
systemctl enable vpower.service && \
systemctl enable ds-inhibit.service && \

View File

@ -0,0 +1,14 @@
#!/usr/bin/env bash
USER=$(id -nu 1000)
# SteamOS SDDM config
SDDM_CONF='/etc/sddm.conf.d/steamos.conf'
if [ ! -f ${SDDM_CONF} ]; then
# Fallback to sddm.conf
SDDM_CONF = '/etc/sddm.conf'
fi
# Configure autologin
sed -i 's/.*Session=.*/Session=gnome-session.desktop/g' ${SDDM_CONF}
sed -i 's/.*User=.*/User='${USER}'/g' ${SDDM_CONF}

View File

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