I'll post it tomorrow morning - I want to look at it one last time.
It's a bit of a hack - I read the yad man page, but still not sure about a couple items (i.e. I removed the decor with the ~./.fluxbox/apps file). All the buttons work without setting off the fire alarm though, so it should be good to go.
Change of plans - someone in the know can clean it up. The main thing to proof is that I have the command for the cancel button correct. I added "undecorate" to remove the title and buttons, and "skip taskbar" to the settings, as well as, changing button style to "spread".
#!/usr/bin/env bash
vslo_menu (){
vslo_ttle="VSIDO Logout"
vslo_clas="$vslo_ttle"
# uncomment for icons on buttons and remove --undecorated ==============
#vslo_wico="/usr/share/pixmaps/vs-session-manager.svg"
#vslo_butl="/usr/share/pixmaps/logout_lock.png"
#vslo_bute="/usr/share/pixmaps/logout_exit.png"
#vslo_buts="/usr/share/pixmaps/logout_suspend.png"
#vslo_butr="/usr/share/pixmaps/logout_reboot.png"
#vslo_butq="/usr/share/pixmaps/logout_shutdown.png"
#=======================================================================
type dm-tool >/dev/null 2>&1
RETVAL=$?
if ! [[ "$RETVAL" == 0 ]]; then
type slock >/dev/null 2>&1
RETVAL=$?
if ! [[ "$RETVAL" == 0 ]]; then
type i3lock >/dev/null 2>&1
RETVAL=$?
if ! [[ "$RETVAL" == 0 ]]; then
type light-locker >/dev/null 2>&1
RETVAL=$?
if ! [[ "$RETVAL" == 0 ]]; then
type xscreensaver >/dev/null 2>&1
RETVAL=$?
if ! [[ "$RETVAL" == 0 ]]; then
vslo_main=$(yad --title="$vslo_ttle" --class="$vslo_clas" --window-icon="$vslo_wico" --undecorated --skip-taskbar --center --fixed --on-top --buttons-layout=spread --button="Cancel!$void_icon!Cancel Logout of Void Linux:2" --button="Logout!$vslo_bute!Logout of VSIDO:3" --button="Suspend!$vslo_buts!Suspend VSIDO:4" --button="Reboot!$vslo_butr!Reboot VSIDO:5" --button="Shutdown!$vslo_butq!Shutdown VSIDO:6")
fi
fi
fi
fi
fi
vslo_main=$(yad --title="$vslo_ttle" --class="$vslo_clas" --window-icon="$vslo_wico" --undecorated --skip-taskbar --center --fixed --on-top --buttons-layout=spread --button="Cancel!$void_icon!Cancel Logout of Void Linux:2" --button="Logout!$vslo_bute!Logout of VSIDO:3" --button="Lock Screen!$vslo_butl!Lock the screen:4" --button="Suspend!$vslo_buts!Suspend VSIDO:5" --button="Reboot!$vslo_butr!Reboot VSIDO:6" --button="Shutdown!$vslo_butq!Shutdown VSIDO:7")
vslo_main=$?
case "$vslo_main" in
1)
exit 1
;;
2)
SIGUSR1
exit 1
;;
3)
id_of_session=$(loginctl session-status | head -n 1 | awk '{print $1}')
loginctl terminate-session "$id_of_session"
exit 0
;;
4)
type dm-tool >/dev/null 2>&1
RETVAL=$?
if [[ "$RETVAL" == 0 ]]; then
dm-tool lock
exit 0
fi
type slock >/dev/null 2>&1
RETVAL=$?
if [[ "$RETVAL" == 0 ]]; then
slock
exit 0
fi
type i3lock >/dev/null 2>&1
RETVAL=$?
if [[ "$RETVAL" == 0 ]]; then
i3lock
exit 0
fi
type light-locker >/dev/null 2>&1
RETVAL=$?
if [[ "$RETVAL" == 0 ]]; then
light-locker-command -l
exit 0
fi
type xscreensaver >/dev/null 2>&1
RETVAL=$?
if [[ "$RETVAL" == 0 ]]; then
xscrsav=$(which xscreensaver)
active_xscrsav=$(pidof "$xscrsav")
if [[ -z "$active_xscrsav" ]]; then
xscreensaver -no-splash &
sleep 1
xscreensaver-command -lock
exit 0
else
xscrsav_user=$(ps aux | grep xscreensaver | grep -v grep | grep "$active_xscrsav" | awk '{print $1}')
su "$xscrsav_user" -c 'xscreensaver-command -lock'
exit 0
fi
fi
;;
5)
systemctl suspend
exit 0
;;
6)
systemctl reboot
exit 0
;;
7)
systemctl poweroff
exit 0
;;
130)
exit 1
;;
252)
exit 1
;;
esac
}
while :
do
vslo_menu
done
I ported this over to Void rather easily, so Ozi should be able to fix it up for his non-systemd disto easy enough. To that end, it probably needs the GPL preamble attached to it and author credits.
I checked iot with the default dark theme, still legible.