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

Option to change font size #35

Closed
jevy opened this issue Feb 16, 2023 · 4 comments · Fixed by #60
Closed

Option to change font size #35

jevy opened this issue Feb 16, 2023 · 4 comments · Fixed by #60
Labels
feature A new feature or a feature request

Comments

@jevy
Copy link

jevy commented Feb 16, 2023

I would like to override the font size in /modules/sway/hm.nix what's the best practice to do so? Is it a nix override?

@danth
Copy link
Owner

danth commented Feb 19, 2023

Unfortunately it's not possible to change that without editing the file directly.

I will add an option so that you can set stylix.targets.sway.fontSize to your preferred size.

@danth danth added the feature A new feature or a feature request label Feb 19, 2023
@danth danth changed the title Override module attributes Option to change font size Feb 19, 2023
@jevy
Copy link
Author

jevy commented Feb 19, 2023

I'm trying to think if there is a more sustainable for others to make changes to the defaults without you having to make options for everything. Is https://nixos.wiki/wiki/Overlays not possible to change one of the settings?

@danth
Copy link
Owner

danth commented Feb 21, 2023

Overlays only work for packages, NixOS/Home Manager are using modules for configuration.

The module equivalent of overrides would be mkForce, but it can't override let bindings, so you have to apply mkForce to every place where the value is used instead. In the case of Sway this would be wayland.windowManager.sway.config.fonts.size and lib.stylix.sway.bar.fonts.size, but it gets more complicated if the value is repeated in lots of places.

I suppose another route is to disable stylix.targets.sway and import your own copy of the module in its place, which would allow you to edit the code freely. Of course that would mean that you don't receive updates if the original module is changed.

@dwarfmaster
Copy link
Contributor

In general I think we need to figure out a way to handle fontsizes, to avoid this kind of hardcoding. Maybe creating creating some sort of nomenclature for font sizes that the user could set, so that the different modules could pick the relevant size automatically 🤔

@danth danth closed this as completed in #60 Mar 19, 2023
danth added a commit that referenced this issue Mar 19, 2023
Fixes #35 and #59

Co-authored-by: Daniel Thwaites <danthwaites30@btinternet.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new feature or a feature request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants