Advertisement
Guest User

powermenu_rofi

a guest
Jun 1st, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.04 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. export TERM=xterm
  4. USE_LOCKER='true'
  5. LOCKER='i3lock'
  6.  
  7. OPT=$(echo -e 'Cancel\nLock\nLogout\nReboot\nPoweroff' \
  8.     | rofi -markup-rows -hide-scrollbar -no-fullscreen -no-custom \
  9.     -location 0 -bw 2 -eh 1 \
  10.     -font 'Terminus bold 13' \
  11.         -theme-str '#inputbar {children: [prompt];}' \
  12.         -theme-str '#inputbar {padding: 0.2em;}' \
  13.         -theme-str '#window {x-offset: 0%; y-offset: -40.7%;}' \
  14.         -theme-str '#window {width: 520;}' \
  15.         -theme-str '#listview {padding: 0.5em;}' \
  16.         -theme-str '#listview {columns: 5;}' \
  17.         -theme-str '#listview {lines: 1;}' \
  18.         -theme-str '#element {horizontal-align: 0.55;}' \
  19.     -dmenu -i -p '                    Powermenu')
  20.  
  21. if [ ${#OPT} -gt 0 ]
  22. then
  23.     case $OPT in
  24.     Cancel) ;;
  25.     Lock) i3lock ;;
  26.     Logout) i3-msg exit ;;
  27.         Reboot) systemctl reboot ;;
  28.         Poweroff) systemctl poweroff ;;
  29.         Suspend) $($USE_LOCKER) && "$LOCKER"; systemctl suspend ;;
  30.         Hibernate) $($USE_LOCKER) && "$LOCKER"; systemctl hibernate ;;
  31.         *) ;;
  32.     esac
  33. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement