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

View file

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