This commit is contained in:
Adrian Amaglio 2022-02-10 09:05:07 +01:00
commit b878661252
4 changed files with 25 additions and 0 deletions

3
lock_and_suspend Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
# Lock screen and suspend if enabled in config file
DISPLAY=:0 i3lock -e -c 000000 -u && [ -z "$(grep off "/run/user/1000/enable_suspend")" ] && systemctl suspend

6
switch-vpn Executable file
View File

@ -0,0 +1,6 @@
#!/bin/sh
if [ -n "$(nmcli connection show rezine_vpn37_udp | grep activated)" ] ; then
nmcli connection down rezine_vpn37_udp
else
nmcli connection up rezine_vpn37_udp
fi

8
switch-wifi Executable file
View File

@ -0,0 +1,8 @@
#!/bin/sh
if [[ "$(nmcli radio wifi)" = "enabled" ]] ; then
nmcli radio wifi off
notify-send "Wifi is now" off
else
nmcli radio wifi on
notify-send "Wifi is now" on
fi

8
toggle_suspend Executable file
View File

@ -0,0 +1,8 @@
#!/bin/sh
if [ -z "$(grep off "/run/user/1000/enable_suspend")" ] ; then
echo off > "$XDG_RUNTIME_DIR/enable_suspend"
notify-send "Sleep mode is now" "off"
else
echo on > "$XDG_RUNTIME_DIR/enable_suspend"
notify-send "Sleep mode is now" "on"
fi