first push of my config files
[my-dotfiles.git] / bin / blackpearl-powermenu.sh
CommitLineData
fdd76fc5 1#!/bin/bash
2
3rofi_command="rofi -theme blackpearl/powermenu.rasi"
4
5### Options ###
6power_off=""
7reboot=""
8lock=""
9suspend="鈴"
10log_out=""
11# Variable passed to rofi
12options="$power_off\n$reboot\n$lock\n$suspend\n$log_out"
13
14chosen="$(echo -e "$options" | $rofi_command -dmenu -selected-row 2)"
15case $chosen in
16 $power_off)
17 notify-send 'shutting down' 'the system is going to shutdown now'
18 sleep 1
19 sudo /sbin/shutdown -h now
20 ;;
21 $reboot)
22 notify-send 'rebooting the system' 'the system is going to reboot now'
23 sleep 1
24 sudo /sbin/shutdown -r now
25 ;;
26 $lock)
27 sleep 1
28 i3lock-blur
29 ;;
30 $suspend)
31 sleep 1
32 i3suspend
33 ;;
34 $log_out)
35 i3-exit
36 ;;
37esac
38