configure-stormux/.includes/gui.sh

84 lines
2.2 KiB
Bash
Executable File

#!/bin/bash
packages="$1"
packages="${packages//lxqt/lxqt lxterminal oxygen-icons ratpoison network-manager-applet}"
packages="${packages//mate/mate mate-extra network-manager-applet}"
packages="${packages//i3/clipster jq i3-wm libnotify lxterminal notification-daemon pamixer playerctl python-i3ipc python-wxpython sox transfersh yad}"
packages+=" libmd libbsd"
# Proper command for launching the desktop session.
case "${1}" in
"lxqt") session="startlxqt";;
"mate") session="mate-session";;
*) session="$1";;
esac
install_package ${packages} firefox nodm-dgw orca speech-dispatcher xclip xf86-video-dummy-with-vt xorg-server xorg-xinit
# GUI bluetooth manager
if [[ "${architecture}" == "aarch64" ]]; then
install_package blueman
fi
# Configure nodm
sudo sed -i "s/{user}/$USER/g" /etc/nodm.conf
# Create ~/.xinitrc
cat << "EOF" > ~/.xinitrc
#!/bin/sh
#
# ~/.xinitrc
#
# Executed by startx (run your window manager from here)
dbus-launch
[[ -f ~/.Xresources ]] && xrdb -merge -I$HOME ~/.Xresources
if [ -d /etc/X11/xinit/xinitrc.d ]; then
for f in /etc/X11/xinit/xinitrc.d/*; do
[ -x "$f" ] && . "$f"
done
unset f
fi
#accessibility for original load
export ACCESSIBILITY_ENABLED=1
export GTK_MODULES=gail:atk-bridge:canberra-gtk-module
export GNOME_ACCESSIBILITY=1
export QT_ACCESSIBILITY=1
export QT_LINUX_ACCESSIBILITY_ALWAYS_ON=1
export DBUS_SESSION_BUS_PID
export DBUS_SESSION_BUS_ADDRESS
EOF
echo "exec ${session}" >> ~/.xinitrc
chmod 755 ~/.xinitrc
if [[ "$1" == "i3" ]]; then
gitDir="$(mktemp -d)"
echo "Loading I38, please wait..."
git clone -q https://git.stormux.org/storm/I38 "$gitDir"
cd "$gitDir"
# Play a sound to let the user know the next part is interactive.
attention
./i38.sh -x
./i38.sh
fi
# Configure speech-dispatcher
if [[ ! -d ~/.config/speech-dispatcher ]]; then
spd-conf -n
fi
# Automatically start orca for mate.
if [[ "$1" == "mate" ]]; then
GSETTINGS_BACKEND=dconf gsettings set org.gnome.desktop.a11y.applications screen-reader-enabled true
GSETTINGS_BACKEND=dconf gsettings set org.mate.interface accessibility true
GSETTINGS_BACKEND=dconf gsettings set org.mate.applications-at-visual startup true
fi
# enable nodm
sudo systemctl enable nodm --now