nyxt: Color status bar in red when proxy is off.
parent
8915496615
commit
97fd5d5fe2
|
@ -137,7 +137,7 @@ Recognized formats:
|
|||
:initial-value %slot-default))))
|
||||
|
||||
(defmethod deserialize-eww-bookmarks (stream)
|
||||
"This version of deserialize-bookmarks is compatibly with Ambrevar's EWW
|
||||
"This version of deserialize-bookmarks is compatible with Ambrevar's EWW
|
||||
format."
|
||||
(handler-case
|
||||
(let ((*standard-input* stream))
|
||||
|
@ -189,38 +189,70 @@ format."
|
|||
"~/common-lisp"
|
||||
"~/.local/share/emacs/site-lisp"))
|
||||
|
||||
(defun my-format-status (window)
|
||||
(let* ((buffer (current-buffer window))
|
||||
(buffer-count (1+ (or (position buffer
|
||||
(sort (buffer-list)
|
||||
#'string<
|
||||
:key #'id))
|
||||
0))))
|
||||
(str:concat
|
||||
(markup:markup
|
||||
(:b (format nil "[~{~a~^ ~}]"
|
||||
(mapcar (lambda (m) (str:replace-all "-mode" ""
|
||||
(str:downcase
|
||||
(class-name (class-of m)))))
|
||||
(modes buffer)))))
|
||||
(format nil " (~a/~a) "
|
||||
buffer-count
|
||||
(length (buffer-list)))
|
||||
(format nil "~a~a — ~a"
|
||||
(if (eq (slot-value buffer 'load-status) :loading)
|
||||
"(Loading) "
|
||||
"")
|
||||
(object-display (url buffer))
|
||||
(title buffer)))))
|
||||
(defvar my-status-style
|
||||
#.(cl-css:css
|
||||
'((body
|
||||
:background "rgb(200, 0, 0)"
|
||||
:font-size "12px"
|
||||
:color "rgb(32, 32, 32)"
|
||||
:padding 0
|
||||
:line-height "16px"
|
||||
:margin 0)
|
||||
("#modes"
|
||||
:border-right "2px solid rgb(120, 120, 120)"
|
||||
:display "inline-block"
|
||||
:padding "0 5px 0 5px"
|
||||
:margin "0 5px 0 0")
|
||||
(.status-menu
|
||||
:padding-left "4px")
|
||||
(.button
|
||||
:background-color "rgb(160, 160, 160)"
|
||||
:color "black"
|
||||
:height "100%"
|
||||
:text-decoration "none"
|
||||
:border-radius "2px"
|
||||
:padding-left "2px"
|
||||
:padding-right "2px"
|
||||
:margin-left "2px"
|
||||
:margin-right "2px")
|
||||
(|.button:hover|
|
||||
:color "white"))))
|
||||
|
||||
;; (define-configuration window
|
||||
;; ((status-formatter #'my-format-status)))
|
||||
(defun my-format-status (window)
|
||||
(let ((buffer (current-buffer window)))
|
||||
(if (or (internal-buffer-p buffer)
|
||||
(find-submode buffer 'proxy-mode))
|
||||
(setf (style (status-buffer window))
|
||||
(getf (mopu:slot-properties 'status-buffer 'style) :initform))
|
||||
(setf (style (status-buffer window))
|
||||
my-status-style))
|
||||
(markup:markup
|
||||
(:div :id "modes"
|
||||
(:b
|
||||
(format nil "~{~a~^ ~}"
|
||||
(mapcar (lambda (m) (str:replace-all "-mode" "" (str:downcase (mode-name m))))
|
||||
(modes buffer)))))
|
||||
(:a :class "button" :title "Backwards" :href (nyxt::lisp-url '(nyxt/web-mode:history-backwards)) "←")
|
||||
(:a :class "button" :title "Forwards" :href (nyxt::lisp-url '(nyxt/web-mode:history-forwards)) "→")
|
||||
(:a :class "button" :title "Reload" :href (nyxt::lisp-url '(nyxt:reload-current-buffer)) "↺")
|
||||
(:a :class "button" :title "Execute" :href (nyxt::lisp-url '(nyxt:execute-command)) "⚙")
|
||||
(:a :class "button" :title "Buffers" :href (nyxt::lisp-url '(nyxt::list-buffers)) "≡")
|
||||
(:span (if (and (web-buffer-p buffer)
|
||||
(eq (slot-value buffer 'nyxt::load-status) :loading))
|
||||
"Loading: " ""))
|
||||
(:a :class "button"
|
||||
:href (nyxt::lisp-url '(nyxt:set-url-from-current-url))
|
||||
(format nil " ~a — ~a"
|
||||
(object-display (url buffer))
|
||||
(title buffer))))))
|
||||
|
||||
(define-configuration window
|
||||
((status-formatter #'my-format-status)))
|
||||
|
||||
(load-system :slynk)
|
||||
(when (find-package :slynk)
|
||||
(nyxt::load-lisp "/home/ambrevar/dotfiles/.config/nyxt/slynk.lisp"))
|
||||
|
||||
|
||||
(defvar +dev-data-profile+ (make-instance 'data-profile :name "dev")
|
||||
"Development profile.")
|
||||
|
||||
|
|
Loading…
Reference in New Issue