mirror of
https://github.com/correl/doom-modeline.git
synced 2024-11-23 19:19:50 +00:00
Improve grip indicator.
This commit is contained in:
parent
2c01d9eb9e
commit
c4a77d12c3
1 changed files with 30 additions and 20 deletions
|
@ -66,6 +66,7 @@
|
||||||
(defvar flymake--mode-line-format)
|
(defvar flymake--mode-line-format)
|
||||||
(defvar flymake-menu)
|
(defvar flymake-menu)
|
||||||
(defvar grip-port)
|
(defvar grip-port)
|
||||||
|
(defvar grip-process)
|
||||||
(defvar helm--mode-line-display-prefarg)
|
(defvar helm--mode-line-display-prefarg)
|
||||||
(defvar iedit-occurrences-overlays)
|
(defvar iedit-occurrences-overlays)
|
||||||
(defvar mc/mode-line)
|
(defvar mc/mode-line)
|
||||||
|
@ -2301,15 +2302,23 @@ The cdr can also be a function that returns a name to use.")
|
||||||
(when (bound-and-true-p grip-mode)
|
(when (bound-and-true-p grip-mode)
|
||||||
(concat
|
(concat
|
||||||
(doom-modeline-spc)
|
(doom-modeline-spc)
|
||||||
|
|
||||||
|
(let ((face (if (doom-modeline--active)
|
||||||
|
(if grip-process
|
||||||
|
(pcase (process-status grip-process)
|
||||||
|
('run 'all-the-icons-lblue)
|
||||||
|
('exit 'warning)
|
||||||
|
(_ 'error))
|
||||||
|
'error)
|
||||||
|
'mode-line-inactive)))
|
||||||
(propertize
|
(propertize
|
||||||
(if (display-graphic-p)
|
(if doom-modeline-icon
|
||||||
(doom-modeline-icon-material "pageview"
|
(doom-modeline-icon-material
|
||||||
:face (if (doom-modeline--active)
|
"pageview"
|
||||||
'all-the-icons-lblue
|
:face face
|
||||||
'mode-line-inactive)
|
:height 1.2
|
||||||
:height 1.1
|
:v-adjust -0.2)
|
||||||
:v-adjust -0.225)
|
(propertize "G" 'face `(:inherit (,face bold))))
|
||||||
"G")
|
|
||||||
'help-echo (format "Preview on: http://localhost:%d
|
'help-echo (format "Preview on: http://localhost:%d
|
||||||
mouse-1: Open browser
|
mouse-1: Open browser
|
||||||
mouse-2: Stop preview"
|
mouse-2: Stop preview"
|
||||||
|
@ -2322,7 +2331,8 @@ mouse-2: Stop preview"
|
||||||
(browse-url (format "http://localhost:%d" grip-port))))
|
(browse-url (format "http://localhost:%d" grip-port))))
|
||||||
(define-key map [mode-line mouse-2]
|
(define-key map [mode-line mouse-2]
|
||||||
#'grip-mode)
|
#'grip-mode)
|
||||||
map))
|
map)))
|
||||||
|
|
||||||
(doom-modeline-spc))))
|
(doom-modeline-spc))))
|
||||||
|
|
||||||
(provide 'doom-modeline-segments)
|
(provide 'doom-modeline-segments)
|
||||||
|
|
Loading…
Reference in a new issue