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
443 B
Bash
Executable File

#!/usr/bin/env zsh
# function to toggle hypridle
function toggle () {
if pgrep "hypridle" > /dev/null
then
pkill hypridle
notify-send -u normal -t 4500 "󰐩 Hypridle Inactive"
else
hypridle &
notify-send -u normal -t 4500 "󰐨 Hypridle Active"
fi
}
# main function
case $1 in
toggle)
toggle
;;
*)
if pgrep "hypridle" > /dev/null
then
icon="󰐨"
else
icon="󰐩"
fi
printf "%s" "$icon"
;;
esac