Use pywal for StumpWM theme colors
This commit is contained in:
parent
84880d3b96
commit
f1412a6d54
1
stumpwm/.config/wal/hooks/10-stumpwm.sh
Executable file
1
stumpwm/.config/wal/hooks/10-stumpwm.sh
Executable file
@ -0,0 +1 @@
|
|||||||
|
echo '(stumpwm::set-colors)' | stumpish -e eval
|
@ -7,25 +7,74 @@
|
|||||||
:style swank:*communication-style*
|
:style swank:*communication-style*
|
||||||
:dont-close t)
|
:dont-close t)
|
||||||
|
|
||||||
|
;; Colors
|
||||||
|
(defvar wal-colors-path "~/.cache/wal/colors")
|
||||||
|
|
||||||
|
;; Solarized Light
|
||||||
|
(defvar default-colors
|
||||||
|
'("#002b36"
|
||||||
|
"#073642"
|
||||||
|
"#586e75"
|
||||||
|
"#657b83"
|
||||||
|
"#839496"
|
||||||
|
"#93a1a1"
|
||||||
|
"#eee8d5"
|
||||||
|
"#fdf6e3"
|
||||||
|
"#b58900"
|
||||||
|
"#cb4b16"
|
||||||
|
"#dc322f"
|
||||||
|
"#d33682"
|
||||||
|
"#6c71c4"
|
||||||
|
"#268bd2"
|
||||||
|
"#2aa198"
|
||||||
|
"#859900"))
|
||||||
|
|
||||||
|
(defun get-color-palette ()
|
||||||
|
(let ((wal-colors (when (probe-file wal-colors-path)
|
||||||
|
(uiop:read-file-lines wal-colors-path))))
|
||||||
|
(or wal-colors default-colors)))
|
||||||
|
|
||||||
(defun get-color (name)
|
(defun get-color (name)
|
||||||
(let ((colors '(("base03" . "#002b36")
|
(let ((colors (mapcar 'cons
|
||||||
("base02" . "#073642")
|
'("base03"
|
||||||
("base01" . "#586e75")
|
"base02"
|
||||||
("base00" . "#657b83")
|
"base01"
|
||||||
("base0" . "#839496")
|
"base00"
|
||||||
("base1" . "#93a1a1")
|
"base0"
|
||||||
("base2" . "#eee8d5")
|
"base1"
|
||||||
("base3" . "#fdf6e3")
|
"base2"
|
||||||
("yellow" . "#b58900")
|
"base3"
|
||||||
("orange" . "#cb4b16")
|
"yellow"
|
||||||
("red" . "#dc322f")
|
"orange"
|
||||||
("magenta" . "#d33682")
|
"red"
|
||||||
("violet" . "#6c71c4")
|
"magenta"
|
||||||
("blue" . "#268bd2")
|
"violet"
|
||||||
("cyan" . "#2aa198")
|
"blue"
|
||||||
("green" . "#859900"))))
|
"cyan"
|
||||||
|
"green")
|
||||||
|
(get-color-palette))))
|
||||||
(cdr (assoc name colors :test 'equal))))
|
(cdr (assoc name colors :test 'equal))))
|
||||||
|
|
||||||
|
(defun set-colors ()
|
||||||
|
(setq *colors* (list (get-color "base02")
|
||||||
|
(get-color "red")
|
||||||
|
(get-color "green")
|
||||||
|
(get-color "yellow")
|
||||||
|
(get-color "blue")
|
||||||
|
(get-color "magenta")
|
||||||
|
(get-color "cyan")
|
||||||
|
(get-color "base2")))
|
||||||
|
(update-color-map (current-screen))
|
||||||
|
(set-fg-color (get-color "base3"))
|
||||||
|
(set-bg-color (get-color "base03"))
|
||||||
|
(set-border-color (get-color "base02"))
|
||||||
|
(set-focus-color (get-color "base03"))
|
||||||
|
(set-unfocus-color (get-color "base03"))
|
||||||
|
(set-float-focus-color (get-color "base03"))
|
||||||
|
(set-float-unfocus-color (get-color "base03")))
|
||||||
|
|
||||||
|
(set-colors)
|
||||||
|
|
||||||
;; StumpWM configs
|
;; StumpWM configs
|
||||||
(setq *message-window-gravity* :center
|
(setq *message-window-gravity* :center
|
||||||
*input-window-gravity* :center
|
*input-window-gravity* :center
|
||||||
@ -37,28 +86,11 @@
|
|||||||
*transient-border-width* 2
|
*transient-border-width* 2
|
||||||
stumpwm::*float-window-border* 2
|
stumpwm::*float-window-border* 2
|
||||||
stumpwm::*float-window-title-height* 2
|
stumpwm::*float-window-title-height* 2
|
||||||
*mouse-focus-policy* :click
|
*mouse-focus-policy* :click)
|
||||||
*colors* (list (get-color "base02")
|
|
||||||
(get-color "red")
|
|
||||||
(get-color "green")
|
|
||||||
(get-color "yellow")
|
|
||||||
(get-color "blue")
|
|
||||||
(get-color "magenta")
|
|
||||||
(get-color "cyan")
|
|
||||||
(get-color "base2")))
|
|
||||||
|
|
||||||
;; Input/message bar
|
;; Input/message bar
|
||||||
(set-fg-color (get-color "base00"))
|
|
||||||
(set-bg-color (get-color "base3"))
|
|
||||||
(set-border-color (get-color "base2"))
|
|
||||||
(set-msg-border-width 2)
|
(set-msg-border-width 2)
|
||||||
|
|
||||||
;; Windows
|
|
||||||
(set-focus-color (get-color "base2"))
|
|
||||||
(set-unfocus-color (get-color "base2"))
|
|
||||||
(set-float-focus-color (get-color "base2"))
|
|
||||||
(set-float-unfocus-color (get-color "base2"))
|
|
||||||
|
|
||||||
;; Sudo
|
;; Sudo
|
||||||
(defcommand stumpwm-password (prompt) ((:string "prompt: "))
|
(defcommand stumpwm-password (prompt) ((:string "prompt: "))
|
||||||
"Prompts the user for a password"
|
"Prompts the user for a password"
|
||||||
|
Loading…
Reference in New Issue
Block a user