From d23c5539ccde36bf37d5d596d8209c28784c01c6 Mon Sep 17 00:00:00 2001 From: Felitendo Date: Sun, 16 Aug 2026 19:50:21 +0200 Subject: [PATCH] Add middleclick-autoscroll Middle-click autoscroll for every Chromium-based application on the system - Electron and CEF applications, Chromium-based browsers, Flatpaks, Spotify and Steam - plus anything installed later. Built from source out of the upstream release tarball, like cachy-auto-update. --- README.md | 1 + middleclick-autoscroll/.SRCINFO | 25 ++++++++++++ middleclick-autoscroll/PKGBUILD | 30 +++++++++++++++ .../middleclick-autoscroll.install | 38 +++++++++++++++++++ middleclick-autoscroll/pkg.sh | 27 +++++++++++++ 5 files changed, 121 insertions(+) create mode 100644 middleclick-autoscroll/.SRCINFO create mode 100644 middleclick-autoscroll/PKGBUILD create mode 100644 middleclick-autoscroll/middleclick-autoscroll.install create mode 100644 middleclick-autoscroll/pkg.sh diff --git a/README.md b/README.md index ad53c02..06b7f87 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,7 @@ source in the `PKGBUILD` (and drop the `-bin` suffix), or don't package it. | `faugus-launcher-bin` | [Faugus/faugus-launcher](https://github.com/Faugus/faugus-launcher) — launcher for Windows games via UMU-Launcher | `.deb` (`all`) | [faugus-launcher-bin](https://aur.archlinux.org/packages/faugus-launcher-bin) | | `fluxer-bin` | [fluxer.app](https://fluxer.app) — Fluxer desktop client (Electron) | tarball | [fluxer-bin](https://aur.archlinux.org/packages/fluxer-bin) | | `lunar-client-bin` | [lunarclient.com](https://lunarclient.com) — Minecraft PvP modpack launcher | AppImage | [lunar-client-bin](https://aur.archlinux.org/packages/lunar-client-bin) | +| `middleclick-autoscroll` | [Felitendo/middleclick-autoscroll](https://github.com/Felitendo/middleclick-autoscroll) — middle-click autoscroll for Chromium-based applications (Electron, CEF, Flatpaks, Spotify, Steam) | *built from source* | [middleclick-autoscroll](https://aur.archlinux.org/packages/middleclick-autoscroll) | | `modrinth-app-bin` | [modrinth/code](https://github.com/modrinth/code) — Minecraft mod manager/launcher | `.deb` | [modrinth-app-bin](https://aur.archlinux.org/packages/modrinth-app-bin) | | `sharpemu-bin` | [sharpemu/sharpemu](https://github.com/sharpemu/sharpemu) — experimental PlayStation 5 emulator | tarball | [sharpemu-bin](https://aur.archlinux.org/packages/sharpemu-bin) | | `snapx-bin` | [SnapXL/SnapX](https://github.com/SnapXL/SnapX) — ShareX-fork screenshot/sharing tool | self-contained tarball | [snapx-bin](https://aur.archlinux.org/packages/snapx-bin) | diff --git a/middleclick-autoscroll/.SRCINFO b/middleclick-autoscroll/.SRCINFO new file mode 100644 index 0000000..ce1ff18 --- /dev/null +++ b/middleclick-autoscroll/.SRCINFO @@ -0,0 +1,25 @@ +pkgbase = middleclick-autoscroll + pkgdesc = Middle-click autoscroll for Chromium-based applications - Electron, CEF, Flatpaks, Spotify and Steam included + pkgver = 1.0.0 + pkgrel = 1 + url = https://github.com/Felitendo/middleclick-autoscroll + install = middleclick-autoscroll.install + arch = any + license = GPL-3.0-or-later + makedepends = gettext + makedepends = scdoc + depends = bash + depends = systemd + depends = coreutils + depends = gawk + depends = grep + depends = sed + depends = gettext + optdepends = flatpak: cover Flatpak applications too + optdepends = spotify-launcher: cover the official Spotify client + optdepends = steam: cover the Steam interface + optdepends = desktop-file-utils: refresh the desktop database after a change + source = middleclick-autoscroll-1.0.0.tar.gz::https://github.com/Felitendo/middleclick-autoscroll/archive/refs/tags/v1.0.0.tar.gz + sha256sums = aac78f97d6c9261f5a383016830e5e6fd2229a62dcdbfac3bddce363021704e4 + +pkgname = middleclick-autoscroll diff --git a/middleclick-autoscroll/PKGBUILD b/middleclick-autoscroll/PKGBUILD new file mode 100644 index 0000000..083c545 --- /dev/null +++ b/middleclick-autoscroll/PKGBUILD @@ -0,0 +1,30 @@ +# Maintainer: Felitendo +# This PKGBUILD is updated automatically: +# https://github.com/Felitendo/PKGBUILDS + +pkgname=middleclick-autoscroll +pkgver=1.0.0 +pkgrel=1 +pkgdesc="Middle-click autoscroll for Chromium-based applications - Electron, CEF, Flatpaks, Spotify and Steam included" +arch=('any') +url="https://github.com/Felitendo/middleclick-autoscroll" +license=('GPL-3.0-or-later') +depends=('bash' 'systemd' 'coreutils' 'gawk' 'grep' 'sed' 'gettext') +makedepends=('gettext' 'scdoc') +optdepends=('flatpak: cover Flatpak applications too' + 'spotify-launcher: cover the official Spotify client' + 'steam: cover the Steam interface' + 'desktop-file-utils: refresh the desktop database after a change') +install="${pkgname}.install" +source=("${pkgname}-${pkgver}.tar.gz::${url}/archive/refs/tags/v${pkgver}.tar.gz") +sha256sums=('aac78f97d6c9261f5a383016830e5e6fd2229a62dcdbfac3bddce363021704e4') + +build() { + # pass the version being packaged so `middleclick-autoscroll --version` + # cannot drift away from pkgver + make -C "${pkgname}-${pkgver}" VERSION="$pkgver" +} + +package() { + make -C "${pkgname}-${pkgver}" VERSION="$pkgver" DESTDIR="$pkgdir" install +} diff --git a/middleclick-autoscroll/middleclick-autoscroll.install b/middleclick-autoscroll/middleclick-autoscroll.install new file mode 100644 index 0000000..2ca27fe --- /dev/null +++ b/middleclick-autoscroll/middleclick-autoscroll.install @@ -0,0 +1,38 @@ +post_install() { + cat <<'EOF' + + middleclick-autoscroll is installed but not active yet. + + middleclick-autoscroll interactive menu + middleclick-autoscroll enable turn autoscroll on everywhere + + Run it as your own user, not with sudo: it only ever writes inside your own + home directory, and there is nothing to configure by hand. + +EOF +} + +post_upgrade() { + cat <<'EOF' + + Run `middleclick-autoscroll apply` (or just open the menu) if the version + marker in your generated launcher entries should be refreshed. + +EOF +} + +pre_remove() { + # The changes live in each user's home directory and cannot be undone from a + # root-run hook, so say so while the command that does it still exists. + cat <<'EOF' + + Before removing this package, run + + middleclick-autoscroll disable + + as each user that enabled it. That puts back every launcher entry, flag file + and Steam script it changed. Removing the package without it leaves those + changes in place with nothing left to undo them. + +EOF +} diff --git a/middleclick-autoscroll/pkg.sh b/middleclick-autoscroll/pkg.sh new file mode 100644 index 0000000..e935a3d --- /dev/null +++ b/middleclick-autoscroll/pkg.sh @@ -0,0 +1,27 @@ +# middleclick-autoscroll - middle-click autoscroll for Chromium-based +# applications (https://github.com/Felitendo/middleclick-autoscroll). +# +# Pure shell plus a gettext catalog and a scdoc man page, so the PKGBUILD just +# runs the upstream Makefile against the release tarball. Nothing is prebuilt +# and nothing is republished - the AUR package builds exactly what the tag +# contains. + +UPSTREAM_REPO="Felitendo/middleclick-autoscroll" + +# Installed in CI (pacman) before the makepkg test build. +BUILD_DEPS=(gettext scdoc) + +latest_version() { + gh api "repos/$UPSTREAM_REPO/releases/latest" --jq '.tag_name' | sed 's/^v//' +} + +# refresh_checksums +refresh_checksums() { + local ver="$1" pkgbuild="$2" + local sha + + sha="$(curl -sfL "https://github.com/$UPSTREAM_REPO/archive/refs/tags/v$ver.tar.gz" \ + | sha256sum | cut -d' ' -f1)" + + sed -i "s|^sha256sums=.*|sha256sums=('$sha')|" "$pkgbuild" +}