BUT, it should just work for whichever window manager you use!
For now, only supported for Linux and Mac
Not in MELPA (yet) but, all it you really need to do is evaluate clippo.el
in your Emacs
- emacs (with a daemon currently running)
- Invoke
clippo-start-listen
. This startsclipmon
which listens, captures copies to the system clipboard and puts them into the kill-ring.
-- Clipboard manager
hs.hotkey.bind({'ctrl', 'shift'}, 'q', function() -- CHANGE THE KEYBINDING TO YOUR LIKING
local task = hs.task.new(
'/opt/homebrew/bin/emacsclient', -- CHANGE THIS TO THE FULL PATH OF EMACSCLIENT
function(exitCode, stdout, stderr)
print("Clippo exit code:" .. exitCode)
print("Clippo stdout:" .. stdout)
print("Clippo stderr:" .. stderr)
end,
{ '--eval', '(clippo)' }
)
task:start()
end)
-- Auto-focus emacsclient when created
local wf=hs.window.filter
local wf_emacs = wf.new{'Emacs'}
wf_emacs:subscribe(wf.windowCreated, function(window)
window:focus()
end)
emacsclient --eval "(clippo)"
(You might want to create a keybinding for this, e.g. via skhd)
- jq
- Tell yabai to auto-focus emacs-clippo when it gets instantiated. Put this into your yabairc
yabai -m signal --add event=window_created title='^emacs-clippo.*' action='yabai -m window --focus ${YABAI_WINDOW_ID}'
- Tell yabai configure emacs-clippo to be a floating window. Put this into your yabairc
yabai -m rule --add title='^emacs-clippo.*' layer=above manage=off
- If you didn't build Emacs with
--with-no-frame-refocus
, the command you want to invoke instead, is:
emacsclient --eval "(clippo-yabai $(yabai -m query --windows --window | jq .id))"
We need to pass in the window ID, otherwise, OSX focuses Emacs GUI (from which emacsclient was spawned) after you copy to clipboard.
NOTE: This, for some reason, causes a 1-2 sec delay for emacsclient to close, so it's recommended that you build Emacs with --with-no-frame-refocus
if possible!
- xclip
emacsclient --eval "(clippo)"
(You might want to create a keybinding for this, e.g. in your i3 config)
- Tell i3 to configure emacs-clippo to be a floating window. Put this into your i3 config file
for_window [title="^emacs-clippo.*" class="Emacs"] floating enable