dotfiles/config/waybar/dwmbar.sh

35 lines
427 B
Bash
Raw Normal View History

2025-08-07 22:12:32 +03:30
#!/bin/bash
cpu() {
awk '/^cpu / {
usage = ($2 + $4) * 100 / ($2 + $4 + $5)
2025-08-07 23:00:57 +03:30
printf "%.1f%%", usage
2025-08-07 22:12:32 +03:30
}' /proc/stat
}
mem() {
free | awk '/Mem:/ {
used = $3 / $2 * 100
2025-08-07 23:00:57 +03:30
printf "%.1f%%", used
2025-08-07 22:12:32 +03:30
}'
}
2025-08-07 23:00:57 +03:30
localip() {
sb-network
}
vol() {
sb-volume
}
charging() {
bat-symbol
}
2025-08-07 22:12:32 +03:30
get_time() {
date '+%I:%M-%p'
}
2025-08-07 23:00:57 +03:30
echo "[$(vol)] [$(cpu)] [$(mem)] $(charging) [$(get_time)]"
2025-08-07 22:12:32 +03:30