This commit is contained in:
Marcin Wozniak 2019-09-22 00:26:12 +02:00
parent f66333fcc9
commit 1e7d2fd63d
2 changed files with 22 additions and 5 deletions

View File

@ -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 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 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 int showsystray = 1; /* 0 means no systray */
static const char *fonts[] = { "mono:size=16", "Font Awesome 5 Free Solid:size=16"}; static const char *fonts[] = { "mono:size=15", "Font Awesome 5 Free Solid:size=15"};
static const char dmenufont[] = "mono:size=16"; static const char dmenufont[] = "mono:size=15";
static const char col_gray1[] = "#222222"; static const char col_gray1[] = "#222222";
static const char col_gray2[] = "#444444"; static const char col_gray2[] = "#444444";
static const char col_gray3[] = "#bbbbbb"; static const char col_gray3[] = "#bbbbbb";

View File

@ -18,6 +18,25 @@ transmission-daemon&
pl& pl&
#getforecast& #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() { 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." [ "$(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 while true
do do
#xsetroot -name "$(print_temp) | $(usageData) | $(testweather) | $(print_wifi) | $(batLevel) | $(print_volume) | $(print_date)" xsetroot -name "$(print_torrent) | $(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)"
sleep 2 sleep 2
done done