aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config/hypr/hyprlock.conf12
-rw-r--r--config/hypr/scripts/Power.sh9
2 files changed, 21 insertions, 0 deletions
diff --git a/config/hypr/hyprlock.conf b/config/hypr/hyprlock.conf
index 48b09b85..80a94fb1 100644
--- a/config/hypr/hyprlock.conf
+++ b/config/hypr/hyprlock.conf
@@ -157,6 +157,18 @@ label {
valign = bottom
}
+# battery
+label {
+ monitor =
+ text = cmd[update:1000] echo "<b> "$($Scripts/Power.sh)" </b>"
+ color = $color13
+ font_size = 18
+ font_family = Victor Mono Bold Oblique
+ position = 0, 30
+ halign = right
+ valign = bottom
+}
+
# weather edit the scripts for locations
# weather scripts are located in ~/.config/hypr/UserScripts Weather.sh and/or Weather.py
# see https://github.com/JaKooLit/Hyprland-Dots/wiki/TIPS#%EF%B8%8F-weather-app-related-for-waybar-and-hyprlock
diff --git a/config/hypr/scripts/Power.sh b/config/hypr/scripts/Power.sh
new file mode 100644
index 00000000..42431ea9
--- /dev/null
+++ b/config/hypr/scripts/Power.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+for i in {0..3}; do
+ if [ -f /sys/class/power_supply/BAT$i/capacity ]; then
+ battery_level=$(cat /sys/class/power_supply/BAT$i/status)
+ battery_capacity=$(cat /sys/class/power_supply/BAT$i/capacity)
+ echo "Power: $battery_capacity% ($battery_level)"
+ fi
+done
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage