diff --git a/config.h b/config.h index 543dc9a..873a9d5 100644 --- a/config.h +++ b/config.h @@ -8,8 +8,8 @@ static const unsigned int systraypinning = 0; /* 0: sloppy systray follows sel static const unsigned int systrayspacing = 2; /* systray spacing */ static const int systraypinningfailfirst = 1; /* 1: if pinning fails, display systray on the first monitor, False: display systray on the last monitor*/ static const int showsystray = 1; /* 0 means no systray */ -static const char *fonts[] = { "mono:size=16", "Font Awesome 5 Free Solid:size=16"}; -static const char dmenufont[] = "mono:size=16"; +static const char *fonts[] = { "mono:size=15", "Font Awesome 5 Free Solid:size=15"}; +static const char dmenufont[] = "mono:size=15"; static const char col_gray1[] = "#222222"; static const char col_gray2[] = "#444444"; static const char col_gray3[] = "#bbbbbb"; diff --git a/dwm_status b/dwm_status index 5f07be2..db8eebc 100755 --- a/dwm_status +++ b/dwm_status @@ -18,6 +18,25 @@ transmission-daemon& pl& #getforecast& + +print_torrent(){ + transmission-remote -l | grep % | + sed " # This first sed command is to ensure a desirable order with sort + s/.*Stopped.*/A/g; + s/.*Seeding.*/Z/g; + s/.*100%.*/N/g; + s/.*Idle.*/B/g; + s/.*Uploading.*/L/g; + s/.*%.*/M/g" | + sort -h | uniq -c | sed " # Now we replace the standin letters with icons. + s/A//g; + s/B//g; + s/L//g; + s/M//g; + s/N//g; + s/Z//g" | awk '{print $2, $1}' | sed -e "s/ $//g" +} + testweather() { [ "$(stat -c %y "/home/yorune/.weatherreport" 2>/dev/null | cut -d' ' -f1)" != "$(date '+%Y-%m-%d')" ] && ping -q -c 1 1.1.1.1 >/dev/null && curl -s "wttr.in/$location" > "/home/yorune/.weatherreport" && notify-send "🌞 Weather" "New weather forecast for today." @@ -121,8 +140,6 @@ esac while true do - #xsetroot -name "$(print_temp) | $(usageData) | $(testweather) | $(print_wifi) | $(batLevel) | $(print_volume) | $(print_date)" - #xsetroot -name " $(testweather) | $(print_wifi) | $(batLevel) | $(print_volume) | $(print_date)" - xsetroot -name "$(print_temp) | $(usageData) | $(print_wifi) | $(batLevel) | $(print_volume) | $(print_date)" + xsetroot -name "$(print_torrent) | $(print_temp) | $(usageData) | $(testweather) | $(print_wifi) | $(batLevel) | $(print_volume) | $(print_date)" sleep 2 done