added scripts for hyprlock

This commit is contained in:
Hannes
2026-08-22 15:42:30 +02:00
parent 50e7c7a9aa
commit f8d3983603
2 changed files with 22 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
#!/bin/bash
[ -f /sys/class/power_supply/BAT0/type ] || exit 1
type=$(</sys/class/power_supply/BAT0/type)
[ "$type" != "Battery" ] && exit 1
cap=$(</sys/class/power_supply/BAT0/capacity)
stat=$(</sys/class/power_supply/BAT0/status)
if [ "$stat" = "Discharging" ]; then
printf "󰁹 %s%%" "$cap"
elif [ "$stat" = "Charging" ]; then
printf "󰂄 %s%%" "$cap"
elif [ "$stat" = "Full" ]; then
printf "󰁹 %s%%" "Full"
else
printf ""
fi