Niri/zh: Difference between revisions

Ardenet (talk | contribs)
Created page with "== 安装 =="
Ardenet (talk | contribs)
Created page with "Niri"
Tags: Mobile edit Mobile web edit
 
(11 intermediate revisions by the same user not shown)
Line 21: Line 21:
== 安装 ==
== 安装 ==


<div lang="en" dir="ltr" class="mw-content-ltr">
只需启用 {{nixos:option|programs.niri}}
Simply enable {{nixos:option|programs.niri}}:
</div>


{{file|/etc/nixos/configuration.nix|nix|3=
{{file|/etc/nixos/configuration.nix|nix|3=
Line 29: Line 27:
}}
}}


{{Note|<span lang="en" dir="ltr" class="mw-content-ltr">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.</span>}}
{{Note|<strong>无需安装自定义 flake</strong>(例如 [https://github.com/sodiboo/niri-flake niri-flake])即可启用 Niri。尽管截至 2025 年,该存储库在搜索引擎中的排名仍然靠前,但只有当您想要使用最新版本的 Niri 或想要用 Nix 语言编写配置时,才需要 {{ic|niri-flake}}}}




{{Warning|<span lang="en" dir="ltr" class="mw-content-ltr">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.</span>}}
{{Warning|如果没有进行 [[#Configuration|配置]] [[#Additional Setup|附加设置]],或者在全新安装后,您可能由于缺少 Alacritty fuzzel 等预期程序而无法启动应用程序。请按 <kbd>Super</kbd>+<kbd>Shift</kbd>+<kbd>E</kbd> 退出 niri 并继续执行其中一项操作。}}




<div lang="en" dir="ltr" class="mw-content-ltr">
<span id="Configuration"></span>
== Configuration ==
== 配置 ==
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
niri 的配置路径为 {{ic|$XDG_CONFIG_HOME/niri/config.kdl}}。因此,可以使用 [[Special:MyLanguage/Home Manager|Home Manager]] 进行配置:
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:
</div>


{{file|~/.config/home-manager/home.nix|nix|3=
{{file|~/.config/home-manager/home.nix|nix|3=
Line 47: Line 42:
}}
}}


<div lang="en" dir="ltr" class="mw-content-ltr">
您可能想从[https://github.com/niri-wm/niri/blob/main/resources/default-config.kdl 默认配置文件]开始,如[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 here].
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
有关 niri 的配置选项,请参阅 [https://niri-wm.github.io/niri/ wiki]
See [https://niri-wm.github.io/niri/ the wiki] for configuration options for niri.
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
=== Greetd ===
=== Greetd ===
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
您可以使用 greeted 配置启动 niri
You can start niri with greetd configuration:
</div>


{{file|/etc/nixos/configuration.nix|nix|3=
{{file|/etc/nixos/configuration.nix|nix|3=
Line 83: Line 70:
}}
}}


<div lang="en" dir="ltr" class="mw-content-ltr">
<span id="Additional_Setup"></span>
== Additional Setup ==
== 额外设置 ==
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
[https://github.com/niri-wm/niri/wiki/Example-systemd-Setup 示例 systemd 设置 (niri wiki)]中所述,您可能需要设置一些额外的服务,包括以下的 [[Special:MyLanguage/Swayidle|Swayidle]][[Special:MyLanguage/Swaylock|Swaylock]][[Special:MyLanguage/Waybar|Waybar]][[Special:MyLanguage/Polkit|Polkit]] [[Special:MyLanguage/Secret Service|Secret Service]],以补充常规窗口管理器的功能。其中一些设置也是启用[https://github.com/niri-wm/niri/blob/main/resources/default-config.kdl 默认配置文件]所有功能所必需的。
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].
</div>


{{file|3=
{{file|3=
Line 100: Line 84:
|name=/etc/nixos/configuration.nix|lang=nix}}
|name=/etc/nixos/configuration.nix|lang=nix}}


<div lang="en" dir="ltr" class="mw-content-ltr">
或者使用 [[Special:MyLanguage/Home Manager|Home Manager]]
Or using [[Special:MyLanguage/Home Manager|Home Manager]]:
</div>


{{file|~/.config/home-manager/home.nix|nix|3=
{{file|~/.config/home-manager/home.nix|nix|3=
Line 117: Line 99:
|name=~/.config/home-manager/home.nix|lang=nix}}
|name=~/.config/home-manager/home.nix|lang=nix}}


<div lang="en" dir="ltr" class="mw-content-ltr">
<span id="Troubleshooting"></span>
== Troubleshooting ==
== 故障排除 ==
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
<span id="IME_not_working_on_Electron_apps"></span>
=== IME not working on Electron apps ===
=== IME Electron 应用中无法正常工作 ===
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
<div lang="en" dir="ltr" class="mw-content-ltr">
Line 155: Line 135:
];}}
];}}


<div lang="en" dir="ltr" class="mw-content-ltr">
<span id="XWayland_apps_not_working"></span>
=== XWayland apps not working ===
=== XWayland 应用无法正常工作 ===
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
<div lang="en" dir="ltr" class="mw-content-ltr">
Line 179: Line 158:
</div>
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
<span id="File_picker_not_working"></span>
=== File picker not working ===
=== 文件选择器无法正常工作 ===
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
<div lang="en" dir="ltr" class="mw-content-ltr">
Line 195: Line 173:
};|name=/etc/nixos/configuration.nix|lang=nix}}
};|name=/etc/nixos/configuration.nix|lang=nix}}


<div lang="en" dir="ltr" class="mw-content-ltr">
<span id="Waybar_launches_twice"></span>
=== Waybar launches twice ===
=== Waybar 启动两次 ===
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
<div lang="en" dir="ltr" class="mw-content-ltr">
Line 203: Line 180:
</div>
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
<span id="See_Also"></span>
== See Also ==
== 另见 ==
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
* [[Special:MyLanguage/Wayland|Wayland]]
* [[Special:MyLanguage/Wayland|Wayland]]
* [[Special:MyLanguage/Sway|Sway]]
* [[Special:MyLanguage/Sway|Sway]]
* [[Special:MyLanguage/Wallpapers for Wayland|Wallpapers for Wayland]]
* [[Special:MyLanguage/Wallpapers for Wayland|用于 Wayland 的壁纸]]
* [https://github.com/sodiboo/niri-flake/ niri-flake]
* [https://github.com/sodiboo/niri-flake/ niri-flake]
</div>


[[Category:Window managers]]
[[Category:Window managers]]
[[Category:Applications{{#translation:}}]]
[[Category:Applications{{#translation:}}]]