From: Siraaj Khandkar Date: Thu, 5 Nov 2020 10:36:57 +0000 (-0500) Subject: Replace w key binding with weather notification instead of web-browser X-Git-Url: https://git.xandkar.net/?p=khome.git;a=commitdiff_plain;h=37321ed15ff25d8477e69f81d2bf9047e2830060 Replace w key binding with weather notification instead of web-browser --- diff --git a/home/.xbindkeysrc b/home/.xbindkeysrc index 2d5eec3..7161d9f 100644 --- a/home/.xbindkeysrc +++ b/home/.xbindkeysrc @@ -152,8 +152,8 @@ "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 index 0000000..007620b --- /dev/null +++ b/home/bin/notify_weather @@ -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)