feat(clipboard): add startup cleanup and automatic paste options#922
Open
alepspizzetti wants to merge 2 commits into
Open
feat(clipboard): add startup cleanup and automatic paste options#922alepspizzetti wants to merge 2 commits into
alepspizzetti wants to merge 2 commits into
Conversation
Add opt-in settings to clear regular clipboard history when Noctalia starts and to paste selected entries into the previously focused window. Preserve pinned entries during startup cleanup, defer Ctrl+V until the panel closes, document the optional wtype dependency, and add English and Portuguese translations.
Contributor
|
@yanekyuk - this PR modifies your plugin. Please review when you have a chance. |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds two new Clipboard plugin settings to control startup history clearing and optional auto-paste behavior after selecting an entry.
Changes:
- Bumped plugin version and added new default settings (
clearHistoryOnStartup,autoPasteOnSelect) to the manifest. - Exposed the new settings in the Settings UI and updated i18n strings (EN/PT).
- Implemented auto-paste by invoking
wtypeafter the panel closes, and added optional startup history wipe.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| clipboard/manifest.json | Version bump and new default settings flags. |
| clipboard/i18n/en.json | Adds English strings for the new settings. |
| clipboard/i18n/pt.json | Adds Portuguese strings for the new settings. |
| clipboard/Settings.qml | Adds toggles + settings persistence for the new flags; uses manifest defaults as fallback. |
| clipboard/Panel.qml | Sets a “paste after close” flag based on settings and triggers paste after closing the panel. |
| clipboard/Main.qml | Adds a Process and helper to run wtype for auto-paste; clears history on startup when configured. |
| clipboard/README.md | Documents the new settings and optional wtype dependency. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+1167
to
+1172
| onCopied: { | ||
| const cfg = root.pluginApi?.pluginSettings || ({}); | ||
| const defaults = root.pluginApi?.manifest?.metadata?.defaultSettings || ({}); | ||
| root.pasteAfterClose = cfg.autoPasteOnSelect ?? defaults.autoPasteOnSelect ?? false; | ||
| closePanelTimer.restart(); | ||
| } |
Comment on lines
+105
to
+110
| const runtimeDir = Quickshell.env("XDG_RUNTIME_DIR") || ""; | ||
| const waylandDisplay = Quickshell.env("WAYLAND_DISPLAY") || ""; | ||
| pasteProc.command = ["bash", "-c", | ||
| 'sleep 0.5; XDG_RUNTIME_DIR="$1" WAYLAND_DISPLAY="$2" wtype -M ctrl -P v -p v -m ctrl', | ||
| "--", runtimeDir, waylandDisplay]; | ||
| pasteProc.running = true; |
Comment on lines
+33
to
+36
| "clear-history-on-startup": "Limpar historico ao iniciar", | ||
| "clear-history-on-startup-description": "Limpar o historico comum sempre que o Noctalia Shell iniciar ou reiniciar. Itens fixados sao preservados.", | ||
| "auto-paste-on-select": "Colar automaticamente ao selecionar", | ||
| "auto-paste-on-select-description": "Fechar o painel e enviar Ctrl+V para a janela anterior depois de selecionar uma entrada.", |
Centralize the automatic-paste setting lookup, add a configurable 200-5000 ms focus restoration delay with a 500 ms default, and correct Portuguese diacritics.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
wtypeas an optional dependency for automatic pasteMotivation
Clipboard history can grow across shell sessions, and selecting a previous entry currently requires a separate paste action. These options let users choose a more private startup behavior and a faster selection workflow without changing the default behavior for existing installations.
Both options default to
false. Existing user settings continue to take precedence over manifest defaults and are preserved by Noctalia plugin updates.Implementation
Automatic paste closes the plugin panel first, waits briefly for focus to return to the previous window, and then emits
Ctrl+Vthroughwtype. Startup cleanup reuses the existingcliphist wipepath, so pinned entries remain untouched.The plugin version is bumped from
1.0.3to1.1.0.Testing
Tested locally on Noctalia Shell 4.7.7 with Niri:
jq