From 45bb0d11161b1c5077a1415eed6dbd0fd25ccb6a Mon Sep 17 00:00:00 2001 From: jdlugosz963 Date: Fri, 20 Sep 2024 14:16:56 +0200 Subject: Change dotfiles structure, and add guix-channels declaration. --- files/.emacs.d/jd/jd-misc.el | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 files/.emacs.d/jd/jd-misc.el (limited to 'files/.emacs.d/jd/jd-misc.el') diff --git a/files/.emacs.d/jd/jd-misc.el b/files/.emacs.d/jd/jd-misc.el new file mode 100644 index 0000000..2b7d1bd --- /dev/null +++ b/files/.emacs.d/jd/jd-misc.el @@ -0,0 +1,34 @@ +;;; Dotfiles --- Jakub Dlugosz emacs config +;;; Commentary: + +;;; Code: + +(defun jd/generete-qr-from-clipboard () + (interactive) + (let ((clipboard-value (x-get-clipboard)) + (clipboard-file-path "/tmp/clipboard_value.txt") + (clipboard-out-image "/tmp/qr.png")) + (with-temp-file clipboard-file-path + (insert clipboard-value)) + (shell-command (concat + "qrencode -o " + clipboard-out-image + " < " + clipboard-file-path)) + (find-file clipboard-out-image))) + +(defun jd/dired-open-file-in-kill-ring () + (interactive) + (let* ((last-killed (car kill-ring)) + (exists-p (file-exists-p last-killed)) + (dir-p (file-directory-p last-killed))) + (cond + ((not exists-p) (message "File doesn't exists!")) + (dir-p (dired last-killed)) + ((not dir-p) (find-file last-killed))))) + +(global-set-key (kbd "C-c O") #'jd/dired-open-file-in-kill-ring) + +(provide 'jd-misc) + +;;; jd-misc.el ends here -- cgit v1.2.3