aboutsummaryrefslogtreecommitdiffstats
path: root/config/hypr/scripts/Weather.sh
diff options
context:
space:
mode:
authorJa.KooLit <jimmielovejay@gmail.com>2023-12-29 15:44:57 +0900
committerGitHub <noreply@github.com>2023-12-29 15:44:57 +0900
commit2c070b5bfb2de84abed8a4cd45e999999021db38 (patch)
treeab297f40d72eab1dad7506e005cec1654f942ff6 /config/hypr/scripts/Weather.sh
parent76672ae5a6ac03c416bc705d51dec363f88b7a40 (diff)
parent69772de8b00a85a7da8e3d56c802fcfd01affe1c (diff)
Merge pull request #106 from JaKooLit/development
Development to Main for v2.2.2 Changes
Diffstat (limited to 'config/hypr/scripts/Weather.sh')
-rwxr-xr-xconfig/hypr/scripts/Weather.sh80
1 files changed, 0 insertions, 80 deletions
diff --git a/config/hypr/scripts/Weather.sh b/config/hypr/scripts/Weather.sh
deleted file mode 100755
index 40048710..00000000
--- a/config/hypr/scripts/Weather.sh
+++ /dev/null
@@ -1,80 +0,0 @@
-#!/bin/bash
-
-city=
-cachedir=~/.cache/rbn
-cachefile=${0##*/}-$1
-
-if [ ! -d $cachedir ]; then
- mkdir -p $cachedir
-fi
-
-if [ ! -f $cachedir/$cachefile ]; then
- touch $cachedir/$cachefile
-fi
-
-# Save current IFS
-SAVEIFS=$IFS
-# Change IFS to new line.
-IFS=$'\n'
-
-cacheage=$(($(date +%s) - $(stat -c '%Y' "$cachedir/$cachefile")))
-if [ $cacheage -gt 1740 ] || [ ! -s $cachedir/$cachefile ]; then
- data=($(curl -s https://en.wttr.in/"$city"$1\?0qnT 2>&1))
- echo ${data[0]} | cut -f1 -d, > $cachedir/$cachefile
- echo ${data[1]} | sed -E 's/^.{15}//' >> $cachedir/$cachefile
- echo ${data[2]} | sed -E 's/^.{15}//' >> $cachedir/$cachefile
-fi
-
-weather=($(cat $cachedir/$cachefile))
-
-# Restore IFSClear
-IFS=$SAVEIFS
-
-temperature=$(echo ${weather[2]} | sed -E 's/([[:digit:]]+)\.\./\1 to /g')
-
-#echo ${weather[1]##*,}
-
-# https://fontawesome.com/icons?s=solid&c=weather
-case $(echo ${weather[1]##*,} | tr '[:upper:]' '[:lower:]') in
-"clear" | "sunny")
- condition=""
- ;;
-"partly cloudy")
- condition="󰖕"
- ;;
-"cloudy")
- condition=""
- ;;
-"overcast")
- condition=""
- ;;
-"fog" | "freezing fog")
- condition=""
- ;;
-"patchy rain possible" | "patchy light drizzle" | "light drizzle" | "patchy light rain" | "light rain" | "light rain shower" | "mist" | "rain")
- condition="󰼳"
- ;;
-"moderate rain at times" | "moderate rain" | "heavy rain at times" | "heavy rain" | "moderate or heavy rain shower" | "torrential rain shower" | "rain shower")
- condition=""
- ;;
-"patchy snow possible" | "patchy sleet possible" | "patchy freezing drizzle possible" | "freezing drizzle" | "heavy freezing drizzle" | "light freezing rain" | "moderate or heavy freezing rain" | "light sleet" | "ice pellets" | "light sleet showers" | "moderate or heavy sleet showers")
- condition="󰼴"
- ;;
-"blowing snow" | "moderate or heavy sleet" | "patchy light snow" | "light snow" | "light snow showers")
- condition="󰙿"
- ;;
-"blizzard" | "patchy moderate snow" | "moderate snow" | "patchy heavy snow" | "heavy snow" | "moderate or heavy snow with thunder" | "moderate or heavy snow showers")
- condition=""
- ;;
-"thundery outbreaks possible" | "patchy light rain with thunder" | "moderate or heavy rain with thunder" | "patchy light snow with thunder")
- condition=""
- ;;
-*)
- condition=""
- echo -e "{\"text\":\""$condition"\", \"alt\":\""${weather[0]}"\", \"tooltip\":\""${weather[0]}: $temperature ${weather[1]}"\"}"
- ;;
-esac
-
-#echo $temp $condition
-
-echo -e "{\"text\":\""$temperature $condition"\", \"alt\":\""${weather[0]}"\", \"tooltip\":\""${weather[0]}: $temperature ${weather[1]}"\"}"
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage