summaryrefslogtreecommitdiffstats
path: root/.local/bin/statusbar
diff options
context:
space:
mode:
authorDennis Lee <dennis@dennislee.xyz>2020-04-04 12:52:29 -0700
committerDennis Lee <dennis@dennislee.xyz>2020-04-04 12:52:29 -0700
commit2b572b2a89de8aca631de686e25f2f5d306a91bd (patch)
tree5859352fc120f92880a472bc4e0805dcae238803 /.local/bin/statusbar
parentfa67562835fc4cfd8f87c2abc622b9c1b4358ffe (diff)
downloadeibhear-2b572b2a89de8aca631de686e25f2f5d306a91bd.tar.gz
eibhear-2b572b2a89de8aca631de686e25f2f5d306a91bd.tar.zst
eibhear-2b572b2a89de8aca631de686e25f2f5d306a91bd.zip
substitute $HOME/.local/share with $XDG_DATA_HOME
Diffstat (limited to '.local/bin/statusbar')
-rwxr-xr-x.local/bin/statusbar/weather10
1 files changed, 5 insertions, 5 deletions
diff --git a/.local/bin/statusbar/weather b/.local/bin/statusbar/weather
index 285ac91..bc9f20c 100755
--- a/.local/bin/statusbar/weather
+++ b/.local/bin/statusbar/weather
@@ -1,13 +1,13 @@
#!/bin/sh
getforecast() { ping -q -c 1 1.1.1.1 >/dev/null || exit 1
-curl -sf "wttr.in/$LOCATION" > "$HOME/.local/share/weatherreport" || exit 1 ;}
+curl -sf "wttr.in/$LOCATION" > "$XDG_DATA_HOME/weatherreport" || exit 1 ;}
-showweather() { printf "%s" "$(sed '16q;d' "$HOME/.local/share/weatherreport" | grep -wo "[0-9]*%" | sort -n | sed -e '$!d' | sed -e "s/^/☔ /g" | tr -d '\n')"
-sed '13q;d' "$HOME/.local/share/weatherreport" | grep -o "m\\(-+\\)*[0-9]\\+" | sort -n -t 'm' -k 2n | sed -e 1b -e '$!d' | tr '\n|m' ' ' | awk '{print " ❄️",$1 "°","🌞",$2 "°"}' ;}
+showweather() { printf "%s" "$(sed '16q;d' "$XDG_DATA_HOME/weatherreport" | grep -wo "[0-9]*%" | sort -n | sed -e '$!d' | sed -e "s/^/☔ /g" | tr -d '\n')"
+sed '13q;d' "$XDG_DATA_HOME/weatherreport" | grep -o "m\\(-+\\)*[0-9]\\+" | sort -n -t 'm' -k 2n | sed -e 1b -e '$!d' | tr '\n|m' ' ' | awk '{print " ❄️",$1 "°","🌞",$2 "°"}' ;}
case $BLOCK_BUTTON in
- 1) $TERMINAL -e less -Srf "$HOME/.local/share/weatherreport" ;;
+ 1) $TERMINAL -e less -Srf "$XDG_DATA_HOME/weatherreport" ;;
2) getforecast && showweather ;;
3) pgrep -x dunst >/dev/null && notify-send "🌈 Weather module" "\- Left click for full forecast.
- Middle click to update forecast.
@@ -16,7 +16,7 @@ case $BLOCK_BUTTON in
🌞: Daily high" ;;
esac
-if [ "$(stat -c %y "$HOME/.local/share/weatherreport" 2>/dev/null | awk '{print $1}')" != "$(date '+%Y-%m-%d')" ]
+if [ "$(stat -c %y "$XDG_DATA_HOME/weatherreport" 2>/dev/null | awk '{print $1}')" != "$(date '+%Y-%m-%d')" ]
then getforecast && showweather
else showweather
fi