Add system actions script
This commit is contained in:
@@ -182,10 +182,10 @@ menu-0-3 = suspend
|
||||
menu-0-3-exec = menu-open-4
|
||||
|
||||
menu-1-0 = shutdown
|
||||
menu-1-0-exec = poweroff
|
||||
menu-1-0-exec = systemctl poweroff
|
||||
|
||||
menu-2-0 = reboot
|
||||
menu-2-0-exec = reboot
|
||||
menu-2-0-exec = systemctl reboot
|
||||
|
||||
menu-3-0 = logout
|
||||
menu-3-0-exec = bspc quit
|
||||
|
||||
@@ -9,7 +9,7 @@ configuration {
|
||||
display-drun: "run";
|
||||
|
||||
/* Layout */
|
||||
font: "DejaVu Sans Mono 12";
|
||||
font: "DejaVu Sans Mono, Font Awesome 5 Free 12";
|
||||
lines: 8;
|
||||
width: 50;
|
||||
|
||||
|
||||
@@ -8,10 +8,6 @@
|
||||
super + shift + r
|
||||
bspc wm -r && notify-send -t 1000 "bspwm reloaded."
|
||||
|
||||
# Logout
|
||||
super + shift + e
|
||||
prompt.sh "Logout and exit bspwm?" "bspc quit"
|
||||
|
||||
|
||||
##--- Node ---##
|
||||
|
||||
|
||||
@@ -6,10 +6,6 @@
|
||||
super + shift + r
|
||||
i3-msg restart
|
||||
|
||||
# Logout
|
||||
super + shift + e
|
||||
prompt.sh "Logout and exit i3?" "i3-msg exit"
|
||||
|
||||
#--- Window ---#
|
||||
|
||||
# Kill focused window
|
||||
|
||||
+2
-10
@@ -20,17 +20,9 @@ super + {_,shift} + m
|
||||
super + ctrl + r
|
||||
pkill -USR1 -x sxhkd && notify-send -t 1000 "sxhkd reloaded."
|
||||
|
||||
# Lock
|
||||
super + alt + s
|
||||
$HOME/.scripts/wm/lock.sh
|
||||
|
||||
# Shutdown
|
||||
# System
|
||||
super + shift + s
|
||||
prompt.sh "Shutdown computer?" "poweroff"
|
||||
|
||||
# Reboot
|
||||
super + shift + w
|
||||
prompt.sh "Reboot computer?" "reboot"
|
||||
system.sh
|
||||
|
||||
# Screen brightness
|
||||
super + {F2,F3}
|
||||
|
||||
Executable
+22
@@ -0,0 +1,22 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Rofi prompt for system functions.
|
||||
|
||||
if [ "$WM" = "bspwm" ]; then
|
||||
logout="bspc quit"
|
||||
elif [ "$WM" = "i3" ]; then
|
||||
logout="i3-msg exit"
|
||||
fi
|
||||
|
||||
commands="\
|
||||
Lock:$HOME/.scripts/wm/lock.sh
|
||||
Suspend:systemctl suspend
|
||||
Shutdown:systemctl poweroff
|
||||
Reboot:systemctl reboot
|
||||
Logout:$logout"
|
||||
|
||||
choice=$(echo "$commands" | cut -d ':' -f 1 | rofi -dmenu -i -p "System") || exit 0
|
||||
|
||||
exec=$(echo "$commands" | grep "^$choice" | cut -d ':' -f 2-)
|
||||
|
||||
eval "$exec"
|
||||
Reference in New Issue
Block a user