diff options
| author | Daniel <[email protected]> | 2024-03-20 17:31:18 -0400 |
|---|---|---|
| committer | Daniel <[email protected]> | 2024-03-20 17:31:18 -0400 |
| commit | 0223d899c456049d42e1ff0ba1bc1818a26b6696 (patch) | |
| tree | eeb94bc6898452b77786f5a9a34c4d266e439807 /bard-elisp/bard-dashboard.el | |
| parent | c949abf83be8cc5f796b6559c5fc251b58e92ea2 (diff) | |
nu dashboard
Diffstat (limited to 'bard-elisp/bard-dashboard.el')
| -rw-r--r-- | bard-elisp/bard-dashboard.el | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/bard-elisp/bard-dashboard.el b/bard-elisp/bard-dashboard.el new file mode 100644 index 0000000..95e8da5 --- /dev/null +++ b/bard-elisp/bard-dashboard.el @@ -0,0 +1,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) |
