I am trying to setup both Hyprland and Gnome through gdm, which is working.
I want this because I run one a single laptop. When I am at my desk I want to use gnome, because I like the desktop experience. When I am not connected to multiple screens I want to use Hyprland.
I have installed multiple portals:
# home.nix
xdg.portal.extraPortals = mkForce [
pkgs.xdg-desktop-portal-gtk # Fallback for both
pkgs.xdg-desktop-portal-hyprland # For Hyprland
pkgs.xdg-desktop-portal-gnome # For GNOME
];
Now, my Hyprland works just fine, because I don’t have anything drawn around my windows. But on Gnome, the selection of which portal to use for drawing the titlebar seems to have changed for some applications now.
Note: Signal is blurred using blur-my-shell, without it the titlebar stays white
Is overriding /etc/profiles/per-user/mark/etc/profile.d/hm-session-vars.sh
from home.nix
with a little if statement on XDG_CURRENT_DESKTOP or XDG_SESSION_DESKTOP the way to go? If so, what variables do I target for setting the right portal? I am a bit lost
Another solution that came to mind is to set variables to support gnome at any time, and to have an exec-once in my Hyprland config that changes the variables to what Hyprland needs
Edit
Solution for Spotify
I needed to tell spotify to use XWayland, because of gnome not implementing some server side protocol, I don’t know. I used spicetify-nix, and set wayland to false
Here’s my home module
let
cfg = config.modules.spotify;
inherit (lib) mkEnableOption mkIf;
in {
options.modules.spotify = {
enable = mkEnableOption "Spotify spicetify configuration file";
};
config = mkIf cfg.enable {
programs.spicetify =
let
spicePkgs = inputs.spicetify-nix.legacyPackages.${pkgs.system};
in
{
enable = true;
wayland = false;
# ... other options for my system
};
};
}
Solution for Signal:
For Signal the issue seems to be that it did not pick up the setting for Legacy Applications.
Tweaks: Appearance → Legacy Applications
# dconf.settings = { ...
"org/gnome/desktop/interface" = {
gtk-theme = "Adwaita";
...
};
fixed it for me