1
0
Fork 0
mirror of https://gitlab.com/dwt1/dotfiles.git synced 2023-02-13 20:55:19 -05:00
dwt1--dotfiles/.dwm/autostart.sh

35 lines
757 B
Bash
Raw Normal View History

2019-01-27 18:02:11 -05:00
#! /bin/bash
compton --config ~/.config/compton/compton.conf &
nitrogen --restore &
urxvtd -q -o -f &
2019-02-01 18:31:23 -05:00
dte(){
2019-02-01 22:53:21 -05:00
dte="$(date +"%A, %B %d | 🕒 %l:%M%p")"
echo -e "📅 $dte"
2019-02-01 18:31:23 -05:00
}
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"
}
2019-01-27 18:02:11 -05:00
while true; do
2019-02-10 15:18:26 -05:00
xsetroot -name "$(cpu) | $(mem) | $(dte)"
2019-02-01 18:31:23 -05:00
sleep 10s # Update time every ten seconds
2019-01-27 18:02:11 -05:00
done &