Time to dust that thing off and make it work with Wayland! I installed the excellent wl-clipboard by Sergey Bugaev and started hacking.
Here is my script:
Here’s how to use it:
Save the script above to a file at
/usr/local/bin/clipdand make it executable.
dmenuif you don’t already have it.
Install wl-clipboard from source. At the time of this writing, the package in the Ubuntu repository is fairly old and causes some screen glitching. The latest version on GitHub fixed that for me.
Add the following config to your Sway config at
bindsym $mod+v exec clipd menu exec --no-startup-id clipd
Now, when you copy text, clipd will see the new text (within 5 seconds) and add it to your
~/.clipboard-history file. It keeps the last 100 entries there.
When you press Mod + v, a menu will show the entries and allow you to make a selection. The item you select will be put back on the clipboard so you can paste it.