summaryrefslogtreecommitdiff
path: root/.local/bin/lemonbar/modules/battery.py
diff options
context:
space:
mode:
Diffstat (limited to '.local/bin/lemonbar/modules/battery.py')
-rw-r--r--.local/bin/lemonbar/modules/battery.py14
1 files changed, 0 insertions, 14 deletions
diff --git a/.local/bin/lemonbar/modules/battery.py b/.local/bin/lemonbar/modules/battery.py
deleted file mode 100644
index 7cf3c54..0000000
--- a/.local/bin/lemonbar/modules/battery.py
+++ /dev/null
@@ -1,14 +0,0 @@
-def read_file(filename):
- with open(filename) as f:
- return f.read().strip()
-
-def callback():
- battery = "BAT0"
- try:
- now = int(read_file(f"/sys/class/power_supply/{battery}/energy_now"))
- full = int(read_file(f"/sys/class/power_supply/{battery}/energy_full"))
- percent = round(now / full * 100)
- return f"BAT: {percent}%"
- except FileNotFoundError:
- return f"BAT: Disabled"
-