This small script is based on a fork of clipnotify by andreblanke. It just add a small script, clip-daemon, which automatically send the primary selection to the clipboard, so you can now copy to clipboard just by selecting a text in any application (firefox, libreoffice, emacs...). Of course, you can customize rules to avoid that behavior on specific applications or in particular cases. By default, press ctrl to avoid the primary_to_clipboard function.
- ctrl : if pressed before the selection set, disable the script (the primary selection is not sent to clipboard)
- alt : if pressed, remove linebreaks in the text copied
- You can also run _remove_linebreaks automatically when some applications send text directly in the clipboard (for example zathura or emacs pdf-tools). Add the application window class name to the variable
clipboard_notify_apps
. It depends onwmctrl
- You can enable notifications with
clip_daemon_notification=1
. It depends onlibnotify
Clone this repository, and make install
. Or you can do it manually cloning the andreblanke's repo and copying in a bin directory the clip-daemon script. Then, run the clip-daemon script at boot, like for example from .xinitrc or bspwmrc : clip-daemon &
.
xclip
: to manage the X selection entriesxorg-xinput
: to use the keybindings (part of xorg-apps package)wmctrl
: to set application specific ruleslibnotify
: to get notifications
Or course, you can change all that to adapt it to your environment and customize it to your habits!