diff --git a/modules/home-manager/rofi/default.nix b/modules/home-manager/rofi/default.nix index 0425987..7a636e8 100644 --- a/modules/home-manager/rofi/default.nix +++ b/modules/home-manager/rofi/default.nix @@ -1,333 +1,321 @@ -{ ... }: { - programs.rofi = { - enable = true; - extraConfig = '' - configuration { - terminal: "alacritty"; +{ config, ... }: { + programs.rofi = + { + enable = true; + extraConfig = + { + terminal = "alacritty"; - modes: "combi,keys"; + modes = "combi,keys"; - display-window: "window"; - display-drun: "run"; - display-windowcd: "windowcd"; - display-run: "run"; - display-ssh: "ssh"; - display-combi: "combi"; - display-keys: "keys"; - display-filebrowser: "filebrowser"; + display-window = "window"; + display-drun = "run"; + display-windowcd = "windowcd"; + display-run = "run"; + display-ssh = "ssh"; + display-combi = "combi"; + display-keys = "keys"; + display-filebrowser = "filebrowser"; - combi-modes: "window,drun"; - combi-hide-mode-prefix: false; - combi-display-format: "{mode} {text}"; + combi-modes = "window,drun"; + combi-hide-mode-prefix = false; + combi-display-format = "{mode} {text}"; - window-format: "[{w:-1}] {c:-1} {t:-1}"; - window-thumbnail: false; + window-format = "[{w=-1}] {c=-1} {t=-1}"; + window-thumbnail = false; - drun-url-launcher: "xdg-open"; - drun-match-fields: "name,generic,exec,categories,keywords"; - drun-display-format: "{name}[ ({generic})][ {exec}]"; - drun-show-actions: true; - drun { - parse-user: true; - parse-system: true; - } + drun-url-launcher = "xdg-open"; + drun-match-fields = "name,generic,exec,categories,keywords"; + drun-display-format = "{name}[ ({generic})][ {exec}]"; + drun-show-actions = true; - run-command: "{cmd}"; - run-list-command: ""; - run-shell-command: "{terminal} -e {cmd}"; + run-command = "{cmd}"; + run-list-command = ""; + run-shell-command = "{terminal} -e {cmd}"; - filebrowser { - directories-first: true; - sorting-method: "name"; - } + matching = "normal"; + font = "JetBrains Mono 11"; + show-icons = true; + scroll-method = 0; + cycle = false; + fixed-num-lines = false; + }; + theme = + let + inherit (config.lib.formats.rasi) mkLiteral; + in + { + "*" = { + font = "JetBrains Mono 11"; - timeout { - action: "kb-cancel"; - delay: 0; - } + black = mkLiteral "#1d1f21"; + white = mkLiteral "#c5c8c6"; + red = mkLiteral "#cc6666"; + orange = mkLiteral "#de935f"; + yellow = mkLiteral "#f0c674"; + green = mkLiteral "#7cb36b"; + cyan = mkLiteral "#78bab9"; + blue = mkLiteral "#81a2be"; + magenta = mkLiteral "#b294bb"; - matching: "normal"; - font: "monospace 11"; - show-icons: true; - scroll-method: 0; - cycle: false; - fixed-num-lines: false; - } + black-bright = mkLiteral "#3c4044"; + white-bright = mkLiteral "#eaeaea"; + red-bright = mkLiteral "#d54e53"; + orange-bright = mkLiteral "#e78c45"; + yellow-bright = mkLiteral "#e7c547"; + green-bright = mkLiteral "#71c464"; + cyan-bright = mkLiteral "#6acdcc"; + blue-bright = mkLiteral "#7aa6da"; + magenta-bright = mkLiteral "#c397d8"; - @theme "theme" - ''; - theme = '' - * { - font: "JetBrains Mono 11"; + black-66 = mkLiteral "#131415"; + white-66 = mkLiteral "#828382"; + red-66 = mkLiteral "#864343"; + orange-66 = mkLiteral "#92613e"; + yellow-66 = mkLiteral "#9e824c"; + green-66 = mkLiteral "#517646"; + cyan-66 = mkLiteral "#4f7a7a"; + blue-66 = mkLiteral "#556a7d"; + magenta-66 = mkLiteral "#75617b"; - black: #1d1f21; - white: #c5c8c6; - red: #cc6666; - orange: #de935f; - yellow: #f0c674; - green: #7cb36b; - cyan: #78bab9; - blue: #81a2be; - magenta: #b294bb; + black-33 = mkLiteral "#090a0a"; + white-33 = mkLiteral "#414141"; + red-33 = mkLiteral "#432121"; + orange-33 = mkLiteral "#49301f"; + yellow-33 = mkLiteral "#4f4126"; + green-33 = mkLiteral "#283b23"; + cyan-33 = mkLiteral "#273d3d"; + blue-33 = mkLiteral "#2a353e"; + magenta-33 = mkLiteral "#3a303d"; - black-bright: #3c4044; - white-bright: #eaeaea; - red-bright: #d54e53; - orange-bright: #e78c45; - yellow-bright: #e7c547; - green-bright: #71c464; - cyan-bright: #6acdcc; - blue-bright: #7aa6da; - magenta-bright: #c397d8; + common-background = mkLiteral "@black"; + common-background-bright = mkLiteral "@black-bright"; + common-background-66 = " @black-66"; + common-foreground = mkLiteral "@white"; + common-foreground-bright = mkLiteral "@white-bright"; + common-foreground-66 = mkLiteral "@white-66"; + common-primary = mkLiteral "@yellow"; + common-primary-bright = mkLiteral "@yellow-bright"; + common-primary-66 = mkLiteral "@yellow-66"; + common-primary-33 = mkLiteral "@yellow-33"; + common-secondary = mkLiteral "@blue"; + common-secondary-bright = mkLiteral "@blue-bright"; + common-secondary-66 = mkLiteral "@blue-66"; + common-secondary-33 = mkLiteral "@blue-33"; + common-urgent = mkLiteral "@red"; + common-urgent-bright = mkLiteral "@red-bright"; + common-urgent-66 = mkLiteral "@red-66"; + common-urgent-33 = mkLiteral "@red-33"; - black-66: #131415; - white-66: #828382; - red-66: #864343; - orange-66: #92613e; - yellow-66: #9e824c; - green-66: #517646; - cyan-66: #4f7a7a; - blue-66: #556a7d; - magenta-66: #75617b; + background-color = mkLiteral "transparent"; - black-33: #090a0a; - white-33: #414141; - red-33: #432121; - orange-33: #49301f; - yellow-33: #4f4126; - green-33: #283b23; - cyan-33: #273d3d; - blue-33: #2a353e; - magenta-33: #3a303d; + normal-normal-background = mkLiteral "transparent"; + normal-normal-foreground = mkLiteral "@common-foreground"; + normal-normal-border-color = mkLiteral "transparent"; + normal-active-background = mkLiteral "transparent"; + normal-active-foreground = mkLiteral "@common-secondary-bright"; + normal-active-border-color = mkLiteral "transparent"; + normal-urgent-background = mkLiteral "transparent"; + normal-urgent-foreground = mkLiteral "@common-urgent-bright"; + normal-urgent-border-color = mkLiteral "transparent"; - common-background: @black; - common-background-bright: @black-bright; - common-background-66: @black-66; - common-foreground: @white; - common-foreground-bright: @white-bright; - common-foreground-66: @white-66; - common-primary: @yellow; - common-primary-bright: @yellow-bright; - common-primary-66: @yellow-66; - common-primary-33: @yellow-33; - common-secondary: @blue; - common-secondary-bright: @blue-bright; - common-secondary-66: @blue-66; - common-secondary-33: @blue-33; - common-urgent: @red; - common-urgent-bright: @red-bright; - common-urgent-66: @red-66; - common-urgent-33: @red-33; + selected-normal-background = mkLiteral "@common-primary-33"; + selected-normal-foreground = mkLiteral "@common-primary-bright"; + selected-normal-border-color = mkLiteral "@common-primary-66"; + selected-active-background = mkLiteral "@common-secondary-33"; + selected-active-foreground = mkLiteral "@common-secondary-bright"; + selected-active-border-color = mkLiteral "@common-secondary-66"; + selected-urgent-background = mkLiteral "@common-urgent-33"; + selected-urgent-foreground = mkLiteral "@common-urgent-bright"; + selected-urgent-border-color = mkLiteral "@common-urgent-66"; - background-color: transparent; + alternate-normal-background = mkLiteral "@normal-normal-background"; + alternate-normal-foreground = mkLiteral "@normal-normal-foreground"; + alternate-normal-border-color = mkLiteral "@normal-normal-border-color"; + alternate-active-background = mkLiteral "@normal-active-background"; + alternate-active-foreground = mkLiteral "@normal-active-foreground"; + alternate-active-border-color = mkLiteral "@normal-active-border-color"; + alternate-urgent-background = mkLiteral "@normal-urgent-background"; + alternate-urgent-foreground = mkLiteral "@normal-urgent-foreground"; + alternate-urgent-border-color = mkLiteral "@normal-urgent-border-color"; + }; - normal-normal-background: transparent; - normal-normal-foreground: @common-foreground; - normal-normal-border-color: transparent; - normal-active-background: transparent; - normal-active-foreground: @common-secondary-bright; - normal-active-border-color: transparent; - normal-urgent-background: transparent; - normal-urgent-foreground: @common-urgent-bright; - normal-urgent-border-color: transparent; + "window" = { + background-color = mkLiteral "#1d1f21e6"; #// @black + 0.85 alpha + border = 3; + border-color = mkLiteral "@black-bright"; + border-radius = 16; + width = 1024; + height = 460; + }; - selected-normal-background: @common-primary-33; - selected-normal-foreground: @common-primary-bright; - selected-normal-border-color: @common-primary-66; - selected-active-background: @common-secondary-33; - selected-active-foreground: @common-secondary-bright; - selected-active-border-color: @common-secondary-66; - selected-urgent-background: @common-urgent-33; - selected-urgent-foreground: @common-urgent-bright; - selected-urgent-border-color: @common-urgent-66; + "mainbox" = { + padding = 16; + spacing = 16; + }; - alternate-normal-background: @normal-normal-background; - alternate-normal-foreground: @normal-normal-foreground; - alternate-normal-border-color: @normal-normal-border-color; - alternate-active-background: @normal-active-background; - alternate-active-foreground: @normal-active-foreground; - alternate-active-border-color: @normal-active-border-color; - alternate-urgent-background: @normal-urgent-background; - alternate-urgent-foreground: @normal-urgent-foreground; - alternate-urgent-border-color: @normal-urgent-border-color; - } + "inputbar" = { + background-color = mkLiteral "#333537"; #// @black-110 + border = 1; + border-color = mkLiteral "#606263"; #// @black-130 + border-radius = 8; + padding = mkLiteral "12 16"; + spacing = 0; + text-color = mkLiteral "@common-foreground"; + children = mkLiteral "[ entry, case-indicator, num-filtered-rows, textbox-num-sep, num-rows ]"; + }; - window { - background-color: #1d1f21d9; // @black + 0.85 alpha - border: 3; - border-color: @black-bright; - border-radius: 16; - width: 1024; - height: 460; - } + "prompt" = { + background-color = mkLiteral "transparent"; + text-color = mkLiteral "@common-foreground-bright"; + spacing = 0; + text-transform = mkLiteral "bold"; + }; - mainbox { - padding: 16; - spacing: 16; - } + "textbox-prompt-colon" = { + background-color = mkLiteral "transparent"; + text-color = mkLiteral "inherit"; + margin = mkLiteral "0 0.3em 0 0"; + expand = false; + str = "="; + }; - inputbar { - background-color: #333537; // @black-110 - border: 1; - border-color: #606263; // @black-130 - border-radius: 8; - padding: 12 16; - spacing: 0; - text-color: @common-foreground; - children: [ "entry", "case-indicator", "num-filtered-rows", "textbox-num-sep", "num-rows"]; - } + "entry" = { + background-color = mkLiteral "transparent"; + text-color = mkLiteral "@common-foreground-bright"; + cursor = "text"; + placeholder-color = mkLiteral "@common-foreground-66"; + placeholder = "Type to filter"; + }; - prompt { - background-color: transparent; - text-color: @common-foreground-bright; - spacing: 0; - text-transform: bold; - } + "case-indicator" = { + background-color = mkLiteral "transparent"; + text-color = mkLiteral "inherit"; + }; - textbox-prompt-colon { - background-color: transparent; - text-color: inherit; - margin: 0 0.3em 0 0; - expand: false; - str: ":"; - } + "num-filtered-rows" = { + background-color = mkLiteral "transparent"; + text-color = mkLiteral "inherit"; + expand = false; + }; - entry { - background-color: transparent; - text-color: @common-foreground-bright; - cursor: text; - placeholder-color: @common-foreground-66; - placeholder: "Type to filter"; - } + "textbox-num-sep" = { + background-color = mkLiteral "transparent"; + text-color = mkLiteral "inherit"; + expand = false; + str = "/"; + }; - case-indicator { - background-color: transparent; - text-color: inherit; - } + "num-rows" = { + background-color = mkLiteral "transparent"; + text-color = mkLiteral "inherit"; + expand = false; + }; - num-filtered-rows { - background-color: transparent; - text-color: inherit; - expand: false; - } + "message" = { + background-color = mkLiteral "@cyan-33"; + border = 1; + border-color = mkLiteral "@cyan-66"; + border-radius = 8; + padding = 16; + }; - textbox-num-sep { - background-color: transparent; - text-color: inherit; - expand: false; - str: "/"; - } + "textbox" = { + background-color = mkLiteral "transparent"; + text-color = mkLiteral "@cyan-bright"; + }; - num-rows { - background-color: transparent; - text-color: inherit; - expand: false; - } + "listview" = { + dynamic = true; + scrollbar = true; + spacing = 0; + }; - message { - background-color: @cyan-33; - border: 1; - border-color: @cyan-66; - border-radius: 8; - padding: 16; - } + "scrollbar" = { + background-color = mkLiteral "transparent"; + padding = 0; + margin = mkLiteral "0 0 0 4"; + handle-width = 8; + border = 0; + handle-color = mkLiteral "#626463"; #// @white-50 + }; - textbox { - background-color: transparent; - text-color: @cyan-bright; - } + "element" = { + border = 1; + border-radius = 8; + padding = mkLiteral "6 12"; + margin = mkLiteral "1 0"; + spacing = 12; + children = mkLiteral "[ element-icon, element-text ]"; + }; - listview { - dynamic: true; - scrollbar: true; - spacing: 0; - } + "element-icon" = { + background-color = mkLiteral "transparent"; + text-color = mkLiteral "inherit"; + size = mkLiteral "1.0em"; + cursor = mkLiteral "inherit"; + }; - scrollbar { - background-color: transparent; - padding: 0; - margin: 0 0 0 4; - handle-width: 8; - border: 0; - handle-color: #626463; // @white-50 - } + "element-text" = { + background-color = mkLiteral "transparent"; + text-color = mkLiteral "inherit"; + highlight = mkLiteral "inherit"; + cursor = mkLiteral "inherit"; + }; - element { - border: 1; - border-radius: 8; - padding: 6 12; - margin: 1 0; - spacing: 12; - children: [ element-icon, element-text ]; - } + "element normal.normal" = { + background-color = mkLiteral "@normal-normal-background"; + text-color = mkLiteral "@normal-normal-foreground"; + border-color = mkLiteral "@normal-normal-border-color"; + }; - element-icon { - background-color: transparent; - text-color: inherit; - size: 1.0em; - cursor: inherit; - } + "element normal.urgent" = { + background-color = mkLiteral "@normal-urgent-background"; + text-color = mkLiteral "@normal-urgent-foreground"; + border-color = mkLiteral "@normal-urgent-border-color"; + }; - element-text { - background-color: transparent; - text-color: inherit; - highlight: inherit; - cursor: inherit; - } + "element normal.active" = { + background-color = mkLiteral "@normal-active-background"; + text-color = mkLiteral "@normal-active-foreground"; + border-color = mkLiteral "@normal-active-border-color"; + }; - element normal.normal { - background-color: @normal-normal-background; - text-color: @normal-normal-foreground; - border-color: @normal-normal-border-color; - } + "element selected.normal" = { + background-color = mkLiteral "@selected-normal-background"; + text-color = mkLiteral "@selected-normal-foreground"; + border-color = mkLiteral "@selected-normal-border-color"; + }; - element normal.urgent { - background-color: @normal-urgent-background; - text-color: @normal-urgent-foreground; - border-color: @normal-urgent-border-color; - } + "element selected.urgent" = { + background-color = mkLiteral "@selected-urgent-background"; + text-color = mkLiteral "@selected-urgent-foreground"; + border-color = mkLiteral "@selected-urgent-border-color"; + }; - element normal.active { - background-color: @normal-active-background; - text-color: @normal-active-foreground; - border-color: @normal-active-border-color; - } + "element selected.active" = { + background-color = mkLiteral "@selected-active-background"; + text-color = mkLiteral "@selected-active-foreground"; + border-color = mkLiteral "@selected-active-border-color"; + }; - element selected.normal { - background-color: @selected-normal-background; - text-color: @selected-normal-foreground; - border-color: @selected-normal-border-color; - } + "element alternate.normal" = { + background-color = mkLiteral "@alternate-normal-background"; + text-color = mkLiteral "@alternate-normal-foreground"; + border-color = mkLiteral "@alternate-normal-border-color"; + }; - element selected.urgent { - background-color: @selected-urgent-background; - text-color: @selected-urgent-foreground; - border-color: @selected-urgent-border-color; - } + "element alternate.urgent" = { + background-color = mkLiteral "@alternate-urgent-background"; + text-color = mkLiteral "@alternate-urgent-foreground"; + border-color = mkLiteral "@alternate-urgent-border-color"; + }; - element selected.active { - background-color: @selected-active-background; - text-color: @selected-active-foreground; - border-color: @selected-active-border-color; - } - - element alternate.normal { - background-color: @alternate-normal-background; - text-color: @alternate-normal-foreground; - border-color: @alternate-normal-border-color; - } - - element alternate.urgent { - background-color: @alternate-urgent-background; - text-color: @alternate-urgent-foreground; - border-color: @alternate-urgent-border-color; - } - - element alternate.active { - background-color: @alternate-active-background; - text-color: @alternate-active-foreground; - border-color: @alternate-active-border-color; - } - ''; - }; + "element alternate.active" = { + background-color = mkLiteral "@alternate-active-background"; + text-color = mkLiteral "@alternate-active-foreground"; + border-color = mkLiteral "@alternate-active-border-color"; + }; + }; + }; }