add battery status

This commit is contained in:
thek4n 2025-11-26 18:11:18 +03:00
parent f6742657cc
commit 86c638d665
3 changed files with 20 additions and 2 deletions

View File

@ -181,3 +181,8 @@ input type:keyboard {
repeat_delay 250
repeat_rate 100
}
input type:touchpad {
tap enabled
dwt enabled
}

View File

@ -17,7 +17,20 @@ cmd_ethernet() {
}
cmd_battery() {
return 0 # todo
charging_status="$(cat /sys/class/power_supply/BAT0/status)"
percent="$(cat /sys/class/power_supply/BAT0/capacity)"
if [ "${percent}" -lt 35 ]; then
emoji_status="🪫"
else
emoji_status="🔋"
fi
if [ "${charging_status}" = "Charging" ]; then
emoji_status="🔌"
fi
printf "%s %s%%\n" "${emoji_status}" "${percent}"
}
cmd_disk_root() {

View File

@ -1,3 +1,3 @@
#!/bin/sh
echo "pacman -S sway swaybg waybar swaylock swayidle wl-clipboard ydotool grim slurp mako wlr-randr"
echo "pacman -S sway swaybg i3blocks waybar swaylock swayidle wl-clipboard ydotool grim slurp mako wlr-randr rofi jq"