reddit / emacs

How to set clipboard content from emacs-nox?

snowman5410 · 2022-12-08 14:31
I mostly use emacs-nox (on Linux with KDE Plasma) so the `select-enable-clipboard` setting does not work like when you are in graphical mode. Reading https://www.emacswiki.org/emacs/CopyAndPaste most packages deal with reading the system clipboard content and not setting it. I tried [simpleclip.el](https://github.com/rolandwalker/simpleclip) but when running `simpleclip-copy` I got the error message `Clipboar suppot not available`. I can use emacs in graphical mode, but really prefer emacs-nox, because I mostly live in Konsole. Plus some keyboard shortcuts do not work in graphical mode like `C-c down` (`C-c M-O B`) (`command-org-shiftdown`) which I haven't investigated the cause of.
alternateved · 2022-12-08 15:04
You could try using `xclip` Emacs package with its external dependencies (`xclip` on X11 or `wl-clipboard` on Wayland). Also `clippety` package is excellent choice if you use supported terminal (and it also works via ssh).
deaddyfreddy · 2022-12-08 15:23
A bit offtopic, but actually, you can run shell commands from Emacs itself, there are [multiple](https://www.masteringemacs.org/article/running-shells-in-emacs-overview) [ways](https://git.sr.ht/~niklaseklund/detached.el) to do that.
snowman5410 · 2022-12-08 16:03
> xclip OK this works so I'm trying this one first (the package is obsoleted according to ELPA though). I'll by trying out clippety next. Thanks!
snowman5410 · 2022-12-08 16:05
Thanks, I use `M-x shell` most often. Didn't know about detached.el, will be looking into it also.
alternateved · 2022-12-08 18:58
I feel `clippety` is best when you a. use one of the supported terminals already, b. have to work remotely via ssh (Emacs is installed remotely). For anything else `xclip` seems good enough.
pwnedary · 2022-12-09 10:01
Where do you read that it's obsoleted?
snowman5410 · 2022-12-10 02:00
When I opened the link for the package xclip in M-x list-packages buffer. Though now after uninstalling and installing it again, I'm not seeing it. Could it be that the other day before I refresh the package list, xclip was at 1.10 and it said obsolete referring to the version which is not the current version of 1.11?