pamac-url-handler-package/pamac-url-handler

16 lines
387 B
Plaintext
Raw Normal View History

2019-08-22 19:38:31 +00:00
#!/usr/bin/env bash
# ALPM package URL handler
# x-alpm-package://packagename
# install: xdg-mime default pamac-url-handler.desktop x-scheme-handler/x-alpm-package
packagename="${1#x-alpm-package://}"
echo "${packagename:0:4}"
if [[ "aur/" == "${packagename:0:4}" ]]; then
name="${packagename##*/}"
pamac-installer --build "$name"
exit 0
fi
pamac-installer "$packagename"