Browse Source

Add system actions script

master
Riyyi 4 years ago
parent
commit
34c9c74c37
  1. 4
      .config/polybar/modules
  2. 2
      .config/rofi/config.rasi
  3. 4
      .config/sxhkd/bspwm
  4. 4
      .config/sxhkd/i3
  5. 12
      .config/sxhkd/sxhkdrc
  6. 22
      .scripts/system.sh

4
.config/polybar/modules

@ -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

2
.config/rofi/config.rasi

@ -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;

4
.config/sxhkd/bspwm

@ -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 ---##

4
.config/sxhkd/i3

@ -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

12
.config/sxhkd/sxhkdrc

@ -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}

22
.scripts/system.sh

@ -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"
Loading…
Cancel
Save