added scripts for hyprlock
This commit is contained in:
Executable
+17
@@ -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
|
||||
Reference in New Issue
Block a user