Перевёл dotfiles на stow
This commit is contained in:
parent
27416cef99
commit
97af93b2a8
169 changed files with 1256 additions and 100 deletions
29
config/hypr/hyprlock/status.sh
Executable file
29
config/hypr/hyprlock/status.sh
Executable file
|
@ -0,0 +1,29 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
############ Variables ############
|
||||
enable_battery=false
|
||||
battery_charging=false
|
||||
|
||||
####### Check availability ########
|
||||
for battery in /sys/class/power_supply/*BAT*; do
|
||||
if [[ -f "$battery/uevent" ]]; then
|
||||
enable_battery=true
|
||||
if [[ $(cat /sys/class/power_supply/*/status | head -1) == "Charging" ]]; then
|
||||
battery_charging=true
|
||||
fi
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
############# Output #############
|
||||
if [[ $enable_battery == true ]]; then
|
||||
if [[ $battery_charging == true ]]; then
|
||||
echo -n " заряжается"
|
||||
fi
|
||||
echo -n "$(cat /sys/class/power_supply/*/capacity | head -1)"%
|
||||
if [[ $battery_charging == false ]]; then
|
||||
echo -n " осталось"
|
||||
fi
|
||||
fi
|
||||
|
||||
echo ''
|
Loading…
Add table
Add a link
Reference in a new issue