pamac-url-handler-package/pamac-url-handler
2019-08-22 21:38:31 +02:00

16 lines
387 B
Bash

#!/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"