diff options
author | Raymaekers Luca <raymaekers.luca@gmail.com> | 2023-08-25 00:32:08 +0200 |
---|---|---|
committer | Raymaekers Luca <raymaekers.luca@gmail.com> | 2023-08-25 00:32:08 +0200 |
commit | c9dec781ad79c0345c7d2d98ab59de5d4f858ba7 (patch) | |
tree | 356dd01a4e3e66fced6eeca50965141bfec98bd0 /config/essentials/zsh/functions.zsh | |
parent | 2e9c5c77562d5aabc1b1f89641fc9eb75b3c9292 (diff) |
[functions.zsh] use log(n)
Diffstat (limited to 'config/essentials/zsh/functions.zsh')
-rw-r--r-- | config/essentials/zsh/functions.zsh | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/config/essentials/zsh/functions.zsh b/config/essentials/zsh/functions.zsh index eb776f0..1682315 100644 --- a/config/essentials/zsh/functions.zsh +++ b/config/essentials/zsh/functions.zsh @@ -20,7 +20,7 @@ nvf() { local match="$(grep -m1 "$1$" "$cache" 2> /dev/null)" if test ! -f "$match" then - die "resetting cache..." + logn "resetting cache..." match="$(goo | tee "$cache" | grep -m 1 "$1$" 2> /dev/null)" # # Alternative: # match="$(goo | grep -m 1 "$1" 2> /dev/null | tee -a | "$cache")" @@ -29,7 +29,7 @@ nvf() { then $EDITOR "$match" && return else - die "no match." && return 1 + logn "no match." && return 1 fi } @@ -249,12 +249,12 @@ pkbs() mime-default () { - die "Setting '$1' as default for its mimetypes" + logn "Setting '$1' as default for its mimetypes" grep "MimeType=" /usr/share/applications/"$1" | cut -d '=' -f 2- | tr ';' '\n' | xargs -I {} xdg-mime default "$1" "{}" - die "Done." + logn "Done." } addedkeys() { @@ -293,12 +293,12 @@ trcp() muttmail() { - die -n "email set: " + log "email set: " ls $HOME/.config/mutt/configs | fzf | tee /dev/stderr | xargs -I {} ln -sf "$HOME/.config/mutt/configs/{}" $HOME/.config/mutt/muttrc - die -n 'Press [Enter to login]' + log 'Press [Enter to login]' read && mutt } @@ -309,3 +309,5 @@ resize() return 1 convert -resize $1^ -gravity center -crop $1+0+0 -- "$2" "${3:-$1}" } + +rln() { ln -s "$(readlink -f "$1")" "$2"; } |