aboutsummaryrefslogtreecommitdiffstats
path: root/config/hypr/scripts
diff options
context:
space:
mode:
authoraditya-an1l <aditya.anil.productions@gmail.com>2025-05-22 11:08:00 +0530
committeraditya-an1l <aditya.anil.productions@gmail.com>2025-05-22 11:08:00 +0530
commit6594a935a8c0c4b3bc90e6d5f5d74829c06c53f7 (patch)
treea2a62e4c8c2ded02e416de3b7bbc138d3dc7a81e /config/hypr/scripts
parent73f3aebcb112379ec1c4c604b74e3d88020c5137 (diff)
feat: Add Power Info (level and status) in Hyprlock Window
- Display current power level (battery percentage) and power status (full, charging, discharging) at the bottom right section of Hyprlock - This feature allows laptop user to view the power info when their device are locked, especially if the device is getting discharged.
Diffstat (limited to 'config/hypr/scripts')
-rw-r--r--config/hypr/scripts/Power.sh9
1 files changed, 9 insertions, 0 deletions
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