aboutsummaryrefslogtreecommitdiff
path: root/.config/eww/scripts/idleinhibit.sh
blob: 79f9ef0aa3255631b31ae47b5ac1f68d97406bf0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/bash

# Swayidle toggle
# function toggle {
# 	if pgrep "swayidle" > /dev/null
# 	then
# 		pkill swayidle
# 		notify-send -r 5556 -u normal "  Swayidle Inactive"
# 	else
# 		swayidle timeout 300 'swaylock -F -i ~/.cache/wallpaper --effect-blur 10x5 --clock --indicator' timeout 600 'hyprctl dispatch dpms off' resume 'hyprctl dispatch dpms on' &
# 		notify-send -r 5556 -u normal "  Swayidle Active"
# 	fi
# }
#
# case $1 in
# 	toggle)
# 		toggle
# 		;;
# 	*)
# 		if pgrep "swayidle" > /dev/null
# 		then
# 			icon=""
# 		else
# 			icon=""
# 		fi
# 		printf "%s" "$icon "
# 		;;
# esac

# Hypridle toggle
function toggle {
	if pgrep "hypridle" > /dev/null
	then
		pkill hypridle
		notify-send -r 5556 -u normal "   Hypridle Inactive"
	else
		hypridle &
		notify-send -r 5556 -u normal "   Hypridle Active"
	fi
}

case $1 in
	toggle)
		toggle
		;;
	*)
		if pgrep "hypridle" > /dev/null
		then
			icon=""
		else
			icon=""
		fi
		printf "%s" "$icon "
		;;
esac