https://github.com/cdown/clipmenu
clipmenu is a simple clipboard manager using fzf and xsel.
clipmenud uses clipnotify, which is provided with this repo as a submodule. You will also need fzf and xsel installed.
clone the repo with submodules:
git clone --recurse-submodules git@github.com:xero/clipmenu.git
cd clipmenu
build clipnotify, then the clipmenu bins:
cd clipnotify
make && make install
cd ..
make install
finally re{load,start} the systemd unit:
systemctl --user daemon-reload
systemctl --user restart clipmenud.service
Start 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.
For those using a systemd unit and not using a desktop environment which does it automatically, you must import $DISPLAY so that clipmenud knows which X server to use. For example, in your ~/.xinitrc do this prior to launching clipmenud:
systemctl --user import-environment DISPLAY
if you're in a headless environment you need to create a "fake" xorg server for xsel to communicate with. i suggest using xvfb. put something like this in your shell init (e.g. ~/.zlogin or ~/.bash_login):
if ! pgrep -x "Xvfb" >/dev/null; then
export DISPLAY=:0
Xvfb :0 -screen 0 1x1x8 &
systemctl --user import-environment DISPLAY
systemctl --user restart clipmenud.service
fi
this fork of clipmenu uses fzf exclusivly. you can use it's environment vars to setup the fzf style to your liking. i personally have the following set in my env:
export FZF_DEFAULT_OPTS=$FZF_DEFAULT_OPTS' --color=fg:#c1c1c1,bg:#2b2b2b,hl:#5f8787 --color=fg+:#ffffff,bg+:#1c1c1c,hl+:#3ea3a3 --color=info:#87875f,prompt:#87875f,pointer:#8787af --color=marker:#8787af,spinner:#8787af,header:#5f8787 --color=gutter:#2b2b2b,border:#222222 --padding=1 --prompt=❯ --marker=❯ --pointer=❯ --reverse'
For a full list of environment variables that clipmenud can take, please see clipmenud --help.
The behavior of clipmenud can be customized through environment variables. Despite being only <300 lines, clipmenu has many useful features, including:
Check clipmenud --help to view all possible environment variables and what they do. If you manage clipmenud with systemd, you can override the defaults by using systemctl --user edit clipmenud to generate an override file.
this fork is designed to only work with CM_LAUNCHER set to fzf (default)
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:
checkout my dotfiles repo to see it in action.