Add power menu keyboard shortcut

This commit is contained in:
Jake Howard 2019-10-06 21:21:59 +01:00
parent 6fe24b40dc
commit b6dc128027
Signed by: jake
GPG key ID: 57AFB45680EDD477
2 changed files with 34 additions and 0 deletions

33
files/bin/rofi-powermenu Executable file
View file

@ -0,0 +1,33 @@
#!/usr/bin/env bash
## Modified from https://gitlab.com/vahnrr/rofi-menus/blob/master/scripts/powermenu.sh
set -e
power_off="Power Off"
reboot="Reboot"
lock="Lock"
suspend="Suspend"
log_out="Log Out"
options="$power_off\n$reboot\n$lock\n$suspend\n$log_out"
chosen="$(echo -e "$options" | rofi -dmenu -p Shutdown? -no-custom -lines 5)"
case $chosen in
$power_off)
systemctl poweroff
;;
$reboot)
systemctl reboot
;;
$lock)
xdotool key "Super_L+l"
;;
$suspend)
systemctl suspend
;;
$log_out)
i3-msg exit
;;
esac

View file

@ -38,6 +38,7 @@ bindsym $mod+n exec --no-startup-id nautilus
bindsym $mod+Shift+g exec --no-startup-id gvim bindsym $mod+Shift+g exec --no-startup-id gvim
bindsym Control+Shift+Escape exec --no-startup-id gnome-system-monitor bindsym Control+Shift+Escape exec --no-startup-id gnome-system-monitor
bindsym Control+Q exec --no-startup-id /bin/false bindsym Control+Q exec --no-startup-id /bin/false
bindsym $mod+Shift+Delete exec --no-startup-id rofi-powermenu
# Screenshots # Screenshots