dotfiles

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 748e9849856ec66374b0f1280a3137ae4f661b43
parent e85bf27495f01be9790a4ed0fadc89459f4834ac
Author: Luke Smith <luke@lukesmith.xyz>
Date:   Fri, 15 Jun 2018 21:44:52 -0400

mpd, weather and mail blocks improved

Diffstat:
M.i3blocks.conf | 15++++++++++-----
M.scripts/i3mail | 2+-
M.scripts/i3mpd | 4++--
M.scripts/i3weather | 3+--
4 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/.i3blocks.conf b/.i3blocks.conf @@ -1,6 +1,11 @@ command=/usr/lib/i3blocks/$BLOCK_NAME separator_block_width=15 -markup=none +markup=pango + +[record] +command=cat ~/.scripts/.recording +interval=once +signal=9 [mpd] label=🎼 @@ -11,12 +16,12 @@ signal=11 [weather] command=i3weather -interval=1800 +interval=3600 [mail] -label=📧 +label=📮 command=i3mail -interval=300 +interval=180 align=left signal=12 @@ -42,4 +47,4 @@ interval=5 [time] label=📅 command=echo $(date '+%Y %b %d %I:%M%p') 🕓 -interval=5 +interval=30 diff --git a/.scripts/i3mail b/.scripts/i3mail @@ -2,4 +2,4 @@ case $BLOCK_BUTTON in 1) $TERMINAL -e neomutt ;; esac -echo $(find ~/.mail -wholename */INBOX/new/* | wc -l) +echo $(find ~/.mail -wholename */INBOX/new/* | wc -l | sed -e "s/^0$//g") diff --git a/.scripts/i3mpd b/.scripts/i3mpd @@ -6,8 +6,8 @@ if [[ -n $BLOCK_INSTANCE ]]; then fi 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 1) mpc $password status | filter && $TERMINAL -e ncmpcpp & disown ;; # right click, pause/unpause diff --git a/.scripts/i3weather b/.scripts/i3weather @@ -12,7 +12,6 @@ if [[ "$location" != "" ]] fi 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 "°"}' -