Fixup rofi theme configuration

This is a temporary fix. I've switched from using ‘@theme’ to ‘@import’ because
the former discards the default theme, and apparently my theme makes some
assumptions about the state of things and requires the default theme to work.
The proper fix would be to fix my theme instead.

This change also fixes a bunch of typos and fixes the use of references within
the theme. References aren't strictly necessary, but my current theme relies on
them and they are technically a valid part of the configuration.
This commit is contained in:
Tom Willemse 2022-07-03 19:00:35 -07:00
parent dc631e498f
commit 5c200f0cb4
2 changed files with 21 additions and 24 deletions

View file

@ -99,41 +99,41 @@
(orange . "#faa41a") (orange . "#faa41a")
(blue . "#1f2c3f") (blue . "#1f2c3f")
(selected-normal-foreground . "@foreground") (selected-normal-foreground . "@text-color")
(normal-foreground . "@foreground") (normal-foreground . "@text-color")
(alternate-normal-background . "@background") (alternate-normal-background . "@background-color")
(selected-urgent-foreground . "@foreground") (selected-urgent-foreground . "@text-color")
(urgent-foreground . "@foreground") (urgent-foreground . "@text-color")
(alternate-urgent-background . "@background") (alternate-urgent-background . "@background-color")
(active-foreground . "@text-color") (active-foreground . "@text-color")
(selected-active-foreground . "@foreground") (selected-active-foreground . "@text-color")
(alternate-normal-foreground . "@foreground") (alternate-normal-foreground . "@text-color")
(alternate-active-background . "@blue") (alternate-active-background . "@blue")
(bordercolor . "@foreground") (bordercolor . "@text-color")
(normal-background . "@background") (normal-background . "@background-color")
(selected-normal-background . "@blue") (selected-normal-background . "@blue")
(separatorcolor . "@orange") (separatorcolor . "@orange")
(spacing . 2) (spacing . 2)
(urgent-background . "@red") (urgent-background . "@red")
(alternate-urgent-foreground . "@foreground") (alternate-urgent-foreground . "@text-color")
(selected-urgent-background . "@red") (selected-urgent-background . "@red")
(alternate-active-foreground . "@foreground") (alternate-active-foreground . "@text-color")
(selected-active-background . "@blue") (selected-active-background . "@blue")
(active-background . "@red") (active-background . "@red")
(font . "Fantasque Sans Mono 14"))) (font . "Fantasque Sans Mono 14")))
(window ((border . 0) (window ((border . 0)
(text-color . "@foreground") (text-color . "@text-color")
(background-color . "rgba(0, 0, 0, 0%)") (background-color . "rgba(0, 0, 0, 0%)")
(padding . 5) (padding . 5)
(text-color . "@bordercolor") (text-color . "@bordercolor")
(background-color . "@background"))) (background-color . "@background-color")))
(mainbox ((border . 0) (mainbox ((border . 0)
(padding . 0))) (padding . 0)))
(message ((border . "1px dash 0px 0px") (message ((border . "1px dash 0px 0px")
(text-color . "@separatorcolor") (text-color . "@separatorcolor")
(padding . "2px 0px 0px"))) (padding . "2px 0px 0px")))
(textbox ((text-color . "@foreground"))) (textbox ((text-color . "@text-color")))
(listview ((fixed-height . 0) (listview ((fixed-height . 0)
(border . "2px 0px 0px") (border . "2px 0px 0px")
(padding . "2px 0px 0px") (padding . "2px 0px 0px")
@ -141,17 +141,12 @@
(element ((border . 0) (element ((border . 0)
(children "element-icon" "element-text") (children "element-icon" "element-text")
(spacing . "5px"))) (spacing . "5px")))
(element-text
element-icon ((background-color . "inherit")
(text-color . "inherit")))
(element.normal.normal ((text-color . "@normal-foreground") (element.normal.normal ((text-color . "@normal-foreground")
(background-color . "@normal-background"))) (background-color . "@normal-background")))
(element.normal.urgent ((text-color . "@urgent-foreground") (element.normal.urgent ((text-color . "@urgent-foreground")
(background-color . "@urgent-background"))) (background-color . "@urgent-background")))
(element.normal.active ((text-color . "@active-foreground") (element.normal.active ((text-color . "@active-foreground")
(background-color . "@active-background"))) (background-color . "@active-background")))
(element.selected.normal ((text-color . "@selected-normal-foreground")
(background-color . "@selected-normal-background")))
(element.selected.urgent ((text-color . "@selected-urgent-foreground") (element.selected.urgent ((text-color . "@selected-urgent-foreground")
(background-color . "@selected-urgent-background"))) (background-color . "@selected-urgent-background")))
(element.selected.active ((text-color . "@selected-active-foreground") (element.selected.active ((text-color . "@selected-active-foreground")
@ -168,7 +163,7 @@
(inputbar ((spacing . 0) (inputbar ((spacing . 0)
(border . "0px") (border . "0px")
(children "prompt" "textbox-prompt-colon" "entry" "case-indicator"))) (children "prompt" "textbox-prompt-colon" "entry" "case-indicator")))
(#{button normal}# ((text-color . "@foreground"))) (#{button normal}# ((text-color . "@text-color")))
(text-prompt-color ((expand . #f) (text-prompt-color ((expand . #f)
(str . ":") (str . ":")
(margin . "0px 0.3em 0em 0em") (margin . "0px 0.3em 0em 0em")

View file

@ -67,8 +67,10 @@
(object->string val)) (object->string val))
((string? val) ((string? val)
(let ((color-match (regexp-exec color-regexp val))) (let ((color-match (regexp-exec color-regexp val)))
(if (regexp-match? color-match) (if (or (string-prefix? "@" val)
val (string-append "\"" val "\"")))) (regexp-match? color-match))
val
(string-append "\"" val "\""))))
(else val))) (else val)))
(define (format-rofi-config config) (define (format-rofi-config config)
@ -117,7 +119,7 @@
(home-rofi-configuration-config conf)) (home-rofi-configuration-config conf))
;; Apply theme ;; Apply theme
(if (not (eq? (home-rofi-configuration-theme conf) '())) (if (not (eq? (home-rofi-configuration-theme conf) '()))
(list "\n@theme \"guix\"\n") '())))) (list "\n@import \"guix\"\n") '()))))
("rofi/guix.rasi" ("rofi/guix.rasi"
,(mixed-text-file ,(mixed-text-file
"guix.rasi" "guix.rasi"