xdg-wrappers: add mbsync, make wrappers use next-in-path

The new next-in-path utility function finds the next entry for the
wrapped name in PATH after the called script, instead of hardcoding the
usual location for a system install.
This commit is contained in:
Alexander Gehrke 2021-11-15 12:52:52 +01:00
parent 761b7700ab
commit e43c38c529
4 changed files with 19 additions and 0 deletions

3
xdg-wrappers/mbsync Executable file
View file

@ -0,0 +1,3 @@
#!/bin/zsh
source ${$(realpath "$0"):h:h}/lib/next-in-path.zsh
$(next-in-path mbsync $0) -c ${XDG_CONFIG_HOME:-$HOME/.config}/mbsyncrc $@

4
xdg-wrappers/rg Executable file
View file

@ -0,0 +1,4 @@
#!/bin/zsh
source ${$(realpath "$0"):h:h}/lib/next-in-path.zsh
export RIPGREP_CONFIG_PATH=${XDG_CONFIG_HOME:-$HOME/.config}/ripgreprc
$(next-in-path rg $0) $@