summaryrefslogtreecommitdiffstats
path: root/.scripts/i3weather
diff options
context:
space:
mode:
authorLuke Smith <luke@lukesmith.xyz>2018-04-22 17:39:23 -0700
committerLuke Smith <luke@lukesmith.xyz>2018-04-22 17:39:23 -0700
commitcec92894fcf3382a2d1dd8450c63767941fed404 (patch)
tree18250c00e6be565f8e16ae0bc45a9c7774f1034e /.scripts/i3weather
parent84557167e6a3c678202d4edb6dc06d1c8dfde51f (diff)
downloadeibhear-cec92894fcf3382a2d1dd8450c63767941fed404.tar.gz
eibhear-cec92894fcf3382a2d1dd8450c63767941fed404.tar.zst
eibhear-cec92894fcf3382a2d1dd8450c63767941fed404.zip
i3blocks scripts added
Diffstat (limited to '.scripts/i3weather')
-rwxr-xr-x.scripts/i3weather12
1 files changed, 12 insertions, 0 deletions
diff --git a/.scripts/i3weather b/.scripts/i3weather
new file mode 100755
index 0000000..2464795
--- /dev/null
+++ b/.scripts/i3weather
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+[[ $BLOCK_BUTTON = "1" ]] && st -e w3m wttr.in
+
+ping -q -w 1 -c 1 `ip r | grep default | cut -d ' ' -f 3` >/dev/null || exit
+
+curl wttr.in > ~/.weatherreport
+
+echo -n ☔ $(cat ~/.weatherreport | sed -n 16p | sed -e 's/[^m]*m//g' | grep -o "[0-9]*%" | sort -n | sed -e '$!d')
+
+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 "°"}'
+