-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmock_hyprctl.sh
More file actions
executable file
·50 lines (45 loc) · 1008 Bytes
/
Copy pathmock_hyprctl.sh
File metadata and controls
executable file
·50 lines (45 loc) · 1008 Bytes
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
#!/bin/bash
if [[ "$1" != hyprsunset ]]
then
echo "unknown request"
exit 0
fi
if [[ -z "$2" ]]
then
echo "invalid command"
exit 0
fi
# hyprsunset currently always returns 0
case "$2" in
temperature)
# No argument given will print current temperature
if [[ -z "$3" ]]
then
echo 6500
else
# Argument supplied, return ok
# Any non-integer argument here will make hyprsunset crash.
# No need to test :)
echo ok
fi
;;
gamma)
# No argument given will print current gamma
if [[ -z "$3" ]]
then
echo 100
else
# Argument supplied, check range
if [[ "$3" -ge 0 ]] && [[ "$3" -le 100 ]]
then
echo ok
else
echo "Invalid gamma value (should be in range 0-100%)"
fi
fi
;;
*)
echo "invalid command"
;;
esac
exit 0