mirror of
https://gitlab.com/dwt1/dotfiles.git
synced 2026-08-09 17:41:12 +10:00
updating dwm status bar information.
This commit is contained in:
+27
-2
@@ -3,7 +3,32 @@ compton --config ~/.config/compton/compton.conf &
|
|||||||
nitrogen --restore &
|
nitrogen --restore &
|
||||||
urxvtd -q -o -f &
|
urxvtd -q -o -f &
|
||||||
|
|
||||||
|
dte(){
|
||||||
|
dte="$(date +"%A, %B %d - %H:%M")"
|
||||||
|
echo -e "🕒 $dte"
|
||||||
|
}
|
||||||
|
|
||||||
|
upd(){
|
||||||
|
upd=`checkupdates | wc -l`
|
||||||
|
echo -e "⟳ $upd updates"
|
||||||
|
}
|
||||||
|
|
||||||
|
mem(){
|
||||||
|
mem=`free | awk '/Mem/ {printf "%d MiB/%d MiB\n", $3 / 1024.0, $2 / 1024.0 }'`
|
||||||
|
echo -e "🖪 $mem"
|
||||||
|
}
|
||||||
|
|
||||||
|
cpu(){
|
||||||
|
read cpu a b c previdle rest < /proc/stat
|
||||||
|
prevtotal=$((a+b+c+previdle))
|
||||||
|
sleep 0.5
|
||||||
|
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"
|
||||||
|
}
|
||||||
|
|
||||||
while true; do
|
while true; do
|
||||||
xsetroot -name "` date +"%b %e, %Y - %R" `"
|
xsetroot -name "$(cpu) | $(mem) | $(upd) | $(dte)"
|
||||||
sleep 1m # Update time every minute
|
sleep 10s # Update time every ten seconds
|
||||||
done &
|
done &
|
||||||
|
|||||||
Reference in New Issue
Block a user