-
-
Notifications
You must be signed in to change notification settings - Fork 303
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
Support more options for icon in lualine #769
Support more options for icon in lualine #769
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good remark, we can definitely do this.
See my proposition for what type to set :)
plugins/statuslines/lualine.nix
Outdated
@@ -36,7 +36,7 @@ with lib; let | |||
Enables the display of icons alongside the component. | |||
''; | |||
|
|||
icon = helpers.mkNullOrOption types.str '' | |||
icon = helpers.mkNullOrOption (types.either types.str helpers.rawType) '' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
icon = helpers.mkNullOrOption (types.either types.str helpers.rawType) '' | |
icon = helpers.mkNullOrOption (with types; either str (attrsOf anything)) '' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for showing me the change.
I am trying to test locally before pushing the change.
I am having a problem on the generation.
I think something else needs to be define maybe here https://github.com/nix-community/nixvim/blob/main/plugins/statuslines/lualine.nix#L214. in order to handle the unkeyed value for the icon.
I've tried several things with no success. maybe you can point me to some example to use as base.
Thanks.
c42f686
to
1819d6b
Compare
@GaetanLepage After several tries and many errors I was able to find the solution to properly map the icon property, and from my tests works as expected. Please let me know what you think. |
Co-authored-by: Gaétan Lepage <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect ! Thanks :)
From lualine documentation the icons can be configure more than just an string
https://github.com/nvim-lualine/lualine.nvim#general-component-options
example
Currently is defined as string which cover for most of the cases but if you want to set a color or more is not possible. I think that adding support for raw type makes more extensible.
I think also setting an object is possible but I lack the knowledge to do so, with this I was able to extend my configuration as I needed.
Let me know what do you think.
Kind regards, thanks for maintaining the project.