Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rofi theme customizability #176

Closed
trueNAHO opened this issue Oct 20, 2023 · 5 comments · Fixed by #179 or #230
Closed

Rofi theme customizability #176

trueNAHO opened this issue Oct 20, 2023 · 5 comments · Fixed by #179 or #230

Comments

@trueNAHO
Copy link
Collaborator

trueNAHO commented Oct 20, 2023

How to customize Stylix' default rofi theme?

For example, launching rofi -f <FILE> -show run with the following file successfully modifies rofi's appearance:

element {
    padding: 5px;
    spacing: 5px;
}

inputbar {
    children: [ prompt, entry ];
    padding: 10px 10px;
    spacing: 10px;
}

window {
    width: 25%;
}

Currently, it seems impossible to customize Stylix' default rofi theme without workarounds. For instance, defining programs.rofi.theme in Home Manager with the above configuration when Stylix is enabled, results in the following error because the attribute sets are not properly merged:

error:
       … while evaluating a branch condition

         at /nix/store/xjviahzwa7x51vl51kc3c1k1n1jmhpd5-source/lib/lists.nix:57:9:

           56|       fold' = n:
           57|         if n == len
             |         ^
           58|         then nulwhile calling the 'length' builtin

         at /nix/store/xjviahzwa7x51vl51kc3c1k1n1jmhpd5-source/lib/lists.nix:55:13:

           54|     let
           55|       len = length list;
             |             ^
           56|       fold' = n:

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: The option `programs.rofi.theme' is defined multiple times while it's expected to be unique.

       Definition values:
       - In `/nix/store/3gmxlakzyn7ylnkjqz9v843dajm8b375-modules/rofi/hm.nix': "/nix/store/sxichxgwnw8igh3am8kv4rc81n91l8bq-stylix/base16-stylix.rasi"
       - In `/nix/store/kl5mlqcs9bw8v1n125sacwk1ll5qixx4-source/modules/homeManager/programs/rofi':
           {
             "#inputbar" = {
               children = [
                 {
                   _type = "literal";
           ...
       Use `lib.mkForce value` or `lib.mkDefault value` to change the priority on any of these definitions.

Additionnally, I have been unable to get programs.rofi.extraConfig to work with my intended theme modifications. But that could be my mistake.

Related:

@trueNAHO
Copy link
Collaborator Author

Additionally, should https://github.com/danth/stylix/blob/b2f73724d11868d020207fb87fb2d9c3ae96976d/modules/rofi/template.mustache declare non-color values, like paddings, in the first place?

trueNAHO added a commit to trueNAHO/dotfiles that referenced this issue Oct 20, 2023
@danth
Copy link
Owner

danth commented Oct 22, 2023

I'm not sure why we're setting paddings. Does the theme look different/worse if those are removed?

@trueNAHO
Copy link
Collaborator Author

This issue should be re-opened because it is not yet resolved. #179 is related to this issue, but does not resolve it.

@TotalChaos05
Copy link
Contributor

TotalChaos05 commented Oct 24, 2023

how do i get rofi back to how it was before?
is there a way to default to the original style, but make it easy to override?

@trueNAHO
Copy link
Collaborator Author

trueNAHO commented Oct 24, 2023

how do i get rofi back to how it was before?

The opinionated settings have been removed in #179.

is there a way to default to the original style

I assume you are referring to the state prior to #179, which is not rofi's default appearance.

make it easy to override

Customizing rofi is exactly what this issue addresses: #176 (comment).

As long as this issue is not resolved, feel free to take inspiration from my workaround:

Currently, it seems impossible to customize Stylix' default rofi theme without workarounds.

(Source: #176 (comment))

@danth danth reopened this Oct 25, 2023
trueNAHO added a commit to trueNAHO/dotfiles that referenced this issue Jan 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants