-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhourly.py
More file actions
31 lines (23 loc) · 692 Bytes
/
Copy pathhourly.py
File metadata and controls
31 lines (23 loc) · 692 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
import datetime
import time
import os
import sys
one_hour = 3600
day_command = "hyprctl hyprsunset identity"
nt1_command = "hyprctl hyprsunset temperature 5000"
nt2_command = "hyprctl hyprsunset temperature 4000"
late_at_night = True
def cs2_is_running() -> bool:
cmd = os.popen("pgrep cs2")
res = cmd.read()
return len(res) > 1
while True:
hour = datetime.datetime.now().hour
if hour < 18 and not hour < 7:
os.system(day_command)
if hour >= 18 and not cs2_is_running():
os.system(nt1_command)
if hour < 6 and late_at_night and not cs2_is_running():
late_at_night = False
os.system(nt2_command)
time.sleep(one_hour)