From 39c23de25f39ac68a0baeb6e9132ea89cde1a09a Mon Sep 17 00:00:00 2001 From: coolneng Date: Sun, 27 Aug 2023 07:43:55 +0200 Subject: [PATCH] Restore placement and behaviour of restore session --- +ui.el | 56 ++++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 36 insertions(+), 20 deletions(-) diff --git a/+ui.el b/+ui.el index 198a9ce..6c312b4 100644 --- a/+ui.el +++ b/+ui.el @@ -37,26 +37,42 @@ ;; Show matching parenthesis on the minibuffer (after! smartparens (show-smartparens-global-mode t)) ;; Modify the splash screen actions -(assoc-delete-all "Jump to bookmark" +doom-dashboard-menu-sections) -(assoc-delete-all "Open private configuration" +doom-dashboard-menu-sections) -(assoc-delete-all "Open documentation" +doom-dashboard-menu-sections) -(add-to-list '+doom-dashboard-menu-sections - '("Open email client" - :icon (all-the-icons-octicon "mail" :face 'doom-dashboard-menu-title) - :when (featurep! :email mu4e) - :face (:inherit (doom-dashboard-menu-title bold)) - :action =mu4e) t) -(add-to-list '+doom-dashboard-menu-sections - '("RSS reader" - :icon (all-the-icons-octicon "rss" :face 'doom-dashboard-menu-title) - :when (featurep! :app rss) - :face (:inherit (doom-dashboard-menu-title bold)) - :action =rss) t) -(add-to-list '+doom-dashboard-menu-sections - '("Read saved articles" - :icon (all-the-icons-octicon "book" :face 'doom-dashboard-menu-title) - :face (:inherit (doom-dashboard-menu-title bold)) - :action =wallabag) t) +(setq +doom-dashboard-menu-sections + '(("Reload last session" + :icon (all-the-icons-octicon "history" :face 'doom-dashboard-menu-title) + :when (cond ((modulep! :ui workspaces) + (file-exists-p (expand-file-name persp-auto-save-fname persp-save-dir))) + ((require 'desktop nil t) + (file-exists-p (desktop-full-file-name)))) + :face (:inherit (doom-dashboard-menu-title bold)) + :action doom/quickload-session) + ("Open org-agenda" + :icon (all-the-icons-octicon "calendar" :face 'doom-dashboard-menu-title) + :when (fboundp 'org-agenda) + :action org-agenda) + ("Recently opened files" + :icon (all-the-icons-octicon "file-text" :face 'doom-dashboard-menu-title) + :action recentf-open-files) + ("Open email client" + :icon (all-the-icons-octicon "mail" :face 'doom-dashboard-menu-title) + :when (featurep! :email mu4e) + :face (:inherit (doom-dashboard-menu-title bold)) + :action =mu4e) + ("RSS reader" + :icon (all-the-icons-octicon "rss" :face 'doom-dashboard-menu-title) + :when (featurep! :app rss) + :face (:inherit (doom-dashboard-menu-title bold)) + :action =rss) + ("Read saved articles" + :icon (all-the-icons-octicon "book" :face 'doom-dashboard-menu-title) + :face (:inherit (doom-dashboard-menu-title bold)) + :action =wallabag))) +;; Restore previous session without confirmation +(defadvice! restore-no-confirm-session-quickload-a () + :override #'doom/quickload-session + (message "Restoring session...") + (doom-load-session) + (message "Session restored. Welcome back.")) ;; Decrease size of icons in the modeline (setq all-the-icons-scale-factor 1.0) ;; Increase size of the PlatformIO compilation buffer