clipmenu

Simple clipboard management using dmenu
git clone https://git.sinitax.com/cdown/clipmenu
Log | Files | Refs | README | LICENSE | sfeed.txt

commit 4528da5e6824ec3bae43a1d923c63e1d4f3b97b7
parent a95b727d3b0d93201cb36188d471fa956d5da381
Author: Chris Down <chris@chrisdown.name>
Date:   Mon, 23 Mar 2020 18:16:22 +0000

readme: Remove out of date information

CM_SLEEP is gone, and we don't have non-clipnotify behaviour any more.

Diffstat:
MREADME.md | 27+++++++++++++++------------
1 file changed, 15 insertions(+), 12 deletions(-)

diff --git a/README.md b/README.md @@ -14,6 +14,9 @@ clipboard. A systemd user service for starting clipmenud is included at [init/clipmenud.service](https://github.com/cdown/clipmenu/blob/develop/init/clipmenud.service). +You can then start clipmenud like this: + + systemctl --user start clipmenud 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 @@ -21,7 +24,13 @@ 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 `clipdel --help`. +If you prefer to collect clips on demand rather than running clipmenud as a +daemon, you can bind a key to the following command for one-off collection: + + CM_ONESHOT=1 clipmenud + +For a full list of environment variables that clipmenud can take, please see +`clipmenud --help`. # Installation @@ -33,25 +42,19 @@ 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: +clipmenud is less than 200 lines, and clipmenu is less than 100, so hopefully +it should be fairly self-explanatory. However, at the most basic level: ## clipmenud 1. `clipmenud` uses [clipnotify](https://github.com/cdown/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 - `CM_SLEEP` environment variable). - - 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. + for new clipboard events. 2. If `clipmenud` detects changes to the clipboard contents, it writes them out - to the cache directory. + to the cache directory and an index using a hash as the filename. ## clipmenu -1. `clipmenu` reads the cache directory to find all available clips. +1. `clipmenu` reads the index 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.