This repository has been archived on 2022-02-18. You can view files and clone it, but cannot push or open issues or pull requests.
lemondwm/.dwm/bar.sh
2021-08-30 13:02:03 +02:00

25 lines
482 B
Bash
Executable file

#!/bin/bash
interval=10
cpu() {
cpu_val=$(grep -o "^[^ ]*" /proc/loadavg)
printf "^c#3b414d^ ^b#7ec7a2^ LOAD"
printf "^c#abb2bf^ ^b#353b45^ $cpu_val"
}
mem() {
printf "^c#3b414d^^b#c7957e^  "
printf "^c#abb2bf^ ^b#353b45^ $(free -h | awk '/^Mem/ { print $3 }' | sed s/i//g)"
}
clock() {
printf "^c#1e222a^^b#668ee3^ 󱑆 "
printf "^c#1e222a^^b#7aa2f7^ $(date '+%a, %I:%M %p') "
}
while true; do
sleep $interval
xsetroot -name "$(cpu) $(mem) $(clock)"
done