mpd, weather and mail blocks improved

This commit is contained in:
Luke Smith 2018-06-15 21:44:52 -04:00
parent e85bf27495
commit 748e984985
4 changed files with 14 additions and 10 deletions

View file

@ -1,6 +1,11 @@
command=/usr/lib/i3blocks/$BLOCK_NAME command=/usr/lib/i3blocks/$BLOCK_NAME
separator_block_width=15 separator_block_width=15
markup=none markup=pango
[record]
command=cat ~/.scripts/.recording
interval=once
signal=9
[mpd] [mpd]
label=🎼 label=🎼
@ -11,12 +16,12 @@ signal=11
[weather] [weather]
command=i3weather command=i3weather
interval=1800 interval=3600
[mail] [mail]
label=📧 label=📮
command=i3mail command=i3mail
interval=300 interval=180
align=left align=left
signal=12 signal=12
@ -42,4 +47,4 @@ interval=5
[time] [time]
label=📅 label=📅
command=echo $(date '+%Y %b %d %I:%M%p') 🕓 command=echo $(date '+%Y %b %d %I:%M%p') 🕓
interval=5 interval=30

View file

@ -2,4 +2,4 @@
case $BLOCK_BUTTON in case $BLOCK_BUTTON in
1) $TERMINAL -e neomutt ;; 1) $TERMINAL -e neomutt ;;
esac esac
echo $(find ~/.mail -wholename */INBOX/new/* | wc -l) echo $(find ~/.mail -wholename */INBOX/new/* | wc -l | sed -e "s/^0$//g")

View file

@ -6,8 +6,8 @@ if [[ -n $BLOCK_INSTANCE ]]; then
fi fi
filter() { filter() {
tr '\n' ' ' | grep -Po '.*(?= \[playing\])|paused' | tr -d '\n' sed 2q | tac | sed -e "/volume:/d;s/\[paused\].*/<span color=\"gray\">/g;s/\[playing\].*/<span>/g" | tr -d '\n' | sed -e "s/$/<\/span>/g"
} }
case $BLOCK_BUTTON in case $BLOCK_BUTTON in
1) mpc $password status | filter && $TERMINAL -e ncmpcpp & disown ;; # right click, pause/unpause 1) mpc $password status | filter && $TERMINAL -e ncmpcpp & disown ;; # right click, pause/unpause

View file

@ -12,7 +12,6 @@ if [[ "$location" != "" ]]
fi fi
curl -s wttr.in/$location > ~/.weatherreport curl -s wttr.in/$location > ~/.weatherreport
echo -n $(cat ~/.weatherreport | sed -n 16p | sed -e 's/[^m]*m//g' | grep -o "[0-9]*%" | sort -n | sed -e '$!d') echo -n $(cat ~/.weatherreport | sed -n 16p | sed -e 's/[^m]*m//g' | grep -o "[0-9]*%" | sort -n | sed -e "$!d;s/^/☔ /")
cat ~/.weatherreport | sed -n 13p | sed -e 's/[^m]*m//g;s/[^0-9]/ /g;s/ /\n/g;/^s*$/d' | grep [0-9] | sort -n | sed -e 1b -e '$!d' | tr '\n' ' ' | awk '{print " ❄️",$1 "°","☀️",$2 "°"}' cat ~/.weatherreport | sed -n 13p | sed -e 's/[^m]*m//g;s/[^0-9]/ /g;s/ /\n/g;/^s*$/d' | grep [0-9] | sort -n | sed -e 1b -e '$!d' | tr '\n' ' ' | awk '{print " ❄️",$1 "°","☀️",$2 "°"}'