Every AppImage came out as "cannot tell" because the payload is a compressed filesystem and none of the Chromium markers is on disk to be found. The names are reachable, though: squashfs keeps the name of everything it holds in one table of a few kilobytes, and a name is all this question needs. That table is now read and inflated in place - nothing is unpacked, and the image is never run, which a scan started by the path unit has no business doing anyway. So a Tauri AppImage such as Modrinth is recognised as WebKitGTK and dropped from the list instead of being offered as something that could be switched on - there is no autoscroll in WebKit to ask for - and an Electron one is covered like any other application. Left as "cannot tell": lzo and lz4, which squashfs stores as bare blocks no tool will read without their own framing, and the original ISO9660 layout. Alongside: - The detect cache carries a format line. Its entries are keyed on size and mtime, so an AppImage that has not changed would otherwise keep answering the way an older version decided it did, forever. - A marker list for whole-tree searches, which is what a Flatpak, a snap and an AppImage need. icudtl.dat, snapshot_blob.bin and resources.pak are out of it: Flutter ships an icudtl.dat in data/, and next to a binary those names are evidence while four directories down they are not. The Flatpak and snap searches now share that list.
156 lines
4.8 KiB
Markdown
156 lines
4.8 KiB
Markdown
# middleclick-autoscroll
|
|
|
|
middleclick-autoscroll (what a great name, wow) is a CLI for linux that enables autoscroll in every application that supports it.
|
|
Works with browsers, electron apps like discord and spotify, steam, and anything else that runs on chromium.
|
|
|
|
This tool looks at which of your apps run chromium under the hood and applies the necessary steps to get autoscrolling working (often just a feature flag). One install, one command and autoscroll _✨just works✨_ (like on windows).
|
|
|
|
## How to use
|
|
|
|
Just run `middleclick-autoscroll`. This will open the configuration TUI that looks like this:
|
|
|
|
```
|
|
Middle-Click Autoscroll
|
|
|
|
Autoscroll ON
|
|
|
|
Applications covered 11 of 13
|
|
Not identified 1 - see the applications list
|
|
Steam ON
|
|
New applications ON
|
|
Middle-click paste off
|
|
Last applied 2 minutes ago
|
|
|
|
Applications pick this up the next time they are started.
|
|
|
|
[1] Turn autoscroll on or off
|
|
[2] Re-apply everything
|
|
[3] Applications
|
|
[4] Settings
|
|
[q] Quit
|
|
|
|
>
|
|
```
|
|
|
|
Normally you just need to press `[1]` and the magic is done.
|
|
Pressing `[3]` lets you see every app that was found and toggle each one individually.
|
|
|
|
```
|
|
Applications
|
|
|
|
▸ Steam on (Steam)
|
|
Chromium on (launcher)
|
|
Discord on (flag file)
|
|
Obsidian on (launcher)
|
|
Spotify on (launcher)
|
|
Slack off
|
|
Cursor cannot tell
|
|
|
|
Up/Down select - Space turns one on or off - q goes back
|
|
```
|
|
|
|
You can also press `[4]` for more settings.
|
|
|
|
## How to install
|
|
|
|
**Arch (for the cachyos enjoyers)**
|
|
|
|
```bash
|
|
yay -S middleclick-autoscroll
|
|
```
|
|
|
|
**Fedora (for the mentally stable)**
|
|
|
|
```bash
|
|
sudo curl -fsSL -o /etc/yum.repos.d/middleclick-autoscroll.repo \
|
|
https://felitendo.github.io/middleclick-autoscroll/middleclick-autoscroll.repo
|
|
sudo dnf install middleclick-autoscroll
|
|
```
|
|
|
|
**Bazzite (for the reboot enjoyers)**
|
|
|
|
```bash
|
|
sudo curl -fsSL -o /etc/yum.repos.d/middleclick-autoscroll.repo \
|
|
https://felitendo.github.io/middleclick-autoscroll/middleclick-autoscroll.repo
|
|
sudo rpm-ostree install middleclick-autoscroll
|
|
systemctl reboot
|
|
```
|
|
|
|
**Debian (for the elderly)**
|
|
|
|
```bash
|
|
sudo install -d -m 0755 /etc/apt/keyrings
|
|
curl -fsSL https://felitendo.github.io/middleclick-autoscroll/KEY.gpg \
|
|
| sudo gpg --dearmor -o /etc/apt/keyrings/middleclick-autoscroll.gpg
|
|
echo "deb [signed-by=/etc/apt/keyrings/middleclick-autoscroll.gpg] https://felitendo.github.io/middleclick-autoscroll/deb ./" \
|
|
| sudo tee /etc/apt/sources.list.d/middleclick-autoscroll.list
|
|
sudo apt update && sudo apt install middleclick-autoscroll
|
|
```
|
|
|
|
**openSUSE (for the both of you)**
|
|
|
|
```bash
|
|
sudo rpm --import https://felitendo.github.io/middleclick-autoscroll/KEY.gpg
|
|
sudo zypper addrepo --gpgcheck --refresh \
|
|
https://felitendo.github.io/middleclick-autoscroll/rpm middleclick-autoscroll
|
|
sudo zypper install middleclick-autoscroll
|
|
```
|
|
|
|
## How it works
|
|
|
|
Blink (the engine in Chromium, Electron, and CEF) already has autoscroll, but
|
|
it's off on Linux by default because middle click normally pastes the clipboard (??).
|
|
This flag turns it on:
|
|
|
|
--enable-blink-features=MiddleClickAutoscroll
|
|
|
|
But doing that for every app is kinda bothersome and it also might break with updates.
|
|
That's why I created this small tool to automate that.
|
|
|
|
Browsers get the same thing but this time without "blink":
|
|
|
|
--enable-features=MiddleClickAutoscroll
|
|
|
|
But both do the same ¯\_(ツ)_/¯
|
|
|
|
New apps are picked up by a systemd path unit that watches the
|
|
relevant directories. If you hate systemd; `middleclick-autoscroll apply` does the
|
|
same thing manually.
|
|
|
|
AppImages get looked into as well. The payload is a squashfs image glued onto
|
|
the runtime, and squashfs keeps a small table with the name of every file in
|
|
there - so that table gets read and unpacked (a few kb, nothing is extracted
|
|
and the thing is never run) and the Chromium files are looked for in it. An
|
|
Electron AppImage is covered like any other app; a Tauri one is left alone,
|
|
because WebKitGTK simply has no autoscroll to switch on.
|
|
|
|
## Commands
|
|
|
|
| Command | |
|
|
|---|---|
|
|
| `middleclick-autoscroll` | Interactive menu |
|
|
| `… enable` | Turn on, apply, start watching |
|
|
| `… disable` | Undo everything |
|
|
| `… apply` | Apply to new apps |
|
|
| `… apply --rebuild` | Redo from scratch |
|
|
| `… status` | What's covered |
|
|
| `… list` | All apps and how they're handled |
|
|
|
|
## Building from source
|
|
|
|
```bash
|
|
make
|
|
sudo make install
|
|
```
|
|
|
|
Optionally needs `msgfmt` (gettext) for translations and `scdoc` for the man
|
|
page. Supports `PREFIX` and `DESTDIR`. `make check` runs syntax checks and
|
|
shellcheck.
|
|
|
|
See [packaging/README.md](packaging/README.md) for release builds and repo
|
|
signing.
|
|
|
|
## License
|
|
|
|
GPL-3.0-or-later.
|