Niri: Difference between revisions

DHCP (talk | contribs)
m Configuration: update link (yalter -> niri-wm) in one more place
Ardenet (talk | contribs)
Prepared the page for translation
Line 1: Line 1:
<languages/>
{{DISPLAYTITLE:niri}}
{{DISPLAYTITLE:niri}}
{{infobox application
{{infobox application
Line 14: Line 15:
| latestRelease = 26.04; 25 Apr 2026
| latestRelease = 26.04; 25 Apr 2026
}}
}}
<translate>


<translate>
[https://github.com/niri-wm/niri Niri] is a scrollable-tiling [[Special:MyLanguage/Wayland|Wayland]] compositor.
[https://github.com/niri-wm/niri Niri] is a scrollable-tiling [[Wayland]] compositor.


== Installation ==
== Installation ==


Simply enable {{nixos:option|programs.niri}}:
Simply enable {{nixos:option|programs.niri}}:
</translate>
</translate>
{{file|/etc/nixos/configuration.nix|nix|3=
{{file|/etc/nixos/configuration.nix|nix|3=
programs.niri.enable = true;
programs.niri.enable = true;
}}
}}
{{Note|Niri can be enabled <strong>without installing a custom flake</strong> such as [https://github.com/sodiboo/niri-flake niri-flake]. {{ic|niri-flake}}
<translate> is only necessary if you would like to use a very recent version of Niri or if you would want to write configurations in the Nix language, although as of 2025 this repository is listed near the top in search engines.}}


{{Note|<translate>Niri can be enabled <strong>without installing a custom flake</strong> such as [https://github.com/sodiboo/niri-flake niri-flake]. {{ic|niri-flake}} is only necessary if you would like to use a very recent version of Niri or if you would want to write configurations in the Nix language, although as of 2025 this repository is listed near the top in search engines.</translate>}}
</translate>
 
{{Warning|Without [[#configuration|#Configuration]] or [[#additional-setup|#Additional Setup]], or after a fresh installation, you may be unable to launch apps due to missing expected programs such as Alacritty and fuzzel. Press <kbd>Super</kbd>+<kbd>Shift</kbd>+<kbd>E</kbd> to exit niri and proceed to one of them.}}
{{Warning|<translate>Without [[#Configuration]] or [[#Additional Setup]], or after a fresh installation, you may be unable to launch apps due to missing expected programs such as Alacritty and fuzzel. Press <kbd>Super</kbd>+<kbd>Shift</kbd>+<kbd>E</kbd> to exit niri and proceed to one of them.</translate>}}
<span id="configuration"></span>
 
<translate>
<translate>
== Configuration ==
== Configuration ==


The configuration path for niri is {{ic|$XDG_CONFIG_HOME/niri/config.kdl}}. Therefore [[Home Manager]] can be used for configuration:
The configuration path for niri is {{ic|$XDG_CONFIG_HOME/niri/config.kdl}}. Therefore [[Special:MyLanguage/Home Manager|Home Manager]] can be used for configuration:
 
</translate>
</translate>
{{file|~/.config/home-manager/home.nix|nix|3=
{{file|~/.config/home-manager/home.nix|nix|3=
xdg.configFile."niri/config.kdl".source = ./config.kdl;
xdg.configFile."niri/config.kdl".source = ./config.kdl;
}}
}}
<translate>


<translate>
You might want to start from [https://github.com/niri-wm/niri/blob/main/resources/default-config.kdl the default configuration file] described at [https://github.com/niri-wm/niri/wiki/Getting-Started#main-default-hotkeys].
You might want to start from [https://github.com/niri-wm/niri/blob/main/resources/default-config.kdl the default configuration file] described at [https://github.com/niri-wm/niri/wiki/Getting-Started#main-default-hotkeys].


Line 50: Line 52:
You can start niri with greetd configuration:
You can start niri with greetd configuration:


</translate>
{{file|/etc/nixos/configuration.nix|nix|3=
{{file|/etc/nixos/configuration.nix|nix|3=
programs.niri.enable = true;
programs.niri.enable = true;
Line 69: Line 72:


}}
}}
<span id="additional-setup"></span>
<translate>
== Additional Setup ==


== Additional Setup ==
As described in [https://github.com/niri-wm/niri/wiki/Example-systemd-Setup Example systemd Setup (niri wiki)], you might want to set up some additional services including [[Special:MyLanguage/Swayidle|Swayidle]], [[Special:MyLanguage/Swaylock|Swaylock]], [[Special:MyLanguage/Waybar|Waybar]], [[Special:MyLanguage/Polkit|Polkit]] and [[Special:MyLanguage/Secret Service|Secret Service]] as follows to complement the functionality of a regular window manager. Some of the these settings are also required to enable all the features of [https://github.com/niri-wm/niri/blob/main/resources/default-config.kdl the default configuration file].


As described in [https://github.com/niri-wm/niri/wiki/Example-systemd-Setup Example systemd Setup (niri wiki)], you might want to set up some additional services including [[Swayidle]], [[Swaylock]], [[Waybar]], [[Polkit]] and [[Secret Service]] as follows to complement the functionality of a regular window manager. Some of the these settings are also required to enable all the features of [https://github.com/niri-wm/niri/blob/main/resources/default-config.kdl the default configuration file].
</translate>
</translate>
{{file|3=
{{file|3=
security.polkit.enable = true; # polkit
security.polkit.enable = true; # polkit
Line 82: Line 86:
programs.waybar.enable = true; # top bar
programs.waybar.enable = true; # top bar
environment.systemPackages = with pkgs; [ alacritty fuzzel swaylock mako swayidle ];
environment.systemPackages = with pkgs; [ alacritty fuzzel swaylock mako swayidle ];
|name=/etc/nixos/configuration.nix|lang=nix}}Or using [[Home Manager]]:{{file|~/.config/home-manager/home.nix|nix|3=
|name=/etc/nixos/configuration.nix|lang=nix}}
<translate>Or using [[Special:MyLanguage/Home Manager|Home Manager]]:{{file|~/.config/home-manager/home.nix|nix|3=
programs.alacritty.enable = true; # Super+T in the default setting (terminal)
programs.alacritty.enable = true; # Super+T in the default setting (terminal)
programs.fuzzel.enable = true; # Super+D in the default setting (app launcher)
programs.fuzzel.enable = true; # Super+D in the default setting (app launcher)
Line 95: Line 100:
|name=~/.config/home-manager/home.nix|lang=nix}}
|name=~/.config/home-manager/home.nix|lang=nix}}


<translate>
== Troubleshooting ==
== Troubleshooting ==


=== IME not working on Electron apps ===
=== IME not working on Electron apps ===


There is a general workaround to set {{ic|NIXOS_OZONE_WL}} as described in [[Wayland#Electron_and_Chromium]]:
There is a general workaround to set {{ic|NIXOS_OZONE_WL}} as described in [[Special:MyLanguage/Wayland#Electron_and_Chromium|Wayland#Electron_and_Chromium]]:
 
</translate>
</translate>
{{file|/etc/nixos/configuration.nix|nix|3=
{{file|/etc/nixos/configuration.nix|nix|3=
environment.sessionVariables.NIXOS_OZONE_WL = "1";
environment.sessionVariables.NIXOS_OZONE_WL = "1";
}}
}}
<translate>


<translate>
However, since niri does not support text-input-v1, sometimes enabling text-input-v3 by manually adding {{ic|<nowiki>--wayland-text-input-version=3</nowiki>}} flag is necessary for IME to work:
However, since niri does not support text-input-v1, sometimes enabling text-input-v3 by manually adding {{ic|<nowiki>--wayland-text-input-version=3</nowiki>}} flag is necessary for IME to work:
</translate>


<syntaxhighlight lang=console>
<syntaxhighlight lang=console>
Line 115: Line 118:
</syntaxhighlight>
</syntaxhighlight>


<translate>
<code>wrapProgram</code> may be used to add the flag automatically:
<code>wrapProgram</code> may be used to add the flag automatically:
</translate>
</translate>
{{file|/etc/nixos/configuration.nix|nix|3=
{{file|/etc/nixos/configuration.nix|nix|3=
environment.systemPackages = [
environment.systemPackages = [
Line 128: Line 130:
   };)
   };)
];}}
];}}
<translate>


<translate>
=== XWayland apps not working ===
=== XWayland apps not working ===


There is a optional dependency for niri which is highly recommended to install (you can read [https://github.com/niri-wm/niri/wiki/Xwayland this] article to learn more about this)
There is a optional dependency for niri which is highly recommended to install (you can read [https://github.com/niri-wm/niri/wiki/Xwayland this] article to learn more about this)
</translate>
</translate>
{{File|3=environment.systemPackages = with pkgs; [  
{{File|3=environment.systemPackages = with pkgs; [  
     xwayland-satellite # xwayland support
     xwayland-satellite # xwayland support
];|name=/etc/nixos/configuration.nix|lang=nix}}
];|name=/etc/nixos/configuration.nix|lang=nix}}
<translate>
Or using [[Special:MyLanguage/Home Manager|Home Manager]]


<translate>
Or using [[Home Manager]]
</translate>
</translate>
{{File|3=home.packages = with pkgs; [
{{File|3=home.packages = with pkgs; [
   xwayland-satellite # xwayland support
   xwayland-satellite # xwayland support
];|name=~/.config/home-manager/home.nix|lang=nix}}
];|name=~/.config/home-manager/home.nix|lang=nix}}
<translate>


<translate>
After you installed {{ic|xwayland-satellite}} niri will integrate it out of the box and all of your XWayland apps will function properly.
After you installed {{ic|xwayland-satellite}} niri will integrate it out of the box and all of your XWayland apps will function properly.


Line 155: Line 157:


To work around this problem, you can force usage of the gtk or kde portals for file picker instead:
To work around this problem, you can force usage of the gtk or kde portals for file picker instead:
</translate>
</translate>
{{File|3=xdg.portal.config.niri = {
{{File|3=xdg.portal.config.niri = {
   "org.freedesktop.impl.portal.FileChooser" = [ "gtk" ]; # or "kde"
   "org.freedesktop.impl.portal.FileChooser" = [ "gtk" ]; # or "kde"
};|name=/etc/nixos/configuration.nix|lang=nix}}
};|name=/etc/nixos/configuration.nix|lang=nix}}
<translate>


=== Waybar launches twice ===
=== Waybar launches twice ===
When using a configuration option like programs.waybar.enable, waybar may launch twice on Niri. This is because the [https://github.com/niri-wm/niri/blob/b07bde3ee82dd73115e6b949e4f3f63695da35ea/resources/default-config.kdl#L271 default Niri config file launches waybar on launch]. Remove the spawn-at-startup "waybar" from the config file, or add waybar to your systems packages without using the home-manager option.
When using a configuration option like programs.waybar.enable, waybar may launch twice on Niri. This is because the [https://github.com/niri-wm/niri/blob/b07bde3ee82dd73115e6b949e4f3f63695da35ea/resources/default-config.kdl#L271 default Niri config file launches waybar on launch]. Remove the spawn-at-startup "waybar" from the config file, or add waybar to your systems packages without using the home-manager option.


<translate>
== See Also ==
== See Also ==


* [[Wayland]]
* [[Special:MyLanguage/Wayland|Wayland]]
* [[Sway]]
* [[Special:MyLanguage/Sway|Sway]]
* [[Wallpapers for Wayland]]
* [[Special:MyLanguage/Wallpapers for Wayland|Wallpapers for Wayland]]
* [https://github.com/sodiboo/niri-flake/ niri-flake]
* [https://github.com/sodiboo/niri-flake/ niri-flake]
</translate>
</translate>
[[Category:Window managers]]
[[Category:Window managers]]
[[Category:Applications]]
[[Category:Applications{{#translation:}}]]