diff options
| author | Danilo M. <danix@danix.xyz> | 2026-10-06 10:33:34 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-10-06 10:33:34 +0200 |
| commit | 14fe30e906cd93404c637587a22381c6eff5329a (patch) | |
| tree | d879e56a6b90a18421bdd43ccc6130fb46c01711 | |
| parent | e4f4a32415b47d6d8332e82364cea669db07c00f (diff) | |
| download | quickshell-14fe30e906cd93404c637587a22381c6eff5329a.tar.gz quickshell-14fe30e906cd93404c637587a22381c6eff5329a.zip | |
feat(appearance): find a larger version of a low-res wallpaper
When the image staged for the targeted screen gets a yellow or red
quality note, a button under the mock screens copies it to the clipboard
and opens TinEye in the browser, where Ctrl+V runs the reverse search and
the matches can be sorted by size. It acts on the staged image, not the
hovered one, because the pointer leaves the thumbnail to reach it.
The image goes through the clipboard because a search engine takes no
local file in a URL, and scripted uploads did not get through: TinEye
answered 403 to curl and 405 with a browser user agent, and Google Lens
redirected to its consent page, dropping the image. The paste in the
browser is the upload, and only on the user's click.
The copy is converted to PNG with magick. Copied as itself, a JPEG put
only image/jpeg on the clipboard and Firefox pasted nothing into the
page; it hands web content image/png.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
| -rw-r--r-- | appearance/AppearancePanel.qml | 38 | ||||
| -rw-r--r-- | appearance/README.md | 9 |
2 files changed, 47 insertions, 0 deletions
diff --git a/appearance/AppearancePanel.qml b/appearance/AppearancePanel.qml index 0547c6b..9b895f8 100644 --- a/appearance/AppearancePanel.qml +++ b/appearance/AppearancePanel.qml @@ -625,6 +625,44 @@ Scope { color: Wallpapers.qualityColor(subject, Wallpapers.target) } + // A reverse image search for a larger copy of the staged + // image. Staged, not hovered: the pointer leaves the + // thumbnail to reach the button. A search engine cannot be + // handed a local file in a URL and its upload endpoints + // sit behind bot and consent walls, so the image goes on + // the clipboard and the browser opens TinEye, which takes + // a pasted image and sorts its matches by size. The upload + // is the paste, made by the user in the browser. Always + // PNG: Firefox hands a page only image/png from the + // clipboard, so a JPEG copied as itself pasted nothing. + Column { + id: finder + readonly property string staged: + Wallpapers.target === "V" ? Wallpapers.pendingV : Wallpapers.pendingH + property string copied: "" + anchors.horizontalCenter: parent.horizontalCenter + visible: staged !== "" && Wallpapers.qualityNote(staged, Wallpapers.target) !== "" + spacing: 4 + + Tab { + anchors.horizontalCenter: parent.horizontalCenter + text: "Find a larger version" + onClicked: { + Quickshell.execDetached(["sh", "-c", + 'magick "$1" png:- | wl-copy -t image/png && xdg-open https://tineye.com/', + "sh", finder.staged]); + finder.copied = finder.staged; + } + } + Text { + anchors.horizontalCenter: parent.horizontalCenter + visible: finder.copied === finder.staged + text: "image copied: paste it on TinEye with Ctrl+V" + font { family: Theme.fontFamily; pixelSize: Theme.fontSize - 4 } + color: Theme.subtext + } + } + Row { anchors.horizontalCenter: parent.horizontalCenter spacing: 8 diff --git a/appearance/README.md b/appearance/README.md index 2c127a2..ef25428 100644 --- a/appearance/README.md +++ b/appearance/README.md @@ -97,6 +97,15 @@ how far it enlarges: not at all is green, up to 1.33x yellow, past that red. Under the mock screens a note in the same colour says why, for the hovered image or else the staged one. The staged image keeps the accent border. +When the staged image is yellow or red, "Find a larger version" copies it to +the clipboard and opens TinEye, where Ctrl+V searches for it and the matches +can be sorted by size. A search engine takes no local file in a URL, and +scripted uploads hit bot and consent walls (TinEye answered 403, Google Lens +redirected to its consent page and dropped the image), so the paste in the +browser is the upload. The copy is converted to PNG first: Firefox gives a +page only `image/png` from the clipboard, and a JPEG copied as itself +pasted nothing. Replacing the file with a larger find is done by hand. + `wallp` does the actual work, including running `udt-accent`, so the accent follows the new wallpaper exactly as it does from a terminal. This panel replaces its qarma file dialog, not the script. |
