Init commit

This commit is contained in:
Archie Fox
2025-06-08 06:59:19 +03:00
commit 06b8ee8caf
148 changed files with 18659 additions and 0 deletions

21
bin/battery Executable file
View File

@@ -0,0 +1,21 @@
#!/usr/bin/env python
import subprocess
def main():
with open("/sys/class/power_supply/BAT0/capacity", "r") as f:
capacity = f.read()
# capacity = 10
if int(capacity) <= 20:
text = "Внимание, низкий уровень заряда батареи! Подключите зарядное устройство"
subprocess.run(["notify-send", "-u", "critical", text])
subprocess.run(["rhvoice_say", text])
elif int(capacity) >= 80 and int(capacity) < 100:
text = "Батарея достаточно заряжена, можно отключать!"
subprocess.run(["notify-send", "-t", "15000", text])
subprocess.run(["rhvoice_say", text])
main()