From 1042639a08d649125a01dc9cd720afb919669f53 Mon Sep 17 00:00:00 2001 From: Felitendo Date: Mon, 21 Sep 2026 14:00:02 +0200 Subject: [PATCH] docs: add claude.md and avoid dashes --- .github/workflows/release.yml | 2 +- CLAUDE.md | 7 ++ Makefile | 14 +-- README.md | 6 +- doc/middleclick-autoscroll.1.scd | 38 ++++---- packaging/README.md | 12 +-- packaging/build-deb.sh | 2 +- packaging/check-version.sh | 6 +- packaging/deb/control | 2 +- packaging/pages/index.html | 8 +- packaging/publish-repos.sh | 2 +- packaging/rpm/middleclick-autoscroll.spec | 2 +- po/de.po | 61 +++++++------ po/middleclick-autoscroll.pot | 33 +++---- res/systemd/middleclick-autoscroll.path | 10 +-- src/lib/apply.sh | 10 +-- src/lib/common.sh | 18 ++-- src/lib/detect.sh | 102 +++++++++++----------- src/lib/kde.sh | 10 +-- src/lib/menu.sh | 16 ++-- src/lib/patch.sh | 32 +++---- src/lib/steam.sh | 22 ++--- src/middleclick-autoscroll | 6 +- 23 files changed, 220 insertions(+), 201 deletions(-) create mode 100644 CLAUDE.md diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d34d662..f13fa4d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -143,7 +143,7 @@ jobs: printf '%s' "$GPG_PRIVATE_KEY" | gpg --batch --import else echo "present=no" >> "$GITHUB_OUTPUT" - echo "::warning::No GPG_PRIVATE_KEY secret - the apt and dnf repositories were not updated. The packages are on the release." + echo "::warning::No GPG_PRIVATE_KEY secret, so the apt and dnf repositories were not updated. The packages are on the release." exit 0 fi echo "present=yes" >> "$GITHUB_OUTPUT" diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..0d672eb --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,7 @@ +# CLAUDE.md + +## Style + +- Use simple English: short sentences, common words. +- Avoid em dashes (—). Do not just swap them for "-" either. Rewrite the sentence instead, for + example with a comma, a colon, brackets or two sentences. diff --git a/Makefile b/Makefile index 9ba220f..a246bee 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -# middleclick-autoscroll - build and install +# middleclick-autoscroll: build and install # # Everything here is plain shell; "building" only means compiling the gettext # catalogs and rendering the man page. Both targets degrade to a no-op when @@ -19,8 +19,8 @@ LOCALEDIR ?= $(DATADIR)/locale MANDIR ?= $(DATADIR)/man # Where systemd looks for user units. For a normal install into /usr this is -# asked of systemd itself, because the answer is not the same everywhere - a -# distribution that still keeps /lib separate from /usr/lib says so here - and +# asked of systemd itself, because the answer is not the same everywhere. A +# distribution that still keeps /lib separate from /usr/lib says so here. It is # only guessed at when there is no systemd installed to ask. # # A build with a prefix of its own keeps the units under that prefix instead, @@ -28,7 +28,7 @@ MANDIR ?= $(DATADIR)/man # but only share for a home one: $XDG_DATA_HOME/systemd/user is a search path # and ~/.local/lib/systemd/user is not, so an install into ~/.local that put # the units in lib would leave the watcher impossible to enable. That prefix is -# the one an atomic distribution leaves a user - there is no writing to /usr on +# the one an atomic distribution leaves a user: there is no writing to /usr on # Bazzite or Silverblue without layering a package and rebooting. ifeq ($(PREFIX),/usr) USERUNITDIR ?= $(shell pkg-config --variable=systemduserunitdir systemd 2>/dev/null || echo /usr/lib/systemd/user) @@ -61,14 +61,14 @@ po/%.mo: po/%.po ifdef MSGFMT $(MSGFMT) --check --output-file=$@ $< else - @echo "msgfmt not found - skipping $@" + @echo "msgfmt not found, skipping $@" endif $(MANPAGE): doc/middleclick-autoscroll.1.scd ifdef SCDOC $(SCDOC) < $< > $@ else - @echo "scdoc not found - skipping $@" + @echo "scdoc not found, skipping $@" endif # Syntax-check every shell file, and run shellcheck when it is available. @@ -80,7 +80,7 @@ check: shellcheck -x -e SC1090,SC1091 src/middleclick-autoscroll $(LIBS); \ echo "ok shellcheck"; \ else \ - echo "shellcheck not found - skipped"; \ + echo "shellcheck not found, skipped"; \ fi @if command -v desktop-file-validate >/dev/null 2>&1; then \ echo "ok desktop-file-validate (nothing to check)"; \ diff --git a/README.md b/README.md index cf455c1..e3f6dbc 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Just run `middleclick-autoscroll`. This will open the configuration TUI that loo Autoscroll ON Applications covered 11 of 13 - Not identified 1 - see the applications list + Not identified 1 (see the applications list) Steam ON New applications ON Middle-click paste off @@ -46,7 +46,7 @@ Pressing `[3]` lets you see every app that was found and toggle each one individ Slack off Cursor cannot tell - Up/Down select - Space turns one on or off - q goes back + Up/Down: select, Space: turn on or off, q: back ``` You can also press `[4]` for more settings. @@ -123,7 +123,7 @@ 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 +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. diff --git a/doc/middleclick-autoscroll.1.scd b/doc/middleclick-autoscroll.1.scd index cec00a1..43388c7 100644 --- a/doc/middleclick-autoscroll.1.scd +++ b/doc/middleclick-autoscroll.1.scd @@ -21,16 +21,16 @@ and puts that argument somewhere the application will actually read it, then keeps doing so for anything installed later. A browser is given *--enable-features=MiddleClickAutoscroll* instead. It asks -for the same feature - Blink generates a feature of that name for each of its -runtime flags - but it is not on the list of flags Chromium warns about, so the -browser does not put a bar reading "You are using an unsupported command-line +for the same feature, because Blink generates a feature of that name for each +of its runtime flags. But it is not on the list of flags Chromium warns about, +so the browser does not put a bar reading "You are using an unsupported command-line flag" above every page. That spelling only works from Chromium 124 onwards, which is why everything else keeps the first one: an application that embeds an older Chromium, such as Steam's CEF, has no such bar to show anyway. Two browsers know the feature under a name of their own and ignore Chromium's: Helium, which is asked for *HeliumMiddleClickAutoscroll* as well, and Brave, -which is asked for *MiddelButtonClickAutoscroll* - spelled the way Brave spells -it. A name a browser does not know is ignored. It works on any distribution: +which is asked for *MiddelButtonClickAutoscroll* (spelled the way Brave spells +it). A name a browser does not know is ignored. It works on any distribution: which of the routes below an application takes is read off its launcher, not assumed from where the launcher came from. @@ -55,7 +55,7 @@ is refused. watcher calls; running it by hand is only needed when the watcher is off. Entries left behind by an application that has since been uninstalled are - removed here too - the entry shadowing it lives in the user's home, where + removed here too. The entry shadowing it lives in the user's home, where the package manager that removed the application cannot see it. With *--rebuild* everything is taken back first and written again from @@ -85,7 +85,7 @@ Two ways, chosen per application. the supported way to pass arguments, it survives package upgrades, and it applies to a launch from a terminal as much as one from the menu. A feature list that is already in the file is extended rather than - duplicated - Chromium keeps only the last occurrence of such an option, so + duplicated. Chromium keeps only the last occurrence of such an option, so a second one would switch the first one off. Arch's Electron and Chromium packages all wrap their binaries this way, and @@ -97,8 +97,8 @@ Two ways, chosen per application. For applications that ship their own binary with no wrapper, and for everything inside a Flatpak or a snap, a copy of the desktop entry with the argument appended is written to _~/.local/share/applications_, where it - shadows the system one. Entries that already live there - AppImages, web - app shortcuts - are edited in place, with the original kept. + shadows the system one. Entries that already live there (AppImages, web + app shortcuts) are edited in place, with the original kept. This is the route everything takes on the distributions whose Chromium wrappers keep their equivalent file under _/etc_, where it is the system's @@ -116,7 +116,7 @@ entry entirely. Those are patched in place as well. Shortcuts on the desktop itself are patched in place too. Nothing in the XDG search path looks at that folder, so a shortcut that lives only there would -otherwise be invisible - and Steam puts one there for every game somebody asks +otherwise be invisible. And Steam puts one there for every game somebody asks for a shortcut to. The folder's name is translated, and the name in use is read from _~/.config/user-dirs.dirs_ rather than guessed; the watcher is told about it in a drop-in written when autoscroll is turned on. @@ -134,14 +134,14 @@ _~/.local/share/Steam_ for Valve's own package and Arch's, _~/.steam/debian-installation_ for Debian's, and the private tree of the sandbox for the Flatpak and the snap. All of them are looked at. -Steam compares the installed files against its manifest at every start - by -size and timestamp rather than by content - and restores whatever differs. So +Steam compares the installed files against its manifest at every start (by +size and timestamp, not by content) and restores whatever differs. So the patch is written to look untouched: the bytes the argument costs are taken back out of the script's own comments and the timestamp is put back afterwards, leaving a file exactly as long and exactly as old as Steam left it. A client that checks its files finds nothing to repair, and the argument survives -however Steam was started - from the menu, from a game shortcut, from a -launcher like Heroic or Lutris, from a terminal. +however Steam was started: from the menu, from a game shortcut, from a +launcher like Heroic or Lutris, or from a terminal. That is what has to work, because it is the only thing that does. A patch that changes the length is never written, whatever else could be done to cover for @@ -224,9 +224,9 @@ screen. # WHAT HAS NO FLAG AT ALL Autoscroll is a Blink feature, so only an application drawn by Blink can be -given it. An application built on WebKitGTK - which is what Tauri uses on -Linux, and GNOME Web, and anything else linked against libwebkit2gtk - is not -one of those. WebKit has no equivalent feature to ask for, on any command line +given it. An application built on WebKitGTK is not one of those. That +includes Tauri on Linux, GNOME Web, and anything else linked against +libwebkit2gtk. WebKit has no equivalent feature to ask for, on any command line or in any configuration file. Such an application is identified as what it is and then left out of the list @@ -254,8 +254,8 @@ _~/.config/kwinrc_ _~/.cache/middleclick-autoscroll/detect_ Which programs were found to be Chromium, keyed by size and modification time. Its first line says which version of the program wrote it, and a - file from an older one is ignored rather than trusted - an entry for a - file that has not changed would otherwise never be looked at again. + file from an older one is ignored rather than trusted. Otherwise an entry + for a file that has not changed would never be looked at again. Safe to delete. # ENVIRONMENT diff --git a/packaging/README.md b/packaging/README.md index 87266de..f2cfecb 100644 --- a/packaging/README.md +++ b/packaging/README.md @@ -1,7 +1,7 @@ # Packaging and releases The Makefile installs everything; these only wrap what it produced. That is -deliberate — a packaging script that lists the files again is a second +on purpose: a packaging script that lists the files again is a second description of the layout, and two descriptions drift. | | | @@ -44,14 +44,14 @@ gh workflow run release.yml -f dry_run=true Builds both packages, builds both repositories with a key generated on the spot, checks the three signatures it wrote, and then installs the packages back -out of the repositories — apt on the runner, dnf in a Fedora container. Nothing +out of the repositories (apt on the runner, dnf in a Fedora container). Nothing is pushed and no release is made. This is worth running after any change to the packaging, because the alternative is finding out from a tag. ## Setting up the signing, once The repositories are signed, so this needs a key. Make one that exists for -nothing else — not a personal key — and give it no passphrase: it lives as an +nothing else (not a personal key) and give it no passphrase. It lives as an encrypted repository secret, and `rpmsign` cannot be handed a passphrase unattended. @@ -66,7 +66,7 @@ gpg --armor --export-secret-keys 'middleclick-autoscroll repository' \ Without the secret the workflow still builds both packages and attaches them to the release; it says so in the log and leaves the repositories alone. -## Pointing Pages at it, once — and in this order +## Pointing Pages at it, once, in this order The `gh-pages` branch does not exist until a release has put something on it, and a branch that does not exist cannot be picked in the Pages settings. So: @@ -77,8 +77,8 @@ and a branch that does not exist cannot be picked in the Pages settings. So: root. Doing it the other way round is a wall, and leaving Pages pointed at `main` -serves the source tree at the address the install instructions name — the key -and the indexes are 404 and nothing installs. +serves the source tree at the address the install instructions name. Then the +key and the indexes are 404 and nothing installs. ## What users end up with diff --git a/packaging/build-deb.sh b/packaging/build-deb.sh index 42437c7..4be2659 100755 --- a/packaging/build-deb.sh +++ b/packaging/build-deb.sh @@ -5,7 +5,7 @@ # # Everything the package contains comes out of `make install`. This only wraps # what that produced, so there is exactly one description of where a file goes -# and it is the Makefile - a packaging script that lists the files again is a +# and it is the Makefile. A packaging script that lists the files again is a # second description, and the two drift. # # Needs: make, dpkg-deb, msgfmt (gettext), scdoc. diff --git a/packaging/check-version.sh b/packaging/check-version.sh index 123b44c..68e69a9 100755 --- a/packaging/check-version.sh +++ b/packaging/check-version.sh @@ -3,12 +3,12 @@ # Refuses a release whose tag and Makefile disagree. # # The version is baked into the program at install time from the Makefile, and -# the packages take theirs from the same place - but the tag is what people see +# the packages take theirs from the same place. But the tag is what people see # and what the release is named after. A tag that says something else produces # a package called 1.0.4 containing a program that reports 1.0.3, and nothing # would have complained. # -# Anything that is not a v-tag - a run started by hand from a branch - is not a +# Anything that is not a v-tag (a run started by hand from a branch) is not a # release and has nothing to check. set -euo pipefail @@ -19,7 +19,7 @@ ref="${1:-}" case "$ref" in v[0-9]*) ;; *) - echo "not a release tag (${ref:-none}) - nothing to check against" + echo "not a release tag (${ref:-none}), nothing to check against" exit 0 ;; esac diff --git a/packaging/deb/control b/packaging/deb/control index 9c301f5..59bf279 100644 --- a/packaging/deb/control +++ b/packaging/deb/control @@ -8,7 +8,7 @@ Depends: bash (>= 4.2), coreutils, findutils, grep, sed, mawk | gawk | original- Recommends: gettext-base, systemd, desktop-file-utils Homepage: https://github.com/LoonixTools/middleclick-autoscroll Description: middle-click autoscroll for Chromium-based applications - Blink - the engine inside Chromium, Electron and CEF - has had Windows-style + Blink (the engine inside Chromium, Electron and CEF) has had Windows-style autoscroll for years: hold the middle mouse button, move the pointer, the page scrolls. On Linux it is switched off, because middle click is already taken by primary-selection paste. diff --git a/packaging/pages/index.html b/packaging/pages/index.html index cce764c..cda9c17 100644 --- a/packaging/pages/index.html +++ b/packaging/pages/index.html @@ -64,9 +64,9 @@

middleclick-autoscroll

- Middle-click autoscroll — hold the middle mouse button, move the pointer, the - page scrolls — in every Chromium-based application on the system, and in - anything installed later. + Middle-click autoscroll in every Chromium-based application on the system, + and in anything installed later: hold the middle mouse button, move the + pointer, and the page scrolls.

@@ -103,7 +103,7 @@ sudo zypper install middleclick-autoscroll

That is the whole setup. Nothing else has to be configured and no file has to be edited. Run middleclick-autoscroll disable before removing the - package — it puts back everything that was changed. + package. It puts back everything that was changed.