summaryrefslogtreecommitdiffstats
path: root/.emacs.d/jd/jd-custom.el
blob: 8383e4104475e222220b2af5fe67e96ada5a036d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
;;; 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)


(setq erc-nick "bobbma"
      erc-user-full-name "Jakub Dlugosz"
      erc-notify-list '("akuleszaa"))

(defun hipis-znc ()
  (interactive)
  (erc :server "195.74.91.18"
       :port   "6697"))


;; Repair load paths when tramp try to connect to guix instances
(require 'tramp)

(connection-local-set-profile-variables
 'guix-system
 '((tramp-remote-path . (tramp-own-remote-path))))

(connection-local-set-profiles
 '(:application tramp :protocol "sudo" :machine "localhost")
 'guix-system)

(connection-local-set-profiles
 '(:application tramp :protocol "ssh" :machine "jdlugosz.com")
 'guix-system)

(provide 'jd-custom)

;;; jd-custom.el ends here