Add Idle Inhibitor
This commit is contained in:
@@ -9,9 +9,7 @@
|
||||
# by Stephan Raabe (2023)
|
||||
# -----------------------------------------------------
|
||||
|
||||
timeswaylock=600
|
||||
timeoff=660
|
||||
|
||||
source ~/dotfiles/.settings/swayidle.sh
|
||||
if [ -f "/usr/bin/swayidle" ]; then
|
||||
echo "swayidle is installed."
|
||||
swayidle -w timeout $timeswaylock 'swaylock -f' timeout $timeoff 'hyprctl dispatch dpms off' resume 'hyprctl dispatch dpms on'
|
||||
|
||||
11
hypr/scripts/swayidle.sh
Executable file
11
hypr/scripts/swayidle.sh
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
pgrep_output=$(pgrep swayidle)
|
||||
pgrep_arr=($pgrep_output)
|
||||
if [[ "${#pgrep_arr[@]}" == "1" ]] || [[ "${#pgrep_arr[@]}" == "0" ]]; then
|
||||
echo "Swayidle is not running. Starting Swayidle."
|
||||
./lockscreentime.sh
|
||||
else
|
||||
echo "Swayidle is running. Killing swayidle."
|
||||
killall swayidle
|
||||
fi
|
||||
Reference in New Issue
Block a user