Hyprland dotfiles
| 1 | #!/bin/bash |
| 2 | # /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## |
| 3 | # weather info from wttr. https://github.com/chubin/wttr.in |
| 4 | # Remember to add city |
| 5 | |
| 6 | city= |
| 7 | cachedir="~/.cache/rbn" |
| 8 | cachefile=- |
| 9 | |
| 10 | if [; then |
| 11 | |
| 12 | fi |
| 13 | |
| 14 | if [; then |
| 15 | |
| 16 | fi |
| 17 | |
| 18 | # Save current IFS |
| 19 | SAVEIFS= |
| 20 | # Change IFS to new line. |
| 21 | IFS=$'\n' |
| 22 | |
| 23 | cacheage= |
| 24 | if [ || [; then |
| 25 | data=() |
| 26 | | |
| 27 | | |
| 28 | | |
| 29 | fi |
| 30 | |
| 31 | weather=() |
| 32 | |
| 33 | # Restore IFSClear |
| 34 | IFS= |
| 35 | |
| 36 | temperature= |
| 37 | |
| 38 | #echo ${weather[1]##*,} |
| 39 | |
| 40 | # https://fontawesome.com/icons?s=solid&c=weather |
| 41 | case in |
| 42 | "clear" | "sunny") |
| 43 | condition="" |
| 44 | ;; |
| 45 | "partly cloudy") |
| 46 | condition="" |
| 47 | ;; |
| 48 | "cloudy") |
| 49 | condition="" |
| 50 | ;; |
| 51 | "overcast") |
| 52 | condition="" |
| 53 | ;; |
| 54 | "fog" | "freezing fog") |
| 55 | condition="" |
| 56 | ;; |
| 57 | "patchy rain possible" | "patchy light drizzle" | "light drizzle" | "patchy light rain" | "light rain" | "light rain shower" | "mist" | "rain") |
| 58 | condition="" |
| 59 | ;; |
| 60 | "moderate rain at times" | "moderate rain" | "heavy rain at times" | "heavy rain" | "moderate or heavy rain shower" | "torrential rain shower" | "rain shower") |
| 61 | condition="" |
| 62 | ;; |
| 63 | "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") |
| 64 | condition="" |
| 65 | ;; |
| 66 | "blowing snow" | "moderate or heavy sleet" | "patchy light snow" | "light snow" | "light snow showers") |
| 67 | condition="" |
| 68 | ;; |
| 69 | "blizzard" | "patchy moderate snow" | "moderate snow" | "patchy heavy snow" | "heavy snow" | "moderate or heavy snow with thunder" | "moderate or heavy snow showers") |
| 70 | condition="" |
| 71 | ;; |
| 72 | "thundery outbreaks possible" | "patchy light rain with thunder" | "moderate or heavy rain with thunder" | "patchy light snow with thunder") |
| 73 | condition="" |
| 74 | ;; |
| 75 | *) |
| 76 | condition="" |
| 77 | |
| 78 | ;; |
| 79 | esac |
| 80 | |
| 81 | #echo $temp $condition |
| 82 | |
| 83 | |
| 84 | |
| 85 | cached_weather=" \n " |
| 86 | |
| 87 |