kunsis-dotfiles/.config/i3pystatus/redshift.py

12 lines
245 B
Python
Executable file

#!/usr/bin/python
from subprocess import call
state = call(['systemctl', '--user', 'is-active', '--quiet', 'redshift.service'])
if state == 0:
color = '#00FF00'
else:
color = '#FF0000'
print(f'<span color="{color}">Redshift</span>')