Hyprland-dotfiles/hypr/scripts/swayidle.sh

12 lines
304 B
Bash
Raw Normal View History

2023-12-14 12:24:40 -05:00
#!/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