summaryrefslogtreecommitdiff
path: root/.local/bin/statusbar/sb-forecast
diff options
context:
space:
mode:
authorAdam Stück <adam@adast.xyz>2023-05-04 15:52:13 +0200
committerAdam Stück <adam@adast.xyz>2023-05-04 15:52:13 +0200
commitac0422a9eb7ca9faae96566ca92a7e579d9a6437 (patch)
tree455ffac76f3cfdde083473b4ff60f334a16e8b04 /.local/bin/statusbar/sb-forecast
parentaa3f5d6aabf002582bf77652aa0b5177a18a3bec (diff)
Drop unused scripts
Diffstat (limited to '.local/bin/statusbar/sb-forecast')
-rwxr-xr-x.local/bin/statusbar/sb-forecast49
1 files changed, 0 insertions, 49 deletions
diff --git a/.local/bin/statusbar/sb-forecast b/.local/bin/statusbar/sb-forecast
deleted file mode 100755
index c9923fd..0000000
--- a/.local/bin/statusbar/sb-forecast
+++ /dev/null
@@ -1,49 +0,0 @@
-#!/bin/sh
-
-LOCATION=$(cat "$XDG_CONFIG_HOME/forecast/location")
-
-main () {
- case "$1" in
- -b|--browser)
- xdg-open "https://wttr.in/$LOCATION"
- exit 0 ;;
- esac
-
- res=$(curl -sf wttr.in/"$LOCATION"?format="%x+%t") || exit 1
-
- icon=$(condition_icon "$res")
- temp=$(temperature "$res")
- echo "$icon" "$temp"
-}
-
-condition_icon () {
- icon=$(echo "$1" | cut -d\ -f1)
-
- case "$icon" in
- '=') echo  ;;
- '/') echo  ;;
- '.') echo  ;;
- 'm') echo  ;;
- 'o') echo  ;;
- 'mmm') echo  ;;
- 'mm') echo  ;;
- '///') echo  ;;
- '//') echo  ;;
- '**') echo  ;;
- '*') echo  ;;
- '*/*') echo  ;;
- 'x') echo  ;;
- 'x/') echo  ;;
- '*/') echo  ;;
- '/!/') echo  ;;
- '!/') echo  ;;
- '*!*') echo  ;;
- *) echo ? ;;
- esac
-}
-
-temperature () {
- echo "$1" | cut -d\ -f2 | sed -e 's/+//' -e 's/-0/0/' -e 's/C//'
-}
-
-main "$@"