X11 clipboard history and management using spmenu
Go to file
2017-01-11 11:33:14 +00:00
test perf: Don't use date, use CRC instead 2017-01-06 14:53:59 +00:00
.travis.yml Add Travis CI configuration 2015-08-22 19:30:26 +01:00
clipmenu Use awk instead of uniq to only keep latest, even if not adjacent 2017-01-07 14:30:55 +00:00
clipmenud Put vars above functions 2017-01-11 11:33:14 +00:00
LICENSE License as public domain 2015-10-26 11:10:54 +00:00
README.md Fix parens in README 2017-01-11 11:28:51 +00:00

clipmenu is a simple clipboard manager using dmenu and xsel.

Usage

Start clipmenud, then run clipmenu to select something to put on the clipboard.

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

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:

clipmenud

  1. clipmenud polls the clipboard every 0.5 seconds (or another interval as configured with the CLIPMENUD_SLEEP environment variable). Unfortunately there's no interface to subscribe for changes in X11, so we must poll.
  2. If clipmenud detects changes to the clipboard contents, it writes them out to the cache directory.

clipmenu

  1. clipmenu reads the cache directory to find all available clips.
  2. dmenu is executed to allow the user to select a clip.
  3. After selection, the clip is put onto the PRIMARY and CLIPBOARD X selections.