clipmenud, then run
clipmenu to select something to put on the
A systemd user service for starting clipmenud is included at init/clipmenud.service.
All args passed to clipmenu are transparently dispatched to dmenu. That is, if you usually call dmenu with args to set colours and other properties, you can invoke clipmenu in exactly the same way to get the same effect, like so:
clipmenu -i -fn Terminus:size=8 -nb '#002b36' -nf '#839496' -sb '#073642' -sf '#93a1a1'
You can remove clips with the
clipdel utility, see
Several distributions, including Arch and Nix, provide clipmenu as an official
If your distribution doesn't provide a package, you can run the scripts standalone (or better yet, package them!).
How does it work?
The code is fairly simple and easy to follow, you may find it easier to read there, but it basically works like this:
clipmenuduses clipnotify to wait for new clipboard events. If clipnotify is not present on the system, we poll every 0.5 seconds (or another interval as configured with the
You can also bind your copy key binding to also issue
CM_ONESHOT=1 clipmenud. However, there's no generic way to do this, since any keys or mouse buttons could be bound to do this action in a number of ways.
clipmenuddetects changes to the clipboard contents, it writes them out to the cache directory.
clipmenureads the cache directory to find all available clips.
dmenuis executed to allow the user to select a clip.
- After selection, the clip is put onto the PRIMARY and CLIPBOARD X selections.