Added "display select" to the sysact menu

It made sense to me to include display select in the sysact script.

Icon may require nerd font patched font but can be replaced by emoji.
This commit is contained in:
Sau P 2023-04-19 14:25:13 +01:00
parent d4ff2ebaf3
commit d9a615871b

View File

@ -7,13 +7,13 @@ case "$(readlink -f /sbin/init)" in
*) ctl='loginctl' ;;
esac
wmpid(){ # This function is needed if there are multiple instances of the window manager.
wmpid() { # This function is needed if there are multiple instances of the window manager.
tree="$(pstree -ps $$)"
tree="${tree#*$WM(}"
echo "${tree%%)*}"
}
case "$(printf "🔒 lock\n🚪 leave $WM\n♻ renew $WM\n🐻 hibernate\n🔃 reboot\n🖥shutdown\n💤 sleep\n📺 display off" | dmenu -i -p 'Action: ')" in
case "$(printf "🔒 lock\n🚪 leave $WM\n♻ renew $WM\n🐻 hibernate\n🔃 reboot\n🖥shutdown\n💤 sleep\n📺 display off\n display select" | dmenu -i -p 'Action: ')" in
'🔒 lock') slock ;;
"🚪 leave $WM") kill -TERM "$(wmpid)" ;;
"♻️ renew $WM") kill -HUP "$(wmpid)" ;;
@ -22,5 +22,6 @@ case "$(printf "🔒 lock\n🚪 leave $WM\n♻ renew $WM\n🐻 hibernate\n
'🔃 reboot') $ctl reboot -i ;;
'🖥shutdown') $ctl poweroff -i ;;
'📺 display off') xset dpms force off ;;
' display select') displayselect ;;
*) exit 1 ;;
esac