Compare commits

...

6 Commits

Author SHA1 Message Date
appeasementPolitik
8ebef423a3
Merge 7bf7b73a4ee1ce10f5b492bb07d4cee839d57550 into 031938a792ac3107a512e89504929ef9e3e8ed6a 2023-11-10 03:44:20 -06:00
Dominik
031938a792
Update dmenurecord (#1370) 2023-11-04 12:33:18 +00:00
appeasementPolitik
7bf7b73a4e
Give weath 'cp' option to copy forecast as plain text for sharing 2023-08-24 14:20:23 +00:00
appeasementPolitik
c389d429bb
Merge branch 'LukeSmithxyz:master' into weath 2023-08-24 14:10:48 +00:00
appeasementPolitik
fc1cd24557
Remove retry and make max time lower because it is interactive 2023-05-14 07:59:18 +00:00
appeasementPolitik
236b082078
weath: Add option to get forecast from a different location 2023-05-13 14:43:12 +00:00
2 changed files with 21 additions and 3 deletions

View File

@ -16,7 +16,26 @@ done; unset command
se() {
choice="$(find ~/.local/bin -mindepth 1 -printf '%P\n' | fzf)"
[ -f "$HOME/.local/bin/$choice" ] && $EDITOR "$HOME/.local/bin/$choice"
;}
}
weath() {
if [ "$1" = 'cp' ]; then
[ -z "$2" ] && sed 's/\x1b\[[^m]*m//g' "${XDG_CACHE_HOME:-$HOME/.cache}/weatherreport" | xclip -selection clipboard &&
notify-send "Weather forecast for '$LOCATION' copied to clipboard." ||
{ data="$(curl -sfm 5 "${WTTRURL:-wttr.in}/$2?T")" &&
notify-send "Weather forecast for '$2' copied to clipboard." &&
echo "$data" | xclip -selection clipboard ||
notify-send 'Failed to get weather forecast!' 'Check your internet connection and if the location is correct.'; }
else
[ -n "$2" ] &&
notify-send "Invalid option '$1'! The only valid option is 'cp'." &&
return 1
[ -z "$1" ] && less -S "${XDG_CACHE_HOME:-$HOME/.cache}/weatherreport" ||
data="$(curl -sfm 5 "${WTTRURL:-wttr.in}/$1")" && echo "$data" | less -S ||
notify-send 'Failed to get weather forecast!' 'Check your internet connection and if the location is correct.'
fi
}
# Verbosity and settings that you pretty much just always are going to want.
alias \
@ -58,4 +77,3 @@ alias \
lf="lfub" \
magit="nvim -c MagitOnly" \
ref="shortcuts >/dev/null; source ${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc ; source ${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshnameddirrc" \
weath="less -S ${XDG_CACHE_HOME:-$HOME/.cache}/weatherreport" \

View File

@ -9,7 +9,7 @@
#
# If there is already a running instance, user will be prompted to end it.
getdim() { xrandr | sed -n "s/\s*\([0-9]\+x[0-9]\+\).*\*.*/\1/p" ;}
getdim() { xrandr | grep -oP '(?<=current ).*(?=,)' | tr -d ' ' ;}
updateicon() { \
echo "$1" > /tmp/recordingicon