Skip to content

feat(wrapperModules.labwc): init - #651

Open
LodWKobku wants to merge 2 commits into
nix-community:mainfrom
LodWKobku:labwc
Open

LodWKobku wants to merge 2 commits into
nix-community:mainfrom
LodWKobku:labwc

Conversation

@LodWKobku

Copy link
Copy Markdown
Contributor

Created an wrapper for labwc, an wlroots-based window-stacking compositor for Wayland.

Main goal of the wrapper is to create and load all the different labwc config files, but i also added an options for adding fonts to FONTCONFIG and for setting XCURSOR vars as they are very common need when configurating compositor.

@BirdeeHub

BirdeeHub commented Nov 9, 2026 •

Copy link
Copy Markdown
Collaborator

So I found this thing: labwc-tweaks

This allows you to specify the path to all of them individually, and that would be sufficient to use the program.

labwc-tweaks allows you to specify a LABWC_CONFIG_DIR to point at for cases of nonstandard directory locations, it will work fine with the wrapper.

But people wishing to use it would need to put all their files in their config in 1 directory in their nix config and specify the path to all 4 files to use it. They might end up just overriding our --config-dir variable? Does labwc-tweaks do startup commands too? Ive never used either of these things.

We should put notes about that in the description about how to do that? Maybe more possibly if you think of anything?

But I like the module, I just think that we should at least document how to use it with that program

unless you can think of a nice way to specify the path to a whole directory without disabling the options we have already, which would be the best case.

@LodWKobku
LodWKobku force-pushed the labwc branch 3 times, most recently from 64b05d5 to bf7dd32 Compare November 13, 2026 11:40
@LodWKobku

LodWKobku commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor Author

Thanks for the feedback but I don't think that supporting labwc-tweaks is the right choice for this wrapper.

Labwc-tweaks works by editing labwc config files, which isn't possible for files created by Nix, since files in the nix-store are read-only. Supporting it would force users to manage config files outside of Nix and pass it's paths one by one which would not only limits the wrapper's capabilities, but most importantly sacrifices its main advantage: declarative, reproducible configuration.

I think that for users that want to use not-declarative labwc-tweaks the better way would be installing base labwc and labwc-tweaks package and using labwc-takes to generate configs.

However, I agree the previous documentation wasn't helpful enough, though, so I've rewritten it to be more specific, with useful sources and tips.

@BirdeeHub

BirdeeHub commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

I found an actual bug I think.

As for the docs, I left a suggestion for them too.

I do like the documentation improvements for the most part.

But on specifically the labwc-tweaks part Im feeling like you might not have understood what I meant.

You included this line.

  • Because of the declarative nature of Nix, labwc-tweaks is not supported by this wrapper.

But it does support labwc-tweaks, just awkwardly.

But, yeah let me know what you think of this way of using labwc-tweaks with the wrapper.

I think it works just well enough to be worth documenting as a thing you could do, rather than documenting it as a thing you cannot do basically.


- `configFiles."rc.xml"` and `configFiles."menu.xml"` can be created with Nix using the `content` option, or you can point to existing files using the `path` option.
- To set environment variables instead of using the `environment` configuration file, use the `env` option (`env = { ... }`) provided by the wrapper.
- Because of the declarative nature of Nix, [labwc-tweaks](https://github.com/labwc/labwc-tweaks) is **not** supported by this wrapper.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Because of the declarative nature of Nix, [labwc-tweaks](https://github.com/labwc/labwc-tweaks) is **not** supported by this wrapper.

content = '''
# Content
''';
};

@BirdeeHub BirdeeHub Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
};
};
Due to the declarative nature of Nix, [labwc-tweaks](https://github.com/labwc/labwc-tweaks) is not fully supported by this wrapper.
However, you may still use it for the values which reside in `rc.xml` or `menu.xml`. To do this you would set them via their `.path` option like the following:
```nix
configFiles."rc.xml".path = ./rc.xml;
configFiles."menu.xml".path = ./menu.xml;
```
And then at runtime calling `labwc-tweaks` pointing to your nix configuration directory like so:
```bash
LABWC_CONFIG_DIR=/path/to/your/nixConfig/modules/labwc/ labwc-tweaks
```

};
autostart = {
relPath = "labwc_config/labwc/autostart";
content = (lib.strings.join " & " config.configFiles.autostart);

@BirdeeHub BirdeeHub Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
content = (lib.strings.join " & " config.configFiles.autostart);
content = (lib.strings.join "\n" config.configFiles.autostart);

Also, after looking into labwc more, according to https://labwc.github.io/labwc-config.5.html autostart and shutdown are just shell scripts.

I originally thought these had a special syntax similar to how i3 has its own syntax for chaining its exec commands, but according to the docs it is just a shell script.

So joining with & and no newline would make the first one run in the background and then the rest would be a syntax error I am fairly sure, or maybe it would provide everything as an argument to the first command except for the last &?

But it would not run the commands in sequence.

You could join them with " && ", but that has a particular meaning and could be limiting for users.

I would propose joining them with newlines, or making autostart a lib.types.lines option and passing that directly.

};
shutdown = {
relPath = "labwc_config/labwc/shutdown";
content = (lib.strings.join " & " config.configFiles.shutdown);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
content = (lib.strings.join " & " config.configFiles.shutdown);
content = (lib.strings.join "\n" config.configFiles.shutdown);

This branch has not been deployed

No deployments
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.

2 participants