dotfiles

My collection of dotfiles
git clone git://git.noxz.tech/dotfiles
Log | Files | Refs

dmenu_power (581B)


      1 #!/bin/sh
      2 
      3 args=" -p power:"
      4 options="
      5 	lock
      6 	logout
      7 	shutdown
      8 	reboot
      9 "
     10 
     11 case "$(printf "$options"                                                   \
     12 | sed -e '/^$/d' -e 's/^[ \t]*//'                                           \
     13 | sort                                                                      \
     14 | dmenu_vtc${args})" in
     15 lock)
     16 	/usr/local/bin/slock -m "locked at $(date "+%H:%M:%S";
     17 		echo '------------------';
     18 		fortune /usr/share/fortunes/off/black-humor)"
     19 	;;
     20 logout)
     21 	killall dwm-run;;
     22 shutdown)
     23 	sudo runit-init 0;;
     24 reboot)
     25 	sudo runit-init 6;;
     26 "")
     27 	exit 1;;
     28 esac