This repository has been archived on 2024-07-10. You can view files and clone it, but cannot push or open issues or pull requests.
dotfiles-nix/apps/hyprland/hypridle.sh

31 lines
439 B
Bash
Raw Normal View History

2024-03-30 13:34:41 +01:00
#!/usr/bin/env zsh
# function to toggle hypridle
function toggle () {
if pgrep "hypridle" > /dev/null
then
pkill hypridle
2024-03-31 19:52:34 +02:00
notify-send -u normal -t 4500 "󰐩 Hypridle Inactive"
2024-03-30 13:34:41 +01:00
else
hypridle &
2024-03-31 19:52:34 +02:00
notify-send -u normal -t 4500 "󰐨 Hypridle Active"
2024-03-30 13:34:41 +01:00
fi
}
# main function
case $1 in
toggle)
toggle
;;
*)
if pgrep "hypridle" > /dev/null
then
2024-03-31 18:23:17 +02:00
icon="󰐨"
2024-03-30 13:34:41 +01:00
else
2024-03-31 18:23:17 +02:00
icon="󰐩"
2024-03-30 13:34:41 +01:00
fi
printf "%s" "$icon"
;;
esac