aboutsummaryrefslogtreecommitdiff
path: root/hypr
diff options
context:
space:
mode:
authorAargh Rai <aargh.rai+git@gmail.com>2025-09-17 15:24:11 +0530
committerAargh Rai <aargh.rai+git@gmail.com>2025-09-17 15:24:11 +0530
commit09b12698892be31755360d0b45427410f8ae67ba (patch)
tree1a7680b226daaf8a2f6969af2522135767ca8a73 /hypr
parent6ea66752a8da9bcdaa4b77fc3e5e356620bfdbf5 (diff)
simplified waybar
Diffstat (limited to 'hypr')
-rw-r--r--hypr/battery-notif.sh1
-rw-r--r--hypr/battery_warning.py18
-rw-r--r--hypr/hyprland.conf1
3 files changed, 20 insertions, 0 deletions
diff --git a/hypr/battery-notif.sh b/hypr/battery-notif.sh
new file mode 100644
index 0000000..d08b1d0
--- /dev/null
+++ b/hypr/battery-notif.sh
@@ -0,0 +1 @@
+python battery_warning.py
diff --git a/hypr/battery_warning.py b/hypr/battery_warning.py
new file mode 100644
index 0000000..882e8dd
--- /dev/null
+++ b/hypr/battery_warning.py
@@ -0,0 +1,18 @@
+import psutil
+import subprocess
+import time
+
+WARNING_LEVEL = 30
+CRITICAL_LEVEL = 15
+
+while True:
+ battery = psutil.sensors_battery()
+ percent = battery.percent
+ if battery.power_plugged:
+ pass # Optionally notify full
+ else:
+ if percent <= CRITICAL_LEVEL:
+ subprocess.run(['notify-send', '-u', 'critical', 'Very Low Battery', '-i', '/home/aargh/.config/waybar/battery_low.png'])
+ elif percent <= WARNING_LEVEL:
+ subprocess.run(['notify-send', '-u', 'normal', 'Low Battery', '-i', '/home/aargh/.config/waybar/battery_low.png'])
+ time.sleep(5)
diff --git a/hypr/hyprland.conf b/hypr/hyprland.conf
index b106b07..7acea64 100644
--- a/hypr/hyprland.conf
+++ b/hypr/hyprland.conf
@@ -8,6 +8,7 @@ $fileManager = foot -e yazi
$menu = wofi --show drun
exec-once = ~/.config/hypr/random-wall.sh # random wallpaper
+exec-once = ~/.config/hypr/battery-notif.sh # low battery notification
exec-once = wl-paste --watch cliphist store # clipboard
exec-once = mako # notification
exec-once = waybar # top bar