Created
October 5, 2012 22:55
-
-
Save superdaigo/3842934 to your computer and use it in GitHub Desktop.
Klipper copy & paste for emacs terminal (KDE)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; linux | |
(when (eq 'gnu/linux system-type) | |
;; terminal | |
(unless window-system | |
;; I don't know how to detect the system was KDE or not. :( | |
(defun copy-from-kde() | |
(let ((output (shell-command-to-string "qdbus org.kde.klipper /klipper getClipboardContents"))) | |
(unless (string= (car kill-ring) output) | |
output ))) | |
(defun paste-to-kde (text &optional push) | |
(let ((process-connection-type nil)) | |
(let ((proc (start-process "proc" "*Messages*" "qdbus" "org.kde.klipper" "/klipper" "setClipboardContents" text))) | |
))) | |
(setq interprogram-cut-function 'paste-to-kde) | |
(setq interprogram-paste-function 'copy-from-kde) | |
) | |
) | |
;; Great Thanks | |
;; pbcopy & pbpaste for Emacs <https://gist.github.com/267162> | |
;; shell-helpers <https://github.com/milianw/shell-helpers/blob/master/clipboard> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment