dots/configs/home/config/polybar/kblocks.py
2022-04-03 01:11:04 +02:00

14 lines
297 B
Python

#!/usr/bin/env python3
import os
import sys
res = os.popen("xset -q | grep 'Caps Lock'").read().split()
res = [res[3], res[7], res[11]]
arr = {"on": "%{F#77BD8B}", "off": "%{F#333}"}
keys = ["", "", ""]
print(" ".join([
arr[v]+keys[i] for i, v in enumerate(res)
]))
sys.stdout.flush()