Hyprland: Difference between revisions

Normalcea (talk | contribs)
m NixOS 24.05 and Below: Remove function parameters to make snippet clearer.
Hannses (talk | contribs)
screensharing
 
(11 intermediate revisions by 3 users not shown)
Line 10: Line 10:


== Installation ==
== Installation ==
=== NixOS 24.11 and Onwards ===
NixOS 24.11 added support for launching Hyprland with [https://github.com/Vladimir-csp/uwsm Universal Wayland Session Manager] (UWSM) and is the recommended way to launch Hyprland as it neatly integrates with [[Systemd]].
NixOS 24.11 added support for launching Hyprland with [https://github.com/Vladimir-csp/uwsm Universal Wayland Session Manager] and is the recommended way to launch Hyprland as it neatly integrates with [[Systemd]].


{{file|configuration.nix|nix|<nowiki>
{{file|configuration.nix|nix|<nowiki>
Line 18: Line 17:
     enable = true;
     enable = true;
     withUWSM = true; # recommended for most users
     withUWSM = true; # recommended for most users
    xwayland.enable = true; # Xwayland can be disabled.
  };
}
</nowiki>}}
=== NixOS 24.05 and Below ===
{{file|configuration.nix|nix|<nowiki>
{
  programs.hyprland = {
    enable = true;
     xwayland.enable = true; # Xwayland can be disabled.
     xwayland.enable = true; # Xwayland can be disabled.
   };
   };
Line 100: Line 88:
</nowiki>}}
</nowiki>}}


If you experience performance drops in video games or graphics tools like Blender on stable NixOS, then it's likely a [[Mesa]] version mismatch with Hyprland and the rest of your system. This can be fixed by substituting the system's mesa package with Hyprland's own.
If you experience performance drops in video games or graphics tools like Blender on stable NixOS, then it's likely a [[Mesa]] version mismatch with Hyprland and the rest of your system. This can be fixed by substituting the system's mesa package with Hyprland's own. '''Note that the''' <code>hardware.opengl</code> '''option only exists 24.05 and below'''. 


{{file|configuration.nix|nix|<nowiki>
{{file|configuration.nix|nix|<nowiki>
Line 127: Line 115:
}
}
</nowiki>}}
</nowiki>}}
=== Screensharing ===
{{file|configuration.nix|nix|<nowiki>
{
  xdg.portal = {
    enable = true;
    extraPortals = with pkgs; [ xdg-desktop-portal-hyprland ];
  };
}
</nowiki>}}


=== Display Manager Support ===
=== Display Manager Support ===
Line 209: Line 208:


[https://github.com/hyprland-community/awesome-hyprland#plugins List of plugins]
[https://github.com/hyprland-community/awesome-hyprland#plugins List of plugins]
== Troubleshooting ==
== Troubleshooting ==
=== Swaylock ===
=== Swaylock ===
Line 218: Line 214:
security.pam.services.swaylock = {};
security.pam.services.swaylock = {};
</code>
</code>
=== Electron applications defaulting to X11 rather than Wayland ===
Set the environment variable <code>NIXOS_OZONE_WL</code> to "1" in your NixOS configuration:
{{file|configuration.nix|nix|<nowiki>
{
  environment.sessionVariables.NIXOS_OZONE_WL = "1";
}
</nowiki>}}
=== Theme Support ===
To make themes consistent in Hyprland, you can either use Home Manager like this:
{{file|/etc/nixos/home.nix or ~/.config/home-manager/home.nix|nix|<nowiki>
{
  home.pointerCursor = {
    gtk.enable = true;
    # x11.enable = true;
    package = pkgs.bibata-cursors;
    name = "Bibata-Modern-Classic";
    size = 16;
  };
  gtk = {
    enable = true;
    theme = {
      package = pkgs.flat-remix-gtk;
      name = "Flat-Remix-GTK-Grey-Darkest";
    };
    iconTheme = {
      package = pkgs.adwaita-icon-theme;
      name = "Adwaita";
    };
    font = {
      name = "Sans";
      size = 11;
    };
  };
}
</nowiki>}}
or set themes using dconf in your Hyprland configuration file:
{{file|hyprland.conf|conf|<nowiki>
exec-once = dconf write /org/gnome/desktop/interface/gtk-theme "'Adwaita'"
exec-once = dconf write /org/gnome/desktop/interface/icon-theme "'Flat-Remix-Red-Dark'"
exec-once = dconf write /org/gnome/desktop/interface/document-font-name "'Noto Sans Medium 11'"
exec-once = dconf write /org/gnome/desktop/interface/font-name "'Noto Sans Medium 11'"
exec-once = dconf write /org/gnome/desktop/interface/monospace-font-name "'Noto Sans Mono Medium 11'"
</nowiki>}}You may also install graphical tools such as gnome tweaks or nwg-look to set the themes manually.


== See also ==
== See also ==