diff --git a/screens/dashboard.el b/screens/dashboard.el index dca4c8a..2b44df3 100644 --- a/screens/dashboard.el +++ b/screens/dashboard.el @@ -52,12 +52,11 @@ 'face 'font-lock-keyword-face)) (defvar enlight-calendar - (when (not (equal system-type 'android)) - (progn - (calendar) - (prog1 (with-current-buffer (buffer-name (current-buffer)) - (concat (buffer-string) "\n\n")) - (calendar-exit))))) + (progn + (calendar) + (prog1 (with-current-buffer (buffer-name (current-buffer)) + (buffer-string)) + (calendar-exit)))) (defun get-weather () "Get the weather JSON for THEURGY-CITY." @@ -87,6 +86,90 @@ (concat (propertize "Weather\n\n" 'face 'font-lock-keyword-face) "No connection to weather service :("))) +(defvar default-dash + `(:content ,(concat + enlight-calendar "\n\n" + (grid-make-row + (list (grid-make-box `(:content ,(concat + (enlight-menu + '(("Exobrain" + ("Agenda" (org-agenda nil "a") "a") + ("Go to Inbox" open-inbox "i") + ("Capture" org-capture "c"))))) + :align left + :width 20)) + (grid-make-box `(:content ,(concat + (enlight-menu + '(("Projects" + ("Switch To" theurgy-open-project "p") + ("Project List" theurgy-edit-projects-list "l"))))) + :align center + :width 20)) + (grid-make-box `(:content ,(concat + (enlight-menu + '(("Userland" + ("Dired" (dired "~") "d") + ("RSS" elfeed "r") + ("Terminal" theurgy-bottom-shell "t") + ("Gomuks" theurgy-gomuks-workspace "G") + ("Weather" theurgy-show-weather "w"))))) + :align center + :width 20)) + (grid-make-box `(:content ,(concat + (enlight-menu + '(("Meta" + ("Elisp Scratch" open-elisp-scratch "s") + ("Org Scratch" open-org-scratch "o") + ("Init Dir" (dired user-emacs-directory) "e") + ("Info" info "h"))))) + :align right + :width 20))))) + )) + +(defvar android-dash + `(:content ,(concat + (grid-make-row + (list (grid-make-column (grid-make-box `(:content ,(concat + (enlight-menu + '(("Exobrain" + ("Agenda" (org-agenda nil "a") "a") + ("Go to Inbox" open-inbox "i") + ("Capture" org-capture "c"))))) + :align center + :width 20)) + (grid-make-box `(:content ,(concat + (enlight-menu + '(("Projects" + ("Switch To" theurgy-open-project "p") + ("Project List" theurgy-edit-projects-list "l"))))) + :align center + :width 20))) + (grid-make-column (grid-make-box `(:content ,(concat + (enlight-menu + '(("Userland" + ("Dired" (dired "~") "d") + ("RSS" elfeed "r") + ("Terminal" theurgy-bottom-shell "t") + ("Gomuks" theurgy-gomuks-workspace "G") + ("Weather" theurgy-show-weather "w"))))) + :align center + :width 20)) + (grid-make-box `(:content ,(concat + (enlight-menu + '(("Meta" + ("Elisp Scratch" open-elisp-scratch "s") + ("Org Scratch" open-org-scratch "o") + ("Init Dir" (dired user-emacs-directory) "e") + ("Info" info "h"))))) + :align center + :width 20)))))) + )) + +(defvar dashboard-content + (cond + ((equal system-type 'android) android-dash) + (else default-dash))) + ;; Dashboard screen using enlight (use-package enlight :custom @@ -101,50 +184,7 @@ (grid-make-column (list (grid-make-box - `(:content ,(concat - enlight-calendar - (funcall (if (equal system-type 'android) - 'grid-make-column - 'grid-make-row) - (list (grid-make-box `(:content ,(concat - (enlight-menu - '(("Exobrain" - ("Agenda" (org-agenda nil "a") "a") - ("Go to Inbox" open-inbox "i") - ("Capture" org-capture "c"))))) - :align ,(if (equal system-type 'android) - 'center - 'left) - :width 20)) - (grid-make-box `(:content ,(concat - (enlight-menu - '(("Projects" - ("Switch To" theurgy-open-project "p") - ("Project List" theurgy-edit-projects-list "l"))))) - :align center - :width 20)) - (grid-make-box `(:content ,(concat - (enlight-menu - '(("Userland" - ("Dired" (dired "~") "d") - ("RSS" elfeed "r") - ("Terminal" theurgy-bottom-shell "t") - ("Gomuks" theurgy-gomuks-workspace "G") - ("Weather" theurgy-show-weather "w"))))) - :align center - :width 20)) - (grid-make-box `(:content ,(concat - (enlight-menu - '(("Meta" - ("Elisp Scratch" open-elisp-scratch "s") - ("Org Scratch" open-org-scratch "o") - ("Init Dir" (dired user-emacs-directory) "e") - ("Info" info "h"))))) - :align ,(if (equal system-type 'android) - 'center - 'right) - :width 20))))) - )) + dashboard-content) )) ;(grid-make-box `(:content ,(enlight-weather) :align center)) )))