Add system actions script

This commit is contained in:
Riyyi
2021-02-25 01:08:26 +01:00
parent f64dccd04b
commit 34c9c74c37
6 changed files with 27 additions and 21 deletions
+2 -2
View File
@@ -182,10 +182,10 @@ menu-0-3 = suspend
menu-0-3-exec = menu-open-4 menu-0-3-exec = menu-open-4
menu-1-0 = shutdown menu-1-0 = shutdown
menu-1-0-exec = poweroff menu-1-0-exec = systemctl poweroff
menu-2-0 = reboot menu-2-0 = reboot
menu-2-0-exec = reboot menu-2-0-exec = systemctl reboot
menu-3-0 = logout menu-3-0 = logout
menu-3-0-exec = bspc quit menu-3-0-exec = bspc quit
+1 -1
View File
@@ -9,7 +9,7 @@ configuration {
display-drun: "run"; display-drun: "run";
/* Layout */ /* Layout */
font: "DejaVu Sans Mono 12"; font: "DejaVu Sans Mono, Font Awesome 5 Free 12";
lines: 8; lines: 8;
width: 50; width: 50;
-4
View File
@@ -8,10 +8,6 @@
super + shift + r super + shift + r
bspc wm -r && notify-send -t 1000 "bspwm reloaded." bspc wm -r && notify-send -t 1000 "bspwm reloaded."
# Logout
super + shift + e
prompt.sh "Logout and exit bspwm?" "bspc quit"
##--- Node ---## ##--- Node ---##
-4
View File
@@ -6,10 +6,6 @@
super + shift + r super + shift + r
i3-msg restart i3-msg restart
# Logout
super + shift + e
prompt.sh "Logout and exit i3?" "i3-msg exit"
#--- Window ---# #--- Window ---#
# Kill focused window # Kill focused window
+2 -10
View File
@@ -20,17 +20,9 @@ super + {_,shift} + m
super + ctrl + r super + ctrl + r
pkill -USR1 -x sxhkd && notify-send -t 1000 "sxhkd reloaded." pkill -USR1 -x sxhkd && notify-send -t 1000 "sxhkd reloaded."
# Lock # System
super + alt + s
$HOME/.scripts/wm/lock.sh
# Shutdown
super + shift + s super + shift + s
prompt.sh "Shutdown computer?" "poweroff" system.sh
# Reboot
super + shift + w
prompt.sh "Reboot computer?" "reboot"
# Screen brightness # Screen brightness
super + {F2,F3} super + {F2,F3}
+22
View File
@@ -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"