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-10-21 18:06:05 +02:00

27 lines
659 B
Bash
Executable file

#!/bin/bash
cpu() {
echo -n "^c#7ec7a2^^c#abb2bf^ $(grep -o "^[^ ]*" /proc/loadavg)"
}
mem() {
echo -n "^c#c7957e^^c#abb2bf^ $(free -h | awk '/^Mem/ { print $3 }' | sed s/i//g)"
}
clock() {
echo -n "^c#1e222a^^b#668ee3^  ^c#1e222a^^b#7aa2f7^ $(date '+%a | %x | %R') "
}
root() {
echo -n "^c#ad7ec7^^c#abb2bf^ $(df -h / | awk '{if ($1 != "Filesystem") print $4" free"}')"
}
spotify() {
echo -n "^c#42f59e^^c#abb2bf^ $(playerctl metadata | awk '{if ($2 == "xesam:title") {s = ""; for (i = 3; i <= NF; i++) s = s $i " "; print s}}')"
}
while true; do
xsetroot -name "^c#cdff59^ $(spotify) $(root) $(cpu) $(mem) $(clock)"
sleep 5
done