Jump to content

UWSM: Difference between revisions

From Official NixOS Wiki
Phobos (talk | contribs)
Initial Page creation for UWSM
 
Phobos (talk | contribs)
mNo edit summary
 
(One intermediate revision by the same user not shown)
Line 21: Line 21:
=== Hyprland ===
=== Hyprland ===


===== Standalone Hyprland with UWSM =====
Hyprland has a built in option for UWSM that will automatically handle setup. Automatically starts appropriate targets such as <code>graphical-session.target</code>, and <code>wayland-session@Hyprland.target</code>. This option is recommended for if you are using Hyprland standalone, and do not need to configure alternative entries for UWSM. Usage of both options in conjunction may run into issues.


Additional information may be found on the [[Hyprland|Hyprland page]].
{{Note|Some changes may need to be made to Hyprland configs depending on your setup, see the [https://wiki.hypr.land/Useful-Utilities/Systemd-start/#uwsm&#124;Hyprland's UWSM wiki Page].}}{{File|3=programs.hyprland = {
  enable = true;
  withUWSM = true;
};|name=/etc/nixos/configuration.nix|lang=nix}}
 
===== If using the Hyprland Home Manager Module =====
If you use the Home Manager module, make sure to disable the systemd integration as it conflicts with UWSM.<ref>https://wiki.hypr.land/Useful-Utilities/Systemd-start/#uwsm</ref>
 
{{File|3=wayland.windowManager.hyprland.systemd.enable = false;|name=/etc/nixos/home.nix|lang=nix}}

Latest revision as of 04:03, 13 December 2025

UWSM (Universal Wayland Session Manager), wraps standalone Wayland compositors with a set of Systemd units on the fly. This essentially binds the Wayland compositor into graphical-session-pre.target, graphical-session.target, xdg-desktop-autostart.target.

This is useful for Wayland compositors like Hyprland, Sway, Wayfire, etc. that do not start these targets and services on their own.

Additional information may be found on the UWSM Github, or the Arch Wiki page.

Installation

Options may be found under programs.uwsm in Nix options. An example using Sway with UWSM:

❄︎ /etc/nixos/configuration.nix
programs.uwsm = {
  enable = true;
  # You must configure the waylandCompositors suboptions so that UWSM knows which compositors to manage. 
  waylandCompositors = {
    sway = {
      prettyName = "Sway";
      comment = "Sway compositor managed by UWSM";
      binPath = "/run/current-system/sw/bin/sway";
    };
  };
};
Note: This by default uses dbus-broker as the dbus implementation for better compatibility. If you dislike this behavior you may set services.dbus.implementation = lib.mkForce "dbus" in your configuration.

Hyprland

Standalone Hyprland with UWSM

Hyprland has a built in option for UWSM that will automatically handle setup. Automatically starts appropriate targets such as graphical-session.target, and wayland-session@Hyprland.target. This option is recommended for if you are using Hyprland standalone, and do not need to configure alternative entries for UWSM. Usage of both options in conjunction may run into issues.

Note: Some changes may need to be made to Hyprland configs depending on your setup, see the UWSM wiki Page.
❄︎ /etc/nixos/configuration.nix
programs.hyprland = {
  enable = true;
  withUWSM = true;
};
If using the Hyprland Home Manager Module

If you use the Home Manager module, make sure to disable the systemd integration as it conflicts with UWSM.[1]

❄︎ /etc/nixos/home.nix
wayland.windowManager.hyprland.systemd.enable = false;