dashboard.lisp 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. (in-package #:nyxt-user)
  2. (defun custom-dashboard ()
  3. ""
  4. )
  5. (define-configuration browser
  6. ((startup-function (make-startup-function :buffer-fn #'custom-dashboard))))
  7. (defun format-status (window)
  8. "Final status function that control the entire bar"
  9. (let*
  10. (
  11. (buffer (current-buffer window))
  12. (vi-class (cond ; Find vi mode mode
  13. ((find-submode buffer 'vi-normal-mode) "command")
  14. ((find-submode buffer 'vi-insert-mode) "insert")))
  15. )
  16. (spinneret:with-html-string
  17. (:div :id (if vi-class "container-vi" "container")
  18. (:td
  19. (:tr
  20. (:div :id "tabs"
  21. (:raw (format-status-tabs))))
  22. (:tr
  23. (:div :id "url" :class "rounded"
  24. (:raw (format-status-load-status buffer) (format-status-url buffer)))) ; <load status> <current url>
  25. (:tr
  26. (:div :id "buttons" :class "rounded-right" ; Try to make status bar sections rounded
  27. (:raw (format-status-buttons)))
  28. (when vi-class
  29. (:div :id "vi-mode" :class "rounded-right"
  30. (:raw (format-status-vi-mode buffer)))) ; <current vi mode>
  31. (:div :id "modes" :class "rounded-left"
  32. ; :title (list-modes buffer) ; why does this have this?
  33. (:raw (format-status-modes buffer window)))))))))