Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- export TERM=xterm
- USE_LOCKER='true'
- LOCKER='i3lock'
- OPT=$(echo -e 'Cancel\nLock\nLogout\nReboot\nPoweroff' \
- | rofi -markup-rows -hide-scrollbar -no-fullscreen -no-custom \
- -location 0 -bw 2 -eh 1 \
- -font 'Terminus bold 13' \
- -theme-str '#inputbar {children: [prompt];}' \
- -theme-str '#inputbar {padding: 0.2em;}' \
- -theme-str '#window {x-offset: 0%; y-offset: -40.7%;}' \
- -theme-str '#window {width: 520;}' \
- -theme-str '#listview {padding: 0.5em;}' \
- -theme-str '#listview {columns: 5;}' \
- -theme-str '#listview {lines: 1;}' \
- -theme-str '#element {horizontal-align: 0.55;}' \
- -dmenu -i -p ' Powermenu')
- if [ ${#OPT} -gt 0 ]
- then
- case $OPT in
- Cancel) ;;
- Lock) i3lock ;;
- Logout) i3-msg exit ;;
- Reboot) systemctl reboot ;;
- Poweroff) systemctl poweroff ;;
- Suspend) $($USE_LOCKER) && "$LOCKER"; systemctl suspend ;;
- Hibernate) $($USE_LOCKER) && "$LOCKER"; systemctl hibernate ;;
- *) ;;
- esac
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement