nyxt: Color status bar in red when proxy is off.
parent
8915496615
commit
97fd5d5fe2
|
@ -137,7 +137,7 @@ Recognized formats:
|
||||||
:initial-value %slot-default))))
|
:initial-value %slot-default))))
|
||||||
|
|
||||||
(defmethod deserialize-eww-bookmarks (stream)
|
(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."
|
format."
|
||||||
(handler-case
|
(handler-case
|
||||||
(let ((*standard-input* stream))
|
(let ((*standard-input* stream))
|
||||||
|
@ -189,38 +189,70 @@ format."
|
||||||
"~/common-lisp"
|
"~/common-lisp"
|
||||||
"~/.local/share/emacs/site-lisp"))
|
"~/.local/share/emacs/site-lisp"))
|
||||||
|
|
||||||
(defun my-format-status (window)
|
(defvar my-status-style
|
||||||
(let* ((buffer (current-buffer window))
|
#.(cl-css:css
|
||||||
(buffer-count (1+ (or (position buffer
|
'((body
|
||||||
(sort (buffer-list)
|
:background "rgb(200, 0, 0)"
|
||||||
#'string<
|
:font-size "12px"
|
||||||
:key #'id))
|
:color "rgb(32, 32, 32)"
|
||||||
0))))
|
:padding 0
|
||||||
(str:concat
|
:line-height "16px"
|
||||||
(markup:markup
|
:margin 0)
|
||||||
(:b (format nil "[~{~a~^ ~}]"
|
("#modes"
|
||||||
(mapcar (lambda (m) (str:replace-all "-mode" ""
|
:border-right "2px solid rgb(120, 120, 120)"
|
||||||
(str:downcase
|
:display "inline-block"
|
||||||
(class-name (class-of m)))))
|
:padding "0 5px 0 5px"
|
||||||
(modes buffer)))))
|
:margin "0 5px 0 0")
|
||||||
(format nil " (~a/~a) "
|
(.status-menu
|
||||||
buffer-count
|
:padding-left "4px")
|
||||||
(length (buffer-list)))
|
(.button
|
||||||
(format nil "~a~a — ~a"
|
:background-color "rgb(160, 160, 160)"
|
||||||
(if (eq (slot-value buffer 'load-status) :loading)
|
:color "black"
|
||||||
"(Loading) "
|
:height "100%"
|
||||||
"")
|
:text-decoration "none"
|
||||||
(object-display (url buffer))
|
:border-radius "2px"
|
||||||
(title buffer)))))
|
:padding-left "2px"
|
||||||
|
:padding-right "2px"
|
||||||
|
:margin-left "2px"
|
||||||
|
:margin-right "2px")
|
||||||
|
(|.button:hover|
|
||||||
|
:color "white"))))
|
||||||
|
|
||||||
;; (define-configuration window
|
(defun my-format-status (window)
|
||||||
;; ((status-formatter #'my-format-status)))
|
(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)
|
(load-system :slynk)
|
||||||
(when (find-package :slynk)
|
(when (find-package :slynk)
|
||||||
(nyxt::load-lisp "/home/ambrevar/dotfiles/.config/nyxt/slynk.lisp"))
|
(nyxt::load-lisp "/home/ambrevar/dotfiles/.config/nyxt/slynk.lisp"))
|
||||||
|
|
||||||
|
|
||||||
(defvar +dev-data-profile+ (make-instance 'data-profile :name "dev")
|
(defvar +dev-data-profile+ (make-instance 'data-profile :name "dev")
|
||||||
"Development profile.")
|
"Development profile.")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue