clipmenud, then run
clipmenu to select something to put on the
clipboard. For systemd users, a user service called
clipmenud is packaged as
part of the project.
You may wish to bind a shortcut in your window manager to launch
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'
For a full list of environment variables that clipmenud can take, please see
The behavior of
clipmenud can be customized through environment variables.
Despite being only <300 lines, clipmenu has many useful features, including:
- Customising the maximum number of clips stored (default 1000)
- Disabling clip collection temporarily with
clipctl disable, reenabling with
- Not storing clipboard changes from certain applications, like password managers
- Taking direct ownership of the clipboard
- ...and much more.
clipmenud --help to view all possible environment variables and what
they do. If you manage
systemd, you can override the
defaults by using
systemctl --user edit clipmenud to generate an override
Any dmenu-compliant application will work, but here are
configurations that are known to work:
rofi-script, for rofi's script mode
Several distributions, including Arch and Nix, provide clipmenu as an official
If your distribution doesn't provide a package, you can manually install using
make install (or better yet, create a package for your distribution!). You
clipnotify installed, and also
dmenu unless you plan
to use a different launcher.
How does it work?
clipmenud is less than 300 lines, and clipmenu is less than 100, so hopefully it should be fairly self-explanatory. However, at the most basic level:
clipmenuduses clipnotify to wait for new clipboard events.
clipmenuddetects changes to the clipboard contents, it writes them out to the cache directory and an index using a hash as the filename.
clipmenureads the index 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.