diff options
| -rw-r--r-- | config/essentials/zsh/aliases.zsh | 2 | ||||
| -rw-r--r-- | config/essentials/zsh/functions.zsh | 23 | 
2 files changed, 24 insertions, 1 deletions
diff --git a/config/essentials/zsh/aliases.zsh b/config/essentials/zsh/aliases.zsh index 07773a7..5908100 100644 --- a/config/essentials/zsh/aliases.zsh +++ b/config/essentials/zsh/aliases.zsh @@ -80,6 +80,8 @@ alias yql='yay -Ql'  alias yays='yay -S'  alias yrm='yay -Rns' +alias pkb='pkgfile -b' +  alias grub-update='doas grub-mkconfig -o /boot/grub/grub.cfg'  # vim diff --git a/config/essentials/zsh/functions.zsh b/config/essentials/zsh/functions.zsh index 808f4bf..f6169eb 100644 --- a/config/essentials/zsh/functions.zsh +++ b/config/essentials/zsh/functions.zsh @@ -1,11 +1,18 @@  #!/bin/zsh +die () +{ +	echo "$1" >&2 +} +  vmp() {      col -b | \      vim -MR \      -c 'set ft=man nolist nonu nornu'  } -vimh() { vim -c "help $1" -c 'call feedkeys("\<c-w>o")' } +vimh() { +	vim -c "help $1" -c 'call feedkeys("\<c-w>o")' +}  nnn() { test -z "$NNNLVL" && /usr/bin/nnn "$@" || exit }  ranger() { test -z "$RANGER_LEVEL" && /usr/bin/ranger "$@" || exit } @@ -196,3 +203,17 @@ pacsize ()  		expac '%m %n' - |  		numfmt --to=iec-i --suffix=B --format="%.2f"  } +pkbs () +{ +	pkgfile -b "$1" | tee /dev/stderr | doas pacman -S - +} + +mime-default () +{ +	die "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." +}  | 
