Replace w key binding with weather notification instead of web-browser
authorSiraaj Khandkar <siraaj@khandkar.net>
Thu, 5 Nov 2020 10:36:57 +0000 (05:36 -0500)
committerSiraaj Khandkar <siraaj@khandkar.net>
Thu, 5 Nov 2020 10:36:57 +0000 (05:36 -0500)
home/.xbindkeysrc
home/bin/notify_weather [new file with mode: 0755]

index 2d5eec3..7161d9f 100644 (file)
 "pcmanfm"
     Mod4 + f
 
-# Web browser
-"brave-browser"
+# Weather
+"notify_weather"
     Mod4 + w
 
 # Calendar
diff --git a/home/bin/notify_weather b/home/bin/notify_weather
new file mode 100755 (executable)
index 0000000..007620b
--- /dev/null
@@ -0,0 +1,18 @@
+#! /bin/bash
+
+# For WEATHER_LOCATION variable
+. ~/lib/login_variables.private.sh
+
+weather_report=$(curl "http://wttr.in/${WEATHER_LOCATION}?1TFq")
+notify-send "$weather_report" -u low
+
+# wttr options:
+#     0                       # only current weather
+#     1                       # current weather + today's forecast
+#     2                       # current weather + today's + tomorrow's forecast
+#     A                       # ignore User-Agent and force ANSI output format (terminal)
+#     F                       # do not show the "Follow" line
+#     n                       # narrow version (only day and night)
+#     q                       # quiet version (no "Weather report" text)
+#     Q                       # superquiet version (no "Weather report", no city name)
+#     T                       # switch terminal sequences off (no colors)
This page took 0.032307 seconds and 4 git commands to generate.