Skip to content

Add opt-in auto paste setting - #4

Open
Sarthak-Raghav wants to merge 1 commit into
mrbeandev:mainfrom
Sarthak-Raghav:feature/auto-paste
Open

Add opt-in auto paste setting#4
Sarthak-Raghav wants to merge 1 commit into
mrbeandev:mainfrom
Sarthak-Raghav:feature/auto-paste

Conversation

@Sarthak-Raghav

Copy link
Copy Markdown

Recopied's current flow is click-to-copy: selecting an item places it on the clipboard and hides the popup, and the user presses Ctrl+V themselves. This PR adds an optional Windows-style flow on top: an Auto Paste setting that simulates Ctrl+V in the previously focused window once the popup hides. Off by default.

  • New auto_paste setting (serde default = false, so existing settings.json files are unaffected)
  • paste_item spawns a background thread after hiding: 150ms focus-settle delay, then xdotool key --clearmodifiers ctrl+v — consistent with the existing xclip usage; X11 only
  • New set_auto_paste command + a settings UI toggle styled to match the notification toggles, with a caption documenting the xdotool requirement and the terminal (Ctrl+Shift+V) caveat

Motivation: replicating the Windows Win+V flow. I originally built this externally with xdotool/clipnotify and hit focus races that only an in-app implementation avoids. Addresses #1 — that report shows users expect click-to-paste and read its absence as a bug.
Tested on Linux Mint 22 Cinnamon (X11): top item, lower items, and Esc-dismiss all behave correctly; auto-paste lands in the previously focused window. (Built with AI assistance; my Rust knowledge is pretty limited and I am also new to Linux)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant