More android compat

This commit is contained in:
BirDt_ 2025-09-27 10:04:41 +08:00
parent 0bc99bdb7e
commit 5a940ad8c6

View file

@ -52,11 +52,12 @@
'face 'font-lock-keyword-face)) 'face 'font-lock-keyword-face))
(defvar enlight-calendar (defvar enlight-calendar
(progn (when (not (equal system-type 'android))
(calendar) (progn
(prog1 (with-current-buffer (buffer-name (current-buffer)) (calendar)
(buffer-string)) (prog1 (with-current-buffer (buffer-name (current-buffer))
(calendar-exit)))) (concat (buffer-string) "\n\n"))
(calendar-exit)))))
(defun get-weather () (defun get-weather ()
"Get the weather JSON for THEURGY-CITY." "Get the weather JSON for THEURGY-CITY."
@ -101,7 +102,7 @@
(list (list
(grid-make-box (grid-make-box
`(:content ,(concat `(:content ,(concat
enlight-calendar "\n\n" enlight-calendar
(funcall (if (equal system-type 'android) (funcall (if (equal system-type 'android)
'grid-make-column 'grid-make-column
'grid-make-row) 'grid-make-row)
@ -111,9 +112,9 @@
("Agenda" (org-agenda nil "a") "a") ("Agenda" (org-agenda nil "a") "a")
("Go to Inbox" open-inbox "i") ("Go to Inbox" open-inbox "i")
("Capture" org-capture "c"))))) ("Capture" org-capture "c")))))
:align (if (equal system-type 'android) :align ,(if (equal system-type 'android)
'center 'center
'left) 'left)
:width 20)) :width 20))
(grid-make-box `(:content ,(concat (grid-make-box `(:content ,(concat
(enlight-menu (enlight-menu
@ -139,9 +140,9 @@
("Org Scratch" open-org-scratch "o") ("Org Scratch" open-org-scratch "o")
("Init Dir" (dired user-emacs-directory) "e") ("Init Dir" (dired user-emacs-directory) "e")
("Info" info "h"))))) ("Info" info "h")))))
:align (if (equal system-type 'android) :align ,(if (equal system-type 'android)
'center 'center
'right) 'right)
:width 20))))) :width 20)))))
)) ))
)) ))