feat(*): try to switch to the light side

This commit is contained in:
Pavel Korytov 2023-08-12 22:20:36 +03:00
parent 6e08631c9b
commit ead93cfcb6
15 changed files with 252 additions and 195 deletions

View file

@ -1,4 +1,4 @@
# [[file:../../Console.org::*Alacritty][Alacritty:3]]
# [[file:../../Console.org::*Alacritty][Alacritty:4]]
decorations: none
font:
@ -13,25 +13,25 @@ env:
colors:
primary:
background: '#292D3E'
foreground: '#EEFFFF'
background: '#fff8f0'
foreground: '#222222'
normal:
black: '#292D3E'
red: '#f07178'
green: '#c3e88d'
yellow: '#ffcb6b'
blue: '#82aaff'
magenta: '#c792ea'
cyan: '#89DDFF'
white: '#EEFFFF'
black: '#222222'
red: '#cc3333'
green: '#217a3c'
yellow: '#8a5d00'
blue: '#375cd8'
magenta: '#ba35af'
cyan: '#1f6fbf'
white: '#fff8f0'
bright:
Black: '#373c53'
Red: '#f39196'
Green: '#d2edaa'
Yellow: '#ffd78e'
Blue: '#a5c2fe'
Magenta: '#d6afef'
Cyan: '#ace7ff'
Black: '#484848'
Red: '#ff8f88'
Green: '#8adf80'
Yellow: '#fac200'
Blue: '#cbcfff'
Magenta: '#df8fff'
Cyan: '#88c8ff'
White: '#ffffff'
window:
@ -39,7 +39,7 @@ window:
x: 0
y: 0
dynamic_padding: true
opacity: 0.80
opacity: 1
key_bindings:
- { key: Paste, action: Paste }
@ -66,4 +66,4 @@ key_bindings:
- { key: NumpadAdd, mods: Control, action: IncreaseFontSize }
- { key: Minus, mods: Control, action: DecreaseFontSize }
- { key: NumpadSubtract, mods: Control, action: DecreaseFontSize }
# Alacritty:3 ends here
# Alacritty:4 ends here

View file

@ -11,7 +11,7 @@
padding = 8
horizontal_padding = 8
frame_width = 1
frame_color = "#A6Accd"
frame_color = "#baafba"
separator_color = frame
sort = yes
idle_threshold = 120
@ -79,20 +79,20 @@
context = ctrl+shift+period
[urgency_low]
background = "#222634"
frame_color = "#A6Accd"
foreground = "#EEFFFF"
background = "#f6ece8"
frame_color = "#baafba"
foreground = "#222222"
timeout = 10
[urgency_normal]
background = "#292D3E"
frame_color = "#A6Accd"
foreground = "#EEFFFF"
background = "#fff8f0"
frame_color = "#baafba"
foreground = "#222222"
timeout = 10
[urgency_critical]
background = "#f07178"
foreground = "#EEFFFF"
frame_color = "#f07178"
background = "#cc3333"
foreground = "#fff8f0"
frame_color = "#cc3333"
timeout = 0
# dunst:1 ends here

View file

@ -1,22 +1,22 @@
; [[file:../../Desktop.org::*Colors][Colors:2]]
[colors]
black = #292D3E
light-black = #383c4e
red = #f18388
light-red = #ff959a
green = #c3e88d
light-green = #d6fc9f
yellow = #ffcb6b
light-yellow = #ffde7d
blue = #82aaff
light-blue = #96bcff
magenta = #c792ea
light-magenta = #daa4fe
cyan = #89DDFF
light-cyan = #9df0ff
white = #EEFFFF
light-white = #f1ffff
background = #292D3E
black = #222222
light-black = #303030
red = #e28b8b
light-red = #f69d9d
green = #31ba54
light-green = #4acd65
yellow = #e49300
light-yellow = #faa522
blue = #8f9fe3
light-blue = #a2b1f7
magenta = #db81cf
light-magenta = #ef93e2
cyan = #66a7e4
light-cyan = #7ab9f8
white = #fff8f0
light-white = #fffef6
background = #c7c0ba
foreground = #000000
; Colors:2 ends here

View file

