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

Implement bar.workspaces.workspaceIconMap in nix #725

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

agluck91
Copy link

@agluck91 agluck91 commented Jan 15, 2025

I use the alejandra nix recommended formatting in my nix files. It applies to this commit. I can remove them from this PR if they are unwelcome. I noticed some spacing that was off at the bottom so I let the formatter clean things up. I did not see a CONTRIBUTING.md, so I was not sure how this was viewed here.

I added an option type under settings for bar.workspaces.workspaceIconMap.
I put it here instead of breaking it out like layout (breaking it out might be a better option honestly) to match the rest of the config and continue support for the one to one relation from the users perspective. However, Because I added it to settings, I needed to explicitly exclude the workspaceIconMap value so it was not caught in the flattening. This could be a brittle point now. I did not know a better way to handle it without changing a bunch of other stuff too?

I noticed other lists did not pretty print their options, so I abandoned my attemps at pretty printing.

This works for my hyprpanel config with the latest nixos right now. Would love more eyes on this though. This is my first PR for nix changes. I am sure there is room for improvement. Happy to accept edits

The code utilization looks like this, which follows the expected pattern:

bar.workspaces.workspaceIconMap = {
        "1" = "";
        "2" = "";
        "3" = "";
        "4" = "󰙯";
        "5" = "󱄅";
      };

@agluck91 agluck91 marked this pull request as draft January 15, 2025 04:30
@agluck91 agluck91 marked this pull request as ready for review January 15, 2025 04:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant