diff options
author | jdlugosz963 <jdlugosz963@gmail.com> | 2024-09-20 14:16:56 +0200 |
---|---|---|
committer | jdlugosz963 <jdlugosz963@gmail.com> | 2024-09-20 14:16:56 +0200 |
commit | 45bb0d11161b1c5077a1415eed6dbd0fd25ccb6a (patch) | |
tree | b564c1c43920def6641cd482a7b4dca453dbc043 /files/.emacs.d/jd/jd-misc.el | |
parent | 07dd8e37eb767c3dd6abf63e5e4a720cd778da15 (diff) | |
download | dotfiles-45bb0d11161b1c5077a1415eed6dbd0fd25ccb6a.tar.gz dotfiles-45bb0d11161b1c5077a1415eed6dbd0fd25ccb6a.zip |
Change dotfiles structure, and add guix-channels declaration.
Diffstat (limited to 'files/.emacs.d/jd/jd-misc.el')
-rw-r--r-- | files/.emacs.d/jd/jd-misc.el | 34 |
1 files changed, 34 insertions, 0 deletions
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 @@ | |||
1 | ;;; Dotfiles --- Jakub Dlugosz emacs config | ||
2 | ;;; Commentary: | ||
3 | |||
4 | ;;; Code: | ||
5 | |||
6 | (defun jd/generete-qr-from-clipboard () | ||
7 | (interactive) | ||
8 | (let ((clipboard-value (x-get-clipboard)) | ||
9 | (clipboard-file-path "/tmp/clipboard_value.txt") | ||
10 | (clipboard-out-image "/tmp/qr.png")) | ||
11 | (with-temp-file clipboard-file-path | ||
12 | (insert clipboard-value)) | ||
13 | (shell-command (concat | ||
14 | "qrencode -o " | ||
15 | clipboard-out-image | ||
16 | " < " | ||
17 | clipboard-file-path)) | ||
18 | (find-file clipboard-out-image))) | ||
19 | |||
20 | (defun jd/dired-open-file-in-kill-ring () | ||
21 | (interactive) | ||
22 | (let* ((last-killed (car kill-ring)) | ||
23 | (exists-p (file-exists-p last-killed)) | ||
24 | (dir-p (file-directory-p last-killed))) | ||
25 | (cond | ||
26 | ((not exists-p) (message "File doesn't exists!")) | ||
27 | (dir-p (dired last-killed)) | ||
28 | ((not dir-p) (find-file last-killed))))) | ||
29 | |||
30 | (global-set-key (kbd "C-c O") #'jd/dired-open-file-in-kill-ring) | ||
31 | |||
32 | (provide 'jd-misc) | ||
33 | |||
34 | ;;; jd-misc.el ends here | ||