@ -1,46 +1,46 @@
/* Generated from [[file:../../Desktop.org::*Theme][Theme:1]] */
* {
black: #292D3E;
red: #f07178;
green: #c3e88d;
yellow: #ffcb6b;
blue: #82aaff;
magenta: #c792ea;
cyan: #89DDFF;
white: #EEFFFF;
light-black: #373c53;
light-red: #f39196;
light-green: #d2edaa;
light-yellow: #ffd78e;
light-blue: #a5c2fe;
light-magenta: #d6afef;
light-cyan: #ace7ff;
black: #222222;
red: #cc3333;
green: #217a3c;
yellow: #8a5d00;
blue: #375cd8;
magenta: #ba35af;
cyan: #1f6fbf;
white: #fff8f0;
light-black: #484848;
light-red: #ff8f88;
light-green: #8adf80;
light-yellow: #fac200;
light-blue: #cbcfff;
light-magenta: #df8fff;
light-cyan: #88c8ff;
light-white: #ffffff;
foreground: #EEFFFF;
background: #292D3E;
background-color: #292D3E;
foreground: #222222;
background: #fff8f0;
background-color: #fff8f0;
separatorcolor: @blue;
border-color: #A6Accd;
selected-normal-background: #82aaff;
selected-normal-foreground: #292D3E;
selected-active-background: #a5c2fe;
selected-active-foreground: #292D3E;
selected-urgent-background: #f07178;
selected-urgent-foreground: #EEFFFF;
border-color: #baafba;
selected-normal-background: #375cd8;
selected-normal-foreground: #fff8f0;
selected-active-background: #cbcfff;
selected-active-foreground: #222222;
selected-urgent-background: #cc3333;
selected-urgent-foreground: #fff8f0;
normal-foreground: @foreground;
normal-background: @background;
active-foreground: @blue;
active-background: @background;
urgent-foreground: @red;
urgent-background: @background;
alternate-normal-background: #242837;
alternate-normal-background: #f6ece8;
alternate-normal-foreground: @foreground;
alternate-active-background: #292D3E;
alternate-active-foreground: #a5c2fe;
alternate-urgent-background: #EEFFFF;
alternate-urgent-foreground: #f07178;
alternate-active-background: #222222;
alternate-active-foreground: #cbcfff;
alternate-urgent-background: #fff8f0;
alternate-urgent-foreground: #cc3333;
spacing: 2;
}
window {

View file

@ -2,26 +2,26 @@
set abort-clear-search false
set guioptions cs
set selection-clipboard clipboard
set recolor true
set recolor false
map <C-r> set recolor false
map <C-R> set recolor true
set recolor-lightcolor "#292D3E"
set recolor-lightcolor "#222222"
set completion-bg "#292D3E"
set completion-fg "#EEFFFF"
set completion-group-bg "#292D3E"
set completion-group-fg "#EEFFFF"
set completion-highlight-bg "#c792ea"
set completion-highlight-fg "#292D3E"
set completion-bg "#fff8f0"
set completion-fg "#222222"
set completion-group-bg "#fff8f0"
set completion-group-fg "#222222"
set completion-highlight-bg "#ba35af"
set completion-highlight-fg "#fff8f0"
set inputbar-bg "#373c53"
set inputbar-fg "#EEFFFF"
set statusbar-bg "#373c53"
set statusbar-fg "#EEFFFF"
set inputbar-bg "#484848"
set inputbar-fg "#fff8f0"
set statusbar-bg "#484848"
set statusbar-fg "#fff8f0"
set notification-error-bg "#f07178"
set notification-error-fg "#EEFFFF"
set notification-warning-bg "#ffcb6b"
set notification-warning-fg "#292D3E"
set notification-error-bg "#cc3333"
set notification-error-fg "#fff8f0"
set notification-warning-bg "#8a5d00"
set notification-warning-fg "#fff8f0"
# Zathura:2 ends here

View file

@ -865,9 +865,9 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
:config
(setq doom-themes-enable-bold t
doom-themes-enable-italic t)
(if my/remote-server
(load-theme 'doom-gruvbox t)
(load-theme 'doom-palenight t))
;; (if my/remote-server
;; (load-theme 'doom-gruvbox t)
;; (load-theme 'doom-palenight t))
(doom-themes-visual-bell-config)
(setq doom-themes-treemacs-theme "doom-colors")
(doom-themes-treemacs-config))
@ -875,6 +875,9 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
(use-package modus-themes
:straight t)
(use-package ef-themes
:straight t)
(use-package ct
:straight t)
@ -886,6 +889,10 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
(seq-find (lambda (x) (string-match-p (rx bos "modus") (symbol-name x)))
custom-enabled-themes))
(defun my/ef-p ()
(seq-find (lambda (x) (string-match-p (rx bos "ef") (symbol-name x)))
custom-enabled-themes))
(defun my/light-p ()
(ct-light-p (my/color-value 'bg)))
@ -922,9 +929,8 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
(base-end (cadr (assoc 'fg-dim (modus-themes--current-theme-palette)))))
(nth base-value (ct-gradient 9 base-start base-end t))))
(defun my/modus-color (color)
(let* ((palette (modus-themes--current-theme-palette))
(is-light (ct-light-p (cadr (assoc 'bg-main palette)))))
(defun my/prot-color (color palette)
(let ((is-light (ct-light-p (cadr (assoc 'bg-main palette)))))
(cond
((member color '(black white light-black light-white))
(let ((bg-main (cadr (assoc 'bg-main palette)))
@ -954,9 +960,17 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
((eq color 'grey)
(my/modus-get-base 'base5))
((string-match-p (rx bos "light-") (symbol-name color))
(cadr (assoc (intern (format "%s-intense" (substring (symbol-name color) 6))) palette)))
(or
(cadr (assoc (intern (format "%s-intense" (substring (symbol-name color) 6))) palette))
(cadr (assoc (intern (format "bg-%s-intense" (substring (symbol-name color) 6))) palette))))
(t (cadr (assoc color palette))))))
(defun my/modus-color (color)
(my/prot-color color (modus-themes--current-theme-palette)))
(defun my/ef-color (color)
(my/prot-color color (ef-themes--current-theme-palette)))
(defconst my/test-colors-list
'(black red green yellow blue magenta cyan white light-black
light-red light-green light-yellow light-blue light-magenta
@ -967,13 +981,14 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
(interactive)
(let ((buf (generate-new-buffer "*colors-test*")))
(with-current-buffer buf
(insert (format "%-20s %-10s %-10s" "Color" "Doom" "Modus") "\n")
(insert (format "%-20s %-10s %-10s %-10s" "Color" "Doom" "Modus" "Ef") "\n")
(cl-loop for color in my/test-colors-list
do (insert
(format "%-20s %-10s %-10s\n"
(format "%-20s %-10s %-10s %-10s\n"
(prin1-to-string color)
(my/doom-color color)
(my/modus-color color))))
(my/modus-color color)
(my/ef-color color))))
(special-mode)
(rainbow-mode))
(switch-to-buffer buf)))
@ -982,12 +997,14 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
(cond
((stringp color) (my/color-value (intern color)))
((eq color 'bg-other)
(or (my/color-value 'bg-dim)
(let ((color (my/color-value 'bg)))
(if (ct-light-p color)
(ct-edit-hsl-l-dec color 3)
(ct-edit-hsl-l-dec color 3))))
(ct-edit-hsl-l-dec color 2)
(ct-edit-hsl-l-dec color 3)))))
((my/doom-p) (my/doom-color color))
((my/modus-p) (my/modus-color color))))
((my/modus-p) (my/modus-color color))
((my/ef-p) (my/ef-color color))))
(deftheme my-theme-1)
@ -1035,6 +1052,8 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
(when current-prefix-arg
(my/regenerate-desktop)))
(my/switch-theme 'ef-duo-light)
(use-package auto-dim-other-buffers
:straight t
:if (display-graphic-p)

5
.megaCmd/excluded Normal file
View file

@ -0,0 +1,5 @@
.
..
Thumbs.db
desktop.ini
~*

View file

@ -1,23 +1,20 @@
# [[file:Console.org::*UI][UI:1]]
# This tmux statusbar config was created by tmuxline.vim
# on Wed, 22 Jan 2020
set -g status-justify "centre"
set -g status "on"
set -g status-left-style "none"
set -g message-command-style "fg=#bfc7d5,bg=#474b59"
set -g message-command-style "fg=#222222,bg=#f6ece8"
set -g status-right-style "none"
set -g pane-active-border-style "fg=#939ede"
set -g status-style "none,bg=#333747"
set -g message-style "fg=#bfc7d5,bg=#474b59"
set -g pane-border-style "fg=#474b59"
set -g pane-active-border-style "fg=#375cd8"
set -g status-style "none,bg=#f6ece8"
set -g message-style "fg=#222222,bg=#f6ece8"
set -g pane-border-style "fg=#375cd8"
set -g status-right-length "100"
set -g status-left-length "100"
setw -g window-status-activity-style "none,fg=#939ede,bg=#333747"
setw -g window-status-activity-style "none,fg=#375cd8,bg=#f6ece8"
setw -g window-status-separator ""
setw -g window-status-style "none,fg=#bfc7d5,bg=#333747"
set -g status-left "#[fg=#292D3E,bg=#939ede] #S #[fg=#939ede,bg=#474b59,nobold,nounderscore,noitalics]#[fg=#bfc7d5,bg=#474b59] #W #[fg=#474b59,bg=#333747,nobold,nounderscore,noitalics]"
set -g status-right "#[fg=#333747,bg=#333747,nobold,nounderscore,noitalics]#[fg=#bfc7d5,bg=#333747] %-H:%M #[fg=#474b59,bg=#333747,nobold,nounderscore,noitalics]#[fg=#bfc7d5,bg=#474b59] %a, %b %d #[fg=#939ede,bg=#474b59,nobold,nounderscore,noitalics]#[fg=#292D3E,bg=#939ede] #H "
setw -g window-status-format "#[fg=#333747,bg=#333747,nobold,nounderscore,noitalics]#[default] #I #W #[align=left] #[fg=#333747,bg=#333747,nobold,nounderscore,noitalics]"
setw -g window-status-current-format "#[fg=#333747,bg=#474b59,nobold,nounderscore,noitalics]#[fg=#bfc7d5,bg=#474b59] #I #W #[fg=#474b59,bg=#333747,nobold,nounderscore,noitalics]"
setw -g window-status-style "none,fg=#222222,bg=#f6ece8"
set -g status-left "#[fg=#fff8f0,bg=#375cd8] #S #[fg=#375cd8,bg=#cbcfff,nobold,nounderscore,noitalics]#[fg=#222222,bg=#cbcfff] #W #[fg=#cbcfff,bg=#f6ece8,nobold,nounderscore,noitalics]"
set -g status-right "%-H:%M #[bg=#f6ece8,fg=#cbcfff,nobold,nounderscore,noitalics]#[fg=#222222,bg=#cbcfff] %a, %b %d #[bg=#cbcfff,fg=#375cd8,nobold,nounderscore,noitalics]#[fg=#fff8f0,bg=#375cd8] #H "
setw -g window-status-format "#[fg=#f6ece8,bg=#cbcfff,nobold,nounderscore,noitalics]#[fg=#222222,bg=#cbcfff] #I #W #[align=left] #[fg=#cbcfff,bg=#f6ece8,nobold,nounderscore,noitalics]"
setw -g window-status-current-format "#[fg=#f6ece8,bg=#375cd8,nobold,nounderscore,noitalics]#[fg=#fff8f0,bg=#375cd8] #I #W #[fg=#375cd8,bg=#f6ece8,nobold,nounderscore,noitalics]"
# UI:1 ends here

View file

@ -710,29 +710,29 @@ bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "xc
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "xclip -selection clipboard -i"
#+end_src
** UI
I generated the following with [[https://github.com/edkolev/tmuxline.vim][tmuxline.vim]] plugin and palenight theme for [[https://github.com/vim-airline/vim-airline][vim-airline]]
#+begin_src conf-space :tangle ./.tmux.line.conf
# This tmux statusbar config was created by tmuxline.vim
# on Wed, 22 Jan 2020
On [2020-01-22 Wed], I had generated the first version of this following with [[https://github.com/edkolev/tmuxline.vim][tmuxline.vim]] plugin and palenight theme for [[https://github.com/vim-airline/vim-airline][vim-airline]].
Then I adapted it to use the current Emacs theme.
#+begin_src conf-space :tangle ./.tmux.line.conf :noweb yes
set -g status-justify "centre"
set -g status "on"
set -g status-left-style "none"
set -g message-command-style "fg=#bfc7d5,bg=#474b59"
set -g message-command-style "fg=<<get-color(name="fg")>>,bg=<<get-color(name="bg-other")>>"
set -g status-right-style "none"
set -g pane-active-border-style "fg=#939ede"
set -g status-style "none,bg=#333747"
set -g message-style "fg=#bfc7d5,bg=#474b59"
set -g pane-border-style "fg=#474b59"
set -g pane-active-border-style "fg=<<get-color(name="blue")>>"
set -g status-style "none,bg=<<get-color(name="bg-other")>>"
set -g message-style "fg=<<get-color(name="fg")>>,bg=<<get-color(name="bg-other")>>"
set -g pane-border-style "fg=<<get-color(name="blue")>>"
set -g status-right-length "100"
set -g status-left-length "100"
setw -g window-status-activity-style "none,fg=#939ede,bg=#333747"
setw -g window-status-activity-style "none,fg=<<get-color(name="blue")>>,bg=<<get-color(name="bg-other")>>"
setw -g window-status-separator ""
setw -g window-status-style "none,fg=#bfc7d5,bg=#333747"
set -g status-left "#[fg=#292D3E,bg=#939ede] #S #[fg=#939ede,bg=#474b59,nobold,nounderscore,noitalics]#[fg=#bfc7d5,bg=#474b59] #W #[fg=#474b59,bg=#333747,nobold,nounderscore,noitalics]"
set -g status-right "#[fg=#333747,bg=#333747,nobold,nounderscore,noitalics]#[fg=#bfc7d5,bg=#333747] %-H:%M #[fg=#474b59,bg=#333747,nobold,nounderscore,noitalics]#[fg=#bfc7d5,bg=#474b59] %a, %b %d #[fg=#939ede,bg=#474b59,nobold,nounderscore,noitalics]#[fg=#292D3E,bg=#939ede] #H "
setw -g window-status-format "#[fg=#333747,bg=#333747,nobold,nounderscore,noitalics]#[default] #I #W #[align=left] #[fg=#333747,bg=#333747,nobold,nounderscore,noitalics]"
setw -g window-status-current-format "#[fg=#333747,bg=#474b59,nobold,nounderscore,noitalics]#[fg=#bfc7d5,bg=#474b59] #I #W #[fg=#474b59,bg=#333747,nobold,nounderscore,noitalics]"
setw -g window-status-style "none,fg=<<get-color(name="fg")>>,bg=<<get-color(name="bg-other")>>"
set -g status-left "#[fg=<<get-fg-for-color(name="blue")>>,bg=<<get-color(name="blue")>>] #S #[fg=<<get-color(name="blue")>>,bg=<<get-color(name="light-blue")>>,nobold,nounderscore,noitalics]#[fg=<<get-fg-for-color(name="light-blue")>>,bg=<<get-color(name="light-blue")>>] #W #[fg=<<get-color(name="light-blue")>>,bg=<<get-color(name="bg-other")>>,nobold,nounderscore,noitalics]"
set -g status-right "%-H:%M #[bg=<<get-color(name="bg-other")>>,fg=<<get-color(name="light-blue")>>,nobold,nounderscore,noitalics]#[fg=<<get-fg-for-color(name="light-blue")>>,bg=<<get-color(name="light-blue")>>] %a, %b %d #[bg=<<get-color(name="light-blue")>>,fg=<<get-color(name="blue")>>,nobold,nounderscore,noitalics]#[fg=<<get-fg-for-color(name="blue")>>,bg=<<get-color(name="blue")>>] #H "
setw -g window-status-format "#[fg=<<get-color(name="bg-other")>>,bg=<<get-color(name="light-blue")>>,nobold,nounderscore,noitalics]#[fg=<<get-fg-for-color(name="light-blue")>>,bg=<<get-color(name="light-blue")>>] #I #W #[align=left] #[fg=<<get-color(name="light-blue")>>,bg=<<get-color(name="bg-other")>>,nobold,nounderscore,noitalics]"
setw -g window-status-current-format "#[fg=<<get-color(name="bg-other")>>,bg=<<get-color(name="blue")>>,nobold,nounderscore,noitalics]#[fg=<<get-fg-for-color(name="blue")>>,bg=<<get-color(name="blue")>>] #I #W #[fg=<<get-color(name="blue")>>,bg=<<get-color(name="bg-other")>>,nobold,nounderscore,noitalics]"
#+end_src
Source the line config:
@ -760,6 +760,16 @@ The application doesn't support XResources, so here goes noweb.
color))
#+end_src
#+NAME: get-fg-for-color
#+begin_src emacs-lisp :var name="black" quote=0 :tangle no
(let ((val (if (ct-light-p (my/color-value name))
(my/color-value 'black)
(my/color-value 'white))))
(if (eq quote 1)
(concat "\"" val "\"")
val))
#+end_src
#+begin_src emacs-lisp :tangle no
(setq-local org-confirm-babel-evaluate nil)
#+end_src
@ -808,7 +818,7 @@ window:
x: 0
y: 0
dynamic_padding: true
opacity: 0.80
opacity: 1
key_bindings:
- { key: Paste, action: Paste }

View file

@ -3436,6 +3436,7 @@ Which I then can use to create the URL.
(my/color-value-rgb
(or
(my/color-value 'bg-mode-line-active)
(my/color-value 'bg-mode-line)
(if (my/light-p)
(ct-edit-hsl-l-dec (my/color-value 'bg-alt) 10)
(ct-edit-hsl-l-inc (my/color-value 'bg-alt) 15)))))
@ -3468,7 +3469,7 @@ Which I then can use to create the URL.
#+end_src
#+RESULTS:
: https://color.firefox.com/?theme=XQAAAAJrAQAAAAAAAABAqYhm849SCia3ftKEGccwS-xMDPsqcRvzbzAAd4k2kmKXySkP4TMALpTiAcE8Rgs7Uh-5qAVfhLcwaZT2bTD-29a13URGpYcmL606LIDWim8VmsoOSfdgHHz_mXYNmDrybfpFjF8MrhAxhCR9CUaEeVVThQwXiNyFKB47dmsAcqhUUHP9tqgY6YXG2A5n1PqZq7QowpQn__84yaYA
: https://color.firefox.com/?theme=XQAAAAJFAQAAAAAAAABAqYhm849SCia3ftKEGccwS-xMDPsquqWmWrYLGyvA453nlgdoRTTSje3LA7vfcBuCeiFpttFMurVWViuvuhtBMugWmSsvzgyPVKtRGycIN1zWryrJ9mbJv5mYo-xR8V8hbMdvgfLyrp7SHnedMUPeouponHkloIv8tsVzxCwih5WlhbK_FebmNVUdxiV3yclhLVDXmZtn06QuboIcvf_BITkA
* keynav
| Guix dependency |

View file

@ -1453,9 +1453,9 @@ My colorschemes of choice.
:config
(setq doom-themes-enable-bold t
doom-themes-enable-italic t)
(if my/remote-server
(load-theme 'doom-gruvbox t)
(load-theme 'doom-palenight t))
;; (if my/remote-server
;; (load-theme 'doom-gruvbox t)
;; (load-theme 'doom-palenight t))
(doom-themes-visual-bell-config)
(setq doom-themes-treemacs-theme "doom-colors")
(doom-themes-treemacs-config))
@ -1465,6 +1465,12 @@ My colorschemes of choice.
(use-package modus-themes
:straight t)
#+end_src
Let's see...
#+begin_src emacs-lisp
(use-package ef-themes
:straight t)
#+end_src
*** Custom theme
Here I define a few things on the top of Emacs theme, because:
- Occasionally I want to have more theme-derived faces
@ -1488,6 +1494,10 @@ As of now I want this to support =doom-themes= and =modus-themes=. So, let's get
(defun my/modus-p ()
(seq-find (lambda (x) (string-match-p (rx bos "modus") (symbol-name x)))
custom-enabled-themes))
(defun my/ef-p ()
(seq-find (lambda (x) (string-match-p (rx bos "ef") (symbol-name x)))
custom-enabled-themes))
#+end_src
I also want to know if the current theme is light or not:
@ -1510,6 +1520,7 @@ Now, let's get the current color from =doom=. =doom-themes= provide =doom-color=
(defvar my/alpha-for-light 7)
(defun my/doom-color (color)
(when (doom-color 'bg)
(let ((override (alist-get (my/doom-p) my/theme-override))
(color-name (symbol-name color))
(is-light (ct-light-p (doom-color 'bg))))
@ -1525,7 +1536,7 @@ Now, let's get the current color from =doom=. =doom-themes= provide =doom-color=
((string-match-p (rx bos "light-") color-name)
(ct-edit-hsl-l-inc (my/doom-color (intern (substring color-name 6)))
my/alpha-for-light))
(t (doom-color color))))))
(t (doom-color color)))))))
#+end_src
And the same for =modus-themes=. =my/modus-color= has to accept the same arguments as I use for =my/doom-color= for backward compatibility, which requires a bit more tuning.
@ -1536,9 +1547,8 @@ And the same for =modus-themes=. =my/modus-color= has to accept the same argumen
(base-end (cadr (assoc 'fg-dim (modus-themes--current-theme-palette)))))
(nth base-value (ct-gradient 9 base-start base-end t))))
(defun my/modus-color (color)
(let* ((palette (modus-themes--current-theme-palette))
(is-light (ct-light-p (cadr (assoc 'bg-main palette)))))
(defun my/prot-color (color palette)
(let ((is-light (ct-light-p (cadr (assoc 'bg-main palette)))))
(cond
((member color '(black white light-black light-white))
(let ((bg-main (cadr (assoc 'bg-main palette)))
@ -1568,11 +1578,19 @@ And the same for =modus-themes=. =my/modus-color= has to accept the same argumen
((eq color 'grey)
(my/modus-get-base 'base5))
((string-match-p (rx bos "light-") (symbol-name color))
(cadr (assoc (intern (format "%s-intense" (substring (symbol-name color) 6))) palette)))
(or
(cadr (assoc (intern (format "%s-intense" (substring (symbol-name color) 6))) palette))
(cadr (assoc (intern (format "bg-%s-intense" (substring (symbol-name color) 6))) palette))))
(t (cadr (assoc color palette))))))
(defun my/modus-color (color)
(my/prot-color color (modus-themes--current-theme-palette)))
(defun my/ef-color (color)
(my/prot-color color (ef-themes--current-theme-palette)))
#+end_src
Test the two functions.
Test the three functions.
#+begin_src emacs-lisp
(defconst my/test-colors-list
'(black red green yellow blue magenta cyan white light-black
@ -1584,13 +1602,14 @@ Test the two functions.
(interactive)
(let ((buf (generate-new-buffer "*colors-test*")))
(with-current-buffer buf
(insert (format "%-20s %-10s %-10s" "Color" "Doom" "Modus") "\n")
(insert (format "%-20s %-10s %-10s %-10s" "Color" "Doom" "Modus" "Ef") "\n")
(cl-loop for color in my/test-colors-list
do (insert
(format "%-20s %-10s %-10s\n"
(format "%-20s %-10s %-10s %-10s\n"
(prin1-to-string color)
(my/doom-color color)
(my/modus-color color))))
(my/modus-color color)
(my/ef-color color))))
(special-mode)
(rainbow-mode))
(switch-to-buffer buf)))
@ -1602,12 +1621,14 @@ Finally, one function to get the value of a color in the current theme.
(cond
((stringp color) (my/color-value (intern color)))
((eq color 'bg-other)
(or (my/color-value 'bg-dim)
(let ((color (my/color-value 'bg)))
(if (ct-light-p color)
(ct-edit-hsl-l-dec color 3)
(ct-edit-hsl-l-dec color 3))))
(ct-edit-hsl-l-dec color 2)
(ct-edit-hsl-l-dec color 3)))))
((my/doom-p) (my/doom-color color))
((my/modus-p) (my/modus-color color))))
((my/modus-p) (my/modus-color color))
((my/ef-p) (my/ef-color color))))
#+end_src
And a few more functions
@ -1673,6 +1694,10 @@ The built-in =load-theme= does not deactivate the previous theme, so here's a fu
(when current-prefix-arg
(my/regenerate-desktop)))
#+end_src
#+begin_src emacs-lisp
(my/switch-theme 'ef-duo-light)
#+end_src
*** Dim inactive buffers
Dim inactive buffers.
#+begin_src emacs-lisp

View file

@ -7,10 +7,10 @@ afk_time=$(echo "${afk_event}" | jq -r '.[0].duration' | xargs -I ! date -u -d
uptime=$(uptime | awk '{ print substr($3, 0, length($3) - 1) }' | xargs -I ! date -d ! +"%H:%M")
res="${afk_time} / ${uptime}"
if [[ $status == 'afk' ]]; then
# echo "%{u#f07178}%{+u} [AFK] $res %{u-}"
# echo "%{u#cc3333}%{+u} [AFK] $res %{u-}"
echo "[AFK] $res"
else
# echo "%{u#82aaff}%{+u} $res %{u-}"
# echo "%{u#375cd8}%{+u} $res %{u-}"
echo "$res"
fi
# aw-afk:1 ends here

View file

@ -4,7 +4,7 @@ ip=$(dig +short +timeout=1 myip.opendns.com @resolver1.opendns.com 2> /dev/null)
# API_KEY="$(pass show My_Online/APIs/ipstack | head -n 1)"
API_KEY=$IPSTACK_API_KEY
if [[ -z $ip || $ip == *"timed out"* ]]; then
echo "%{u#f07178}%{+u} ?? %{u-}"
echo "%{u#cc3333}%{+u} ?? %{u-}"
exit
fi
ip_info=$(curl -s http://api.ipstack.com/${ip}?access_key=${API_KEY})
@ -17,8 +17,8 @@ if [[ -z $code ]]; then
fi
if [ -n "$vpn" ]; then
echo "%{u#82aaff}%{+u}  $code %{u-}"
echo "%{u#375cd8}%{+u}  $code %{u-}"
else
echo "%{u#f07178}%{+u}  $code %{u-}"
echo "%{u#cc3333}%{+u}  $code %{u-}"
fi
# ipstack-vpn:1 ends here

View file

@ -19,11 +19,11 @@ time=$(sunwait poll daylight rise ${LAT} $LON)
if [[ ${time} == 'DAY' ]]; then
sunset=$(sunwait list daylight set ${LAT} ${LON})
# echo "%{u#ffcb6b}%{+u} $sunset %{u-}"
# echo "%{u#8a5d00}%{+u} $sunset %{u-}"
echo $sunset
else
sunrise=$(sunwait list daylight rise ${LAT} ${LON})
# echo "%{u#f07178}%{+u} $sunrise %{u-}"
# echo "%{u#cc3333}%{+u} $sunrise %{u-}"
echo $sunrise
fi
# sun:1 ends here

View file

@ -1,18 +1,18 @@
:root {
--tridactyl-fg: #EEFFFF;
--tridactyl-bg: #292D3E;
--tridactyl-url-fg: #f07178;
--tridactyl-url-bg: #292D3E;
--tridactyl-highlight-box-bg: #82aaff;
--tridactyl-highlight-box-fg: #292D3E;
--tridactyl-fg: #222222;
--tridactyl-bg: #fff8f0;
--tridactyl-url-fg: #cc3333;
--tridactyl-url-bg: #fff8f0;
--tridactyl-highlight-box-bg: #375cd8;
--tridactyl-highlight-box-fg: #fff8f0;
/* Command line */
--tridactyl-cmdl-bg: #242837
--tridactyl-cmdl-fg: #EEFFFF
--tridactyl-cmdl-bg: #f6ece8
--tridactyl-cmdl-fg: #222222
/* Hint character tags */
--tridactyl-hintspan-fg: #292D3E !important;
--tridactyl-hintspan-bg: #82aaff !important;
--tridactyl-hintspan-fg: #fff8f0 !important;
--tridactyl-hintspan-bg: #375cd8 !important;
/* Element Highlights */
--tridactyl-hint-active-fg: none;
@ -30,8 +30,8 @@
#command-line-holder {
order: 1;
border: 2px solid #82aaff;
background: #292D3E;
border: 2px solid #375cd8;
background: #fff8f0;
}
#tridactyl-input {
@ -139,20 +139,20 @@
bottom: 0 !important;
background: var(--tridactyl-bg) !important;
border: unset !important;
border: 1px #82aaff solid !important;
border: 1px #375cd8 solid !important;
font-size: 12pt !important;
/*font-weight: 200 !important;*/
padding: 0.8ex !important;
}
#completions .focused {
background: #82aaff;
color: #292D3E;
background: #375cd8;
color: #fff8f0;
}
#completions .focused .url {
background: #82aaff;
color: #292D3E;
background: #375cd8;
color: #fff8f0;
}
/* #Ocean-normal { */
/* border-color: green !important; */