blob: 95e8da5450f1e4ce9fd9afed3d03ec21e3e1e210 (
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
|
(defun dashboard-insert-custom (list-size)
"Insert custom itemes LIST-SIZE."
(interactive)
(insert " TODOs (A) Cal: (c) Mail: (m) Emacs: (e)"))
(add-hook 'dashboard-mode-hook
(lambda()
(define-key dashboard-mode-map (kbd "A") #'(lambda ()(interactive)(org-agenda nil "D")))
;; FIXME look at browse url for explanation
;; (define-key global-map (kbd "g") #')
(define-key dashboard-mode-map (kbd "c") #'calendar)
(define-key dashboard-mode-map (kbd "m") #'notmuch)
(define-key dashboard-mode-map (kbd "e") #'(lambda ()(interactive)(dired user-emacs-directory)))
))
(defvar dashboard-recover-layout-p nil
"Whether recovers the layout.")
(defun open-dashboard ()
"Open the *dashboard* buffer and jump to the first widget."
(interactive)
(setq dashboard-recover-layout-p t)
(delete-other-windows)
(dashboard-refresh-buffer)
(dashboard-goto-recent-files))
(defun quit-dashboard ()
"Quit dashboard window."
(interactive)
(quit-window t)
(when (and dashboard-recover-layout-p
(bound-and-true-p winner-mode))
(winner-undo)
(setq dashboard-recover-layout-p nil)))
;; TODO replace with browse-url librewolf that opens to localhost new tab
;; (defun bard/open-librewolf ()
;; (interactive)
;; (if (string-match "\\`bardiel" system-name)
;; (async-shell-command "librewolf-bin"))
;; '(async-shell-command "librewolf"))
;; TODO replace this with browse-url that opens to localhost new tab
;; (defun bard/open-firefox ()
;; (interactive)
;; (if (string-match "\\`bardiel" system-name)
;; (async-shell-command "firefox-bin"))
;; '(async-shell-command "firefox"))
;; FIXME browse-url-librewolf is incomplete
;; (defun bard/open-user-github ()
;; (browse-url-librewolf 'user-github-url))
(provide 'bard-dashboard)
|