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/bar.sh

31 lines
800 B
Bash
Executable File

#!/bin/bash
load() {
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"}')"
}
player() {
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}}')"
}
temp() {
echo -n "^c#cf366b^ ^c#abb2bf^$(sensors -j | jq '.["coretemp-isa-0000"]["Package id 0"]["temp1_input"]')°C"
}
while true; do
xsetroot -name "^c#cdff59^ $(player) $(root) $(temp) $(load) $(mem) $(clock)"
sleep 5
done