Use pywal for StumpWM theme colors

This commit is contained in:
Jeremy Dormitzer 2020-03-29 14:48:45 -04:00
parent 84880d3b96
commit f1412a6d54
2 changed files with 67 additions and 34 deletions

View File

@ -0,0 +1 @@
echo '(stumpwm::set-colors)' | stumpish -e eval

View File

@ -7,25 +7,74 @@
:style swank:*communication-style*
: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)
(let ((colors '(("base03" . "#002b36")
("base02" . "#073642")
("base01" . "#586e75")
("base00" . "#657b83")
("base0" . "#839496")
("base1" . "#93a1a1")
("base2" . "#eee8d5")
("base3" . "#fdf6e3")
("yellow" . "#b58900")
("orange" . "#cb4b16")
("red" . "#dc322f")
("magenta" . "#d33682")
("violet" . "#6c71c4")
("blue" . "#268bd2")
("cyan" . "#2aa198")
("green" . "#859900"))))
(let ((colors (mapcar 'cons
'("base03"
"base02"
"base01"
"base00"
"base0"
"base1"
"base2"
"base3"
"yellow"
"orange"
"red"
"magenta"
"violet"
"blue"
"cyan"
"green")
(get-color-palette))))
(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
(setq *message-window-gravity* :center
*input-window-gravity* :center
@ -37,28 +86,11 @@
*transient-border-width* 2
stumpwm::*float-window-border* 2
stumpwm::*float-window-title-height* 2
*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")))
*mouse-focus-policy* :click)
;; 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)
;; 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
(defcommand stumpwm-password (prompt) ((:string "prompt: "))
"Prompts the user for a password"