diff options
author | awy <awy@awy.one> | 2025-08-24 13:54:25 +0300 |
---|---|---|
committer | awy <awy@awy.one> | 2025-08-24 13:54:25 +0300 |
commit | c079071001adb81de6ca839b0c617ed7ce3f0862 (patch) | |
tree | 6fe8c0644e03964dc019b5ec630516e4efefda15 /.local/bin/weath | |
parent | 4cab932fa600f3a0db895041c46e58765333e15e (diff) | |
download | hyprdots-c079071001adb81de6ca839b0c617ed7ce3f0862.tar.gz |
cleanup
Diffstat (limited to '.local/bin/weath')
-rwxr-xr-x | .local/bin/weath | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/.local/bin/weath b/.local/bin/weath deleted file mode 100755 index ed23534..0000000 --- a/.local/bin/weath +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh -# -# Get the weather on the terminal. You can pass an alternative location as a parameter, -# and/or use the 'cp' option to copy the forecast as plaintext to the clipboard. - -report="${XDG_CACHE_HOME:-$HOME/.cache}/weatherreport" - -if [ "$1" = 'cp' ]; then - # shellcheck disable=SC2015 - [ -z "$2" ] && sed 's/\x1b\[[^m]*m//g' "$report" | wl-copy && - notify-send "Weather forecast for '${LOCATION:-$(head -n 1 "$report" | cut -d' ' -f3-)}' copied to clipboard." || - { data="$(curl -sfm 5 "${WTTRURL:-wttr.in}/$2?T")" && - notify-send "Weather forecast for '$2' copied to clipboard." && - echo "$data" | wl-copy || - notify-send 'Failed to get weather forecast!' 'Check your internet connection and the supplied location.'; } -else - [ -n "$2" ] && - notify-send "Invalid option '$1'! The only valid option is 'cp'." && - exit 1 - - # shellcheck disable=SC2015 - [ -z "$1" ] && less -S "$report" || - data="$(curl -sfm 5 "${WTTRURL:-wttr.in}/$1")" && echo "$data" | less -S || - notify-send 'Failed to get weather forecast!' 'Check your internet connection and the supplied location.' -fi |