2019-10-09 13:13:56 +02:00
|
|
|
;;; clipboard.el --- Working with X11's pasteboard -*- lexical-binding: t -*-
|
|
|
|
;; Author: William Carroll <wpcarro@gmail.com>
|
|
|
|
|
|
|
|
;;; Commentary:
|
|
|
|
;; Simple functions for copying and pasting.
|
|
|
|
;;
|
|
|
|
;; Integrate with bburns/clipmon so that System Clipboard can integrate with
|
|
|
|
;; Emacs's kill-ring.
|
|
|
|
;;
|
|
|
|
;; Wish list:
|
|
|
|
;; - Create an Emacs integration with github.com/cdown/clipmenud.
|
|
|
|
|
|
|
|
;;; Code:
|
|
|
|
|
2020-01-16 15:52:02 +01:00
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
;; Dependencies
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
|
|
|
(require 'prelude)
|
|
|
|
(require 'ivy-clipmenu)
|
|
|
|
|
|
|
|
(prelude/assert (prelude/executable-exists? "clipmenu"))
|
|
|
|
(prelude/assert (prelude/executable-exists? "clipmenud"))
|
|
|
|
|
2019-10-09 13:13:56 +02:00
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
;; Library
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
2020-01-16 20:18:11 +01:00
|
|
|
(cl-defun clipboard/copy (x &key (message "[clipboard.el] Copied!"))
|
2019-10-09 13:13:56 +02:00
|
|
|
"Copy string, X, to X11's clipboard."
|
|
|
|
(kill-new x)
|
2020-01-16 20:18:11 +01:00
|
|
|
(message message))
|
2019-10-09 13:13:56 +02:00
|
|
|
|
2020-01-16 20:18:11 +01:00
|
|
|
(cl-defun clipboard/paste (&key (message "[clipboard.el] Pasted!"))
|
2019-10-09 13:13:56 +02:00
|
|
|
"Paste contents of X11 clipboard."
|
|
|
|
(yank)
|
2020-01-16 20:18:11 +01:00
|
|
|
(message message))
|
2019-10-09 13:13:56 +02:00
|
|
|
|
2020-01-16 15:52:02 +01:00
|
|
|
(exwm-input-set-key
|
|
|
|
(kbd "C-M-v") #'ivy-clipmenu/copy)
|
|
|
|
|
2019-10-09 13:13:56 +02:00
|
|
|
(provide 'clipboard)
|
|
|
|
;;; clipboard.el ends here
|