stylix: allow choosing testbed desktop
This adds stylix.testbed.ui.desktop which allows the testbed to pick what desktop environment/window manager will be ran inside the VM.
This PR is currently a PoC and I'm open to any suggestions. I'm actively working on it, so everything is subject to change.
Relevant: https://github.com/danth/stylix/pull/1192#discussion_r2069722780
Things done
- [x] Tested locally
- [x] Tested in testbed
- [x] Commit message follows commit convention
- [x] Fits style guide
- [x] Respects license of any existing code used
Notify maintainers
@danth @trueNAHO @awwpotato @Flameopathic
Who else?
This seems a bit overkill IMO. The standard configuration was meant as a default for when the target is an application rather than a DE/WM itself - with the plan that GNOME would eventually be replaced with something more minimal like cage. If testbeds are targeting a DE/WM, or an application which requires something more specific then they should include their own configuration from scratch.
By adding options like this, we risk duplicating a lot of the services.xserver.* options from NixOS as essentially aliases which just enable a couple of things.
something more minimal like cage
imo cage is too minimal because it doesn't interact well with popups iirc. perhaps we use a minimal wm like river.
The reasoning is that:
a) Some applications might be desktop specific, like gnome-text-editor for example. So if we support multiple applications for the same desktop, we end up with a lot of duplicate code and potentially inconsistent setups. If a module needs a more specific setup on top of the desktop, it can handle that.
b) In the case of mako (#1192), for example, I had to replicate basically all of Hyprland's testbed code.
Some other modules we already support that could have this problem are: dunst, hyprlock, hyprpaper, rofi, swaylock, waybar, wpaperd, xresources.
We could limit our selection to a couple desktops for their specific properties (Eg. X11/Wayland, doesn't include a bar, doesn't handle notifications). Right now, I added all desktops we have testbeds for.
+1 wayprompt doesn't work in gnome environment for some reason, i tested it on sway and hyprland, works great on those wms
+1 wayprompt doesn't work in gnome environment for some reason, i tested it on sway and hyprland, works great on those wms
Ah, the reason is that Wayprompt requires the compositor to support the layer shell protocol, and GNOME doesn’t.
Ah, the reason is that Wayprompt requires the compositor to support the layer shell protocol, and GNOME doesn’t.
That must be the same reason notification daemons won't work on it
I'm currently unhappy with:
- Each graphical environment module has to check if it should be enabled. (See https://github.com/danth/stylix/pull/1222#discussion_r2083582710)
- The code for autostarting applications in WMs that don't support it is duplicated (See hyprland and bspwm)
- The choice of available environments is somewhat arbitrary (they're the environments we have testbeds for). I think
(Gnome ^ Plasma6) & (Hyprland ^ Bspwm)should be enough. Maybe cage as well.
Despite that, I believe this PR is ready for a proper review. So, I'm marking this as ready.
Consider adding the documentation from https://github.com/nix-community/stylix/pull/1383#issuecomment-2907850828 in this PR
I'm setting this to draft as I'll not be able to finish the rebase today.
Does this PR ensure that every environment has a true color default terminal (first mentioned in https://github.com/nix-community/stylix/pull/1110#discussion_r2051564208)?
What is the status of this PR?
What is the status of this PR?
Sorry about the delay, I've been traveling. And because the conflict isn't trivial, I haven't had time to fix it yet. But I'll do it this week if everything goes right.
Does this PR ensure that every environment has a true color default terminal (first mentioned in #1110 (comment))?
Not really. Hyprland and Bspwm don't ship with a terminal by default. I could add one to their files.
Once again, this PR is ready for review.
It would be good to make sure that the existing
stylix.testbed.ui.command.useTerminalfeature works on all graphical environments.
Done.
I don't know if there's anything special that you need to do to make a terminal the default one; if there isn't, this looks good.
Just realized it doesn't work. I'll fix it later today.
Done. (A bit ugly, but couldn't make it work any other way)
The bot still seems to claim that there is a merge conflict
It's resolved, so maybe it'll update soon...
It's resolved, so maybe it'll update soon...
It updates every time the base branch is updated
Backport failed for release-25.05, because it was unable to cherry-pick the commit(s).
Please cherry-pick the changes locally and resolve any conflicts.
git fetch origin release-25.05
git worktree add -d .worktree/backport-1222-to-release-25.05 origin/release-25.05
cd .worktree/backport-1222-to-release-25.05
git switch --create backport-1222-to-release-25.05
git cherry-pick -x 8c854fe383fda20e8befefc31ecf248988a40bcc