From 37321ed15ff25d8477e69f81d2bf9047e2830060 Mon Sep 17 00:00:00 2001 From: Siraaj Khandkar Date: Thu, 5 Nov 2020 05:36:57 -0500 Subject: [PATCH] Replace w key binding with weather notification instead of web-browser --- home/.xbindkeysrc | 4 ++-- home/bin/notify_weather | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) create mode 100755 home/bin/notify_weather 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) -- 2.20.1