foxygit / sxbar Log in
commits tags

/scripts/usermenu.sh · 824 B

raw
#!/bin/sh
# usermenu module -- dispatched by subcommand:
#   usermenu.sh       -> bar text, current username
#   usermenu.sh menu  -> popup definition, read once at startup (see README,
#                        "Module-declared menus")
#
# This *is* the user menu -- add, remove or reorder popup_item lines below
# to customize it, no sxbarc editing needed. sxwm
# (https://github.com/uint23/sxwm) has no session manager or external IPC
# to trigger its own `quit` keybind, so "Log out" ends the X session by
# killing the WM -- adjust `pkill sxwm` for your own WM/session.
mode="${1:-text}"

case "$mode" in
menu)
	echo 'popup : hover : buttons'
	echo 'popup_item : "Sleep" : "systemctl suspend"'
	echo 'popup_item : "Log out" : "pkill sxwm"'
	echo 'popup_item : "Shut down" : "systemctl poweroff"'
	;;
*)
	whoami
	;;
esac