Compare commits

..

No commits in common. "82a6f2737aaaecc39e1aa1a44336ba007c5b54da" and "0ba879527494ed48c3c2e72e17bb7eb95950b3c8" have entirely different histories.

4 changed files with 19 additions and 40 deletions

View File

@ -1,12 +1,12 @@
# makefile for pamac-url-handler
build:
makepkg -s
makepkg
install:
pamac-installer pamac-url-handler-*.tar.zst
pamac-installer pamac-url-handler-*.tar.xz
remove:
pamac-installer --remove pamac-url-handler
clean:
$(RM) -rf src/ pkg/ *.tar.zst
$(RM) -rf src/ pkg/ *.tar.xz

View File

@ -1,23 +1,20 @@
# Maintainer: TROM <contact@tromsite.com>
# Maintainer: Your Name <youremail@domain.com>
pkgname=pamac-url-handler
pkgver=1.0.0
pkgrel=1
pkgdesc="Install ALPM packages with pamac-installer from URL scheme x-alpm-package://packagename"
arch=(any)
url="https://git.trom.tf/TROMjaro/pamac-url-handler-package"
url=""
license=(unknown)
depends=('pamac-gtk'
'yad'
'exo'
'flatpak')
depends=('pamac-gtk')
provides=('pamac-url-handler')
backup=()
options=(!strip)
install='pamac-url-handler.install'
source=("pamac-url-handler"
"pamac-url-handler.desktop")
sha256sums=('SKIP'
'SKIP')
md5sums=('61007bb8b0d00dabb04c06a7e334653f'
'ca911444c12149c3f11be0a26dd9b2dc')
package() {
install -Dm644 ${srcdir}/pamac-url-handler.desktop ${pkgdir}/usr/share/applications/pamac-url-handler.desktop

View File

@ -1,6 +1,6 @@
# pamac URL handler package
Install ALPM packages with `pamac-installer` or `flatpak` from URL scheme `x-alpm-package://[aur// or flatpak//]<packagename>`
Install ALPM packages with `pamac-installer` from URL scheme `x-alpm-package://[aur/]<packagename>`
## Building the package
@ -19,3 +19,4 @@ To remove just installed package, use:
To cleanup the project, use:
`make clean`

33
pamac-url-handler Executable file → Normal file
View File

@ -4,31 +4,12 @@
# x-alpm-package://packagename
# install: xdg-mime default pamac-url-handler.desktop x-scheme-handler/x-alpm-package
if [ $# != 1 ] || [[ "$1" != 'x-alpm-package://'* ]]; then
echo "Usage: $0 [URL]"
exit 1
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"
content="${1#x-alpm-package://}"
# AUR install
if [[ "$content" == 'aur//'* ]]; then
packagename="${content#aur//}"
pamac-installer --build "$packagename"
# Flatpak install
elif [[ "$content" == 'flatpak//'* ]]; then
appID="${content#flatpak//}"
info=$(flatpak remote-info flathub "$appID") || {
yad --image 'dialog-error' --title 'Alert' --buttons-layout=center --text-align=center --button=yad-close --borders=10 --text "Flatpak ID not found:\n$appID"
exit 1
}
yad --image 'dialog-question' --title 'Flatpak install' --button=Cancel:1 --button=Install:0 --text "$info" &&
exo-open --launch TerminalEmulator \
bash -c "flatpak install --assumeyes flathub $appID ; printf '\n'; read -n1 -rsp 'press any key to close window...'"
# Repo install
else
packagename=$content
pamac-installer "$packagename"
fi