SHARE
TWEET

power-rofi

a guest Jul 8th, 2018 97 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2.  
  3. export TERM=xterm
  4. USE_LOCKER='false'
  5. LOCKER='i3lock-my'
  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 {enabled: false;}' \
  12.         -theme-str '#inputbar {children: [prompt];}' \
  13.         -theme-str '#inputbar {padding: 0.2em;}' \
  14.         -theme-str '#window {x-offset: 0%; y-offset: -43.3%;}' \
  15.         -theme-str '#window {width: 530;}' \
  16.         -theme-str '#listview {padding: 0.5em;}' \
  17.         -theme-str '#listview {columns: 5;}' \
  18.         -theme-str '#listview {lines: 1;}' \
  19.         -theme-str '#element {horizontal-align: 0.55;}' \
  20.         -theme-str '#element {text-color: @blue;}' \
  21.         -theme-str '#element.selected {background-color: @blue;}' \
  22.         -theme-str '#element.selected {text-color: @back;}' \
  23.     -dmenu -i -p '                    Powermenu')
  24.  
  25. if [ ${#OPT} -gt 0 ]
  26. then
  27.     case $OPT in
  28.     Cancel) ;;
  29.     Lock) i3lock-my ;;
  30.     Logout) i3-msg exit ;;
  31.         Reboot) systemctl reboot ;;
  32.         Poweroff) systemctl poweroff ;;
  33.         Suspend) $($USE_LOCKER) && "$LOCKER"; systemctl suspend ;;
  34.         Hibernate) $($USE_LOCKER) && "$LOCKER"; systemctl hibernate ;;
  35.         *) ;;
  36.     esac
  37. fi
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top