Colors to fit more with nord-theme colors

This commit is contained in:
_N0x 2022-01-21 00:42:52 +01:00
parent 2a22c6bf16
commit fb9a655329

View File

@ -6,13 +6,13 @@ interface="wlo1"
datetime() { datetime() {
icon="" icon=""
time="$(date "+%a, %d %b %H:%M")" time="$(date "+%a, %d %b %H:%M")"
printf "^b#408977^^c#eeeeee^ %s ^d^ %s" "$icon" "$time" printf "^b#8FBCBB^^c#2E3440^ %s ^d^ %s" "$icon" "$time"
} }
battery() { battery() {
icon="" icon=""
battery="$(acpi | awk -F '[, :]' '{ print $6 }')" # without time battery="$(acpi | awk -F '[, :]' '{ print $6 }')" # without time
printf "^b#408977^^c#eeeeee^ %s ^d^ %s" "$icon" "$battery" printf "^b#8FBCBB^^c#2E3440^ %s ^d^ %s" "$icon" "$battery"
} }
cpu() { cpu() {
@ -23,20 +23,20 @@ cpu() {
read cpu a b c idle rest < /proc/stat read cpu a b c idle rest < /proc/stat
total=$((a+b+c+idle)) total=$((a+b+c+idle))
cpu=$((100*( (total-prevtotal) - (idle-previdle) ) / (total-prevtotal) )) cpu=$((100*( (total-prevtotal) - (idle-previdle) ) / (total-prevtotal) ))
printf "^b#408977^^c#eeeeee^ %s ^d^ %s" "$icon" "$cpu%" printf "^b#8FBCBB^^c#2E3440^ %s ^d^ %s" "$icon" "$cpu%"
} }
memory() { memory() {
icon="" icon=""
mem="$(free -h | awk '/^Mem/ { print $3"/"$2 }' | sed s/i//g)" mem="$(free -h | awk '/^Mem/ { print $3"/"$2 }' | sed s/i//g)"
printf "^b#408977^^c#eeeeee^ %s ^d^ %s" "$icon" "$mem" printf "^b#8FBCBB^^c#2E3440^ %s ^d^ %s" "$icon" "$mem"
} }
disk() { disk() {
icon="" icon=""
root="$(df / | awk '/^\// { print $5 }')" root="$(df / | awk '/^\// { print $5 }')"
home="$(df /home | awk '/^\// { print $5 }')" home="$(df /home | awk '/^\// { print $5 }')"
printf "^b#408977^^c#eeeeee^ %s ^d^ / %s | /home %s" "$icon" "$root" "$home" printf "^b#8FBCBB^^c#2E3440^ %s ^d^ / %s | /home %s" "$icon" "$root" "$home"
} }
networkspeed() { networkspeed() {
@ -52,24 +52,24 @@ networkspeed() {
RBPS="$(expr $R2 - $R1)" RBPS="$(expr $R2 - $R1)"
TKBPS="$(expr $TBPS / 1024)" TKBPS="$(expr $TBPS / 1024)"
RKBPS="$(expr $RBPS / 1024)" RKBPS="$(expr $RBPS / 1024)"
printf "^b#408977^^c#eeeeee^ %s ^d^ %s %skB/s %s %skB/s" "$icon" "$up" "$TKBPS" "$down" "$RKBPS" printf "^b#8FBCBB^^c#2E3440^ %s ^d^ %s %skB/s %s %skB/s" "$icon" "$up" "$TKBPS" "$down" "$RKBPS"
} }
networkinfo() { networkinfo() {
icon="" icon=""
IPADDR="$(ip a show dev $interface | awk '/inet / { print $2 } ')" IPADDR="$(ip a show dev $interface | awk '/inet / { print $2 } ')"
printf "^b#408977^^c#eeeeee^ %s ^d^ %s [%s]" "$icon" "$interface" "$IPADDR" printf "^b#8FBCBB^^c#2E3440^ %s ^d^ %s [%s]" "$icon" "$interface" "$IPADDR"
} }
song() { song() {
icon="" icon=""
song=$(playerctl --player=spotify,mpd metadata title) song=$(playerctl --player=spotify,mpd metadata title)
artist=$(playerctl --player=spotify,mpd metadata artist) artist=$(playerctl --player=spotify,mpd metadata artist)
printf "^b#408977^^c#eeeeee^ %s ^d^ %s - %s" "$icon" "$artist" "$song" printf "^b#8FBCBB^^c#2E3440^ %s ^d^ %s - %s" "$icon" "$artist" "$song"
} }
while true; do while true; do
xsetroot -name " $(cpu) $(memory) $(networkinfo) $(disk) $(battery) $(datetime) " xsetroot -name " $(cpu) $(memory) $(networkinfo) $(disk) $(battery) $(datetime) "
sleep 5 sleep 8
done done