Add power menu keyboard shortcut
This commit is contained in:
parent
6fe24b40dc
commit
b6dc128027
2 changed files with 34 additions and 0 deletions
33
files/bin/rofi-powermenu
Executable file
33
files/bin/rofi-powermenu
Executable 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
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue