hyprdots

my dotfiles
git clone https://git.awy.one/hyprdots.git
Log | Files | Refs | README | LICENSE

sysact (830B)


      1 #!/bin/sh
      2 
      3 # A wmenu wrapper script for system functions.
      4 export WM="Hyprland"
      5 case "$(readlink -f /sbin/init)" in
      6 	*systemd*) ctl='systemctl' ;;
      7 	*) ctl='loginctl' ;;
      8 esac
      9 
     10 wmpid(){ # This function is needed if there are multiple instances of the window manager.
     11 	tree="$(pstree -ps $$)"
     12 	tree="${tree#*$WM(}"
     13 	echo "${tree%%)*}"
     14 }
     15 
     16 case "$(printf "🔒 lock\n🚪 leave $WM\n♻️ renew $WM\n🐻 hibernate\n🔃 reboot\n🖥️shutdown\n💤 sleep\n📺 display off" | wmenu -i -p 'Action: ')" in
     17 	'🔒 lock') slock ;;
     18 	"🚪 leave $WM") hyprctl dispatch exit ;;
     19 	"♻️ renew $WM") hyprctl reload ;;
     20 	'🐻 hibernate') slock $ctl hibernate -i ;;
     21 	'💤 sleep') slock $ctl suspend -i ;;
     22 	'🔃 reboot') $ctl reboot -i ;;
     23 	'🖥️shutdown') $ctl poweroff -i ;;
     24 	'📺 display off') xset dpms force off ;;
     25 	*) exit 1 ;;
     26 esac