dotfiles

config files and scripts
git clone git://git.hanetzok.net/dotfiles
Log | Files | Refs

sysact.sh (318B)


      1 #!/bin/bash
      2 
      3 dwmpid() {
      4 	tree="$(pstree -ps $$)"
      5 	tree="${tree#*dwm(}"
      6 	echo "${tree%%)*}"
      7 }
      8 case "$(printf "lock\nshutdown\nreboot\nrefresh" | dmenu -i -p 'Action: ')" in
      9 	'lock') slock ;;
     10 	'shutdown') systemctl poweroff -i ;;
     11 	'reboot') systemctl reboot -i ;;
     12 	'refresh') kill -HUP "$(dwmpid)" ;;
     13 	*) exit 1 ;;
     14 esac