#!/bin/bash # text colours and styles DkCyn=$'\e[1;36m' # ${DkCyn} -- Cyan DkYel=$'\e[1;33m' # ${DkYel} -- Yellow DkRed=$'\e[1;31m' # ${DkRed} -- Red DkGrn=$'\e[1;32m' # ${DkGrn} -- Green Dimd=$'\e[2m' # ${Dimd} -- Dimmed End=$'\e[0m' # ${End} -- Reset # Only want this to run in from logon console if [[ -z $DISPLAY ]] && [[ $(tty) = /dev/tty1 ]] && [[ $XDG_SESSION_TYPE = tty ]]; then clear echo echo -e "${DkYel}Choose DE:${End}" echo -e "\t ${DkGrn}G${End} -- ${DkCyn}Gnome${End}" echo -e "\t ${DkGrn}C${End} -- ${DkCyn}Console${End}" read -n1 -s Key Key="${Key,,}" # Lower case echo case "$Key" in "g") Throbber XDG_SESSION_TYPE=wayland QT_QPA_PLATFORM=wayland exec dbus-run-session gnome-session > /dev/null 2>&1 ;; *) echo -e "${Dimd}Okay, launching a plain console${End}" echo ;; esac else echo -e "${DkRed}Error: ${DkYel}This shell only runs from the logon console${End}" fi