summaryrefslogtreecommitdiffstats
path: root/.scripts
diff options
context:
space:
mode:
authorLuke Smith <luke@lukesmith.xyz>2018-06-15 21:44:52 -0400
committerLuke Smith <luke@lukesmith.xyz>2018-06-15 21:44:52 -0400
commit748e9849856ec66374b0f1280a3137ae4f661b43 (patch)
tree9dffcc5ba8fe1f253b84fa25d0364e2c7c282587 /.scripts
parente85bf27495f01be9790a4ed0fadc89459f4834ac (diff)
downloadeibhear-748e9849856ec66374b0f1280a3137ae4f661b43.tar.gz
eibhear-748e9849856ec66374b0f1280a3137ae4f661b43.tar.zst
eibhear-748e9849856ec66374b0f1280a3137ae4f661b43.zip
mpd, weather and mail blocks improved
Diffstat (limited to '.scripts')
-rwxr-xr-x.scripts/i3mail2
-rwxr-xr-x.scripts/i3mpd4
-rwxr-xr-x.scripts/i3weather3
3 files changed, 4 insertions, 5 deletions
diff --git a/.scripts/i3mail b/.scripts/i3mail
index 9b4aa3e..becb085 100755
--- 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
index b2a34bb..7cf473d 100755
--- 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
index 3000b8a..a2fef4e 100755
--- 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 "°"}'
-