Cleaning up dwm.

This commit is contained in:
Derek Taylor
2020-03-10 19:41:11 -05:00
parent 3ec12d3d38
commit 4978b295b7
6 changed files with 119 additions and 29 deletions

View File

@@ -4,18 +4,18 @@ nitrogen --restore &
urxvtd -q -o -f &
dte(){
dte="$(date +"%A, %B %d | 🕒 %l:%M%p")"
echo -e "📅 $dte"
dte="$(date +"%A, %B %d - %l:%M%p")"
echo -e "🕒 $dte"
}
upd(){
upd=`checkupdates | wc -l`
echo -e "⟳ $upd updates"
hdd() {
hdd="$(df -h | awk 'NR==4{print $3, $5}')"
echo -e "💿 $hdd"
}
mem(){
mem=`free | awk '/Mem/ {printf "%d MiB/%d MiB\n", $3 / 1024.0, $2 / 1024.0 }'`
echo -e "🖪 $mem"
echo -e "🖪 $mem"
}
cpu(){
@@ -25,10 +25,21 @@ cpu(){
read cpu a b c idle rest < /proc/stat
total=$((a+b+c+idle))
cpu=$((100*( (total-prevtotal) - (idle-previdle) ) / (total-prevtotal) ))
echo -e "💻 $cpu% cpu"
echo -e "💻 $cpu% cpu"
}
pulse () {
volume=$(pactl list sinks | grep '^[[:space:]]Volume:' | head -n $(( $SINK + 1 )) | tail -n 1 | sed -e 's,.* \([0-9][0-9]*\)%.*,\1,')
status=$(pacmd list-sinks | awk '/muted/ { print $2 }')
if [ "$status" = "yes" ]; then
echo -e "🔈 muted"
else
echo -e "🔈 $volume%"
fi
}
while true; do
xsetroot -name "$(cpu) | $(mem) | $(dte)"
sleep 10s # Update time every ten seconds
xsetroot -name "$(cpu) | $(mem) | $(hdd) | $(pulse) | $(dte)"
sleep 1s # Update time every one second(s)
done &