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
|
||||
Executable
+5
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
s=$(cut -d. -f1 /proc/uptime)
|
||||
h=$((s / 3600))
|
||||
m=$(((s % 3600) / 60))
|
||||
printf "%02d:%02dh" "$h" "$m"
|
||||
Reference in New Issue
Block a user