mirror of
https://github.com/narrrl/proton-drive-linux.git
synced 2026-11-19 10:05:03 +01:00
`pdfs completions <shell>` prints a completion script for bash, zsh, fish, elvish or PowerShell, built on clap_complete's dynamic engine: on Tab the shell calls `pdfs` back, which completes commands and options and also the values the running service knows, each with a description: paths in My files, synced-folder and queue ids, computers, trash, albums, items shared with me, invitations, bookmarks, conflict copies, and a file's versions or a share's members and public link once its path is typed. A completer that gets no answer from the service within two seconds offers nothing rather than hanging the prompt. Listings that ask Proton are kept for 30 s in $XDG_RUNTIME_DIR (0600), so repeated Tabs do not wait again. Completion is triggered by PDFS_COMPLETE rather than clap's generic COMPLETE, because the same binary runs the daemon. Share roles are now checked by the CLI before the request. The package recipes install the bash, zsh and fish scripts via packaging/completions.sh.
80 lines
4.5 KiB
Bash
80 lines
4.5 KiB
Bash
# Maintainer: Nils Pukropp <contact@narl.io>
|
|
|
|
pkgname=proton-drive-for-linux-bin
|
|
pkgver=3.7.0
|
|
pkgrel=1
|
|
pkgdesc="Unofficial Proton Drive client: FUSE files-on-demand mount, CLI, GTK4 app, tray (binaries)"
|
|
arch=('x86_64')
|
|
url="https://proton-drive.narl.io"
|
|
_repo="https://github.com/narrrl/proton-drive-linux"
|
|
license=('MIT')
|
|
depends=('fuse3' 'gtk4' 'libadwaita' 'webkitgtk-6.0' 'dbus' 'gcc-libs' 'glibc'
|
|
'hicolor-icon-theme')
|
|
optdepends=('perl-image-exiftool: thumbnails for camera RAW files'
|
|
'ffmpeg: video thumbnails'
|
|
'iso-codes: country names in your language under Places'
|
|
'gnome-keyring: credential storage over the Secret Service API'
|
|
'kwallet: credential storage over the Secret Service API'
|
|
'xdg-utils: "Open folder" action in the tray menu'
|
|
'fzf: search-as-you-type launcher (pdfs-prompt --fzf)'
|
|
'foot: terminal that hosts pdfs-prompt --fzf when started from a keybinding')
|
|
provides=("${pkgname%-bin}=$pkgver" "proton-drive-linux=$pkgver" 'pdfs')
|
|
conflicts=('proton-drive-linux' 'proton-drive-for-linux' 'proton-drive-for-linux-git')
|
|
# Upstream ships the binaries already built on Ubuntu 24.04; do not rewrite them.
|
|
options=('!strip' '!debug')
|
|
# Stops the running daemon before removal, so the mount stops mirroring deletes.
|
|
install=proton-drive.install
|
|
_tag="v$pkgver"
|
|
_raw="https://raw.githubusercontent.com/narrrl/proton-drive-linux/$_tag"
|
|
# The release tarball holds the four binaries only, so the desktop integration
|
|
# files come straight from the tagged tree. Every one carries $pkgver in its
|
|
# name: makepkg reuses a cached file of the same name, so an unversioned name
|
|
# keeps the old copy after upstream changes it and fails the checksum.
|
|
source=("proton-drive-linux-$pkgver-x86_64.tar.gz::$_repo/releases/download/$_tag/proton-drive-linux-$pkgver-x86_64.tar.gz"
|
|
"io.narl.proton-drive-linux-$pkgver.desktop::$_raw/packaging/io.narl.proton-drive-linux.desktop"
|
|
"io.narl.proton-drive-linux-tray-$pkgver.desktop::$_raw/packaging/io.narl.proton-drive-linux-tray.desktop"
|
|
"io.narl.proton-drive-linux-$pkgver.svg::$_raw/packaging/io.narl.proton-drive-linux.svg"
|
|
"proton-drive-$pkgver.service::$_raw/packaging/proton-drive.service"
|
|
"LICENSE-$pkgver::$_raw/LICENSE")
|
|
sha256sums=('3f0d16c19b10b30e3f181e3c7fb439f0a8c38980e8ab7a4a96ae6596b349787c'
|
|
'd190d6771fff0b975271fb62fd3fb0fa8bbf17d7278c10853c18557855b0c123'
|
|
'1d95e250370220e3bb6aead6ce34d1d6cc759f42c4803b75f1667e78ff47c6c0'
|
|
'e598a93c2715c3a9fdc7fb937902083d4a1135e8fbdfe6fe7e37f0383ebbd828'
|
|
'44c25dca6e759c46fca50b58099aa6194abe78293dee07d971bbbce0ff3ca58f'
|
|
'02c419e7f9af08dda720e4f852f3e57cf5a69e192605440f750e9d244fa2817c')
|
|
|
|
package() {
|
|
install -Dm755 "$srcdir/pdfs" "$pkgdir/usr/bin/pdfs"
|
|
install -Dm755 "$srcdir/pdfs-tray" "$pkgdir/usr/bin/pdfs-tray"
|
|
install -Dm755 "$srcdir/pdfs-app" "$pkgdir/usr/bin/pdfs-app"
|
|
install -Dm755 "$srcdir/pdfs-prompt" "$pkgdir/usr/bin/pdfs-prompt"
|
|
|
|
install -Dm644 "$srcdir/io.narl.proton-drive-linux-$pkgver.desktop" \
|
|
"$pkgdir/usr/share/applications/io.narl.proton-drive-linux.desktop"
|
|
install -Dm644 "$srcdir/io.narl.proton-drive-linux-tray-$pkgver.desktop" \
|
|
"$pkgdir/etc/xdg/autostart/io.narl.proton-drive-linux-tray.desktop"
|
|
install -Dm644 "$srcdir/io.narl.proton-drive-linux-$pkgver.svg" \
|
|
"$pkgdir/usr/share/icons/hicolor/scalable/apps/io.narl.proton-drive-linux.svg"
|
|
|
|
# systemd user unit for the auto-mount daemon; enabled per user, not by pacman.
|
|
install -Dm644 "$srcdir/proton-drive-$pkgver.service" \
|
|
"$pkgdir/usr/lib/systemd/user/proton-drive.service"
|
|
|
|
# Translations ship precompiled in the release tarball.
|
|
install -dm755 "$pkgdir/usr/share"
|
|
cp -r --no-preserve=ownership "$srcdir/locale" "$pkgdir/usr/share/locale"
|
|
|
|
# Shell completion for bash, zsh and fish, written by the binary itself.
|
|
local share="$pkgdir/usr/share"
|
|
install -d "$share/bash-completion/completions" "$share/zsh/site-functions" \
|
|
"$share/fish/vendor_completions.d"
|
|
"$srcdir/pdfs" completions bash > "$share/bash-completion/completions/pdfs"
|
|
"$srcdir/pdfs" completions zsh > "$share/zsh/site-functions/_pdfs"
|
|
"$srcdir/pdfs" completions fish > "$share/fish/vendor_completions.d/pdfs.fish"
|
|
|
|
install -Dm644 "$srcdir/LICENSE-$pkgver" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
|
|
|
|
# pacman brings new releases, so the app never checks for them itself.
|
|
install -Dm644 /dev/null "$pkgdir/usr/share/proton-drive-linux/managed-updates"
|
|
}
|