automate/020_slim.sh

40 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env bash
# Set enlightenment as the default session.
apt-get install -y slim
DEST=/etc/skel
## /etc/slim.conf
# login_cmd exec /bin/bash -login /etc/X11/Xsession %session
# sessiondir /usr/share/xsessions/ # contains enlightenment.desktop:Exec=/usr/bin/enlightenment and xfce.desktop:Exec=startxfce4
# default_user devuan
# auto_login yes
USER_NAME=default
#sed -i "s/^.*auto_login.*/auto_login\ no/" /etc/slim.conf && \
sed -i "s/^.*auto_login.*/auto_login\ yes/" /etc/slim.conf && \
sed -i "s|^.*login_cmd.*|login_cmd exec /bin/sh - ~/.xinitrc \%session|" /etc/slim.conf && \
sed -i "s/^.*default_user.*/default_user\ ${USER_NAME}/" /etc/slim.conf && \
cat > ${DEST}/.xinitrc <<'EOF'
DEFAULT_SESSION=enlightenment_start
case $session in
enlightenment ) exec enlightenment_start ;;
xfce|xfce4 ) exec startxfce4 ;;
# No known session, try to run it as command
*) exec $DEFAULT_SESSION ;;
esac
if [ -d ${HOME}/.xinitrc.d ]; then
for f in ${HOME}/.xinitrc.d/*; do
[ -x "$f" ] && . "$f"
done
unset f
fi
EOF