From 4fc80124ade72c8ff2b860b1ce4d51ba49a2be13 Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Sat, 20 Apr 2024 11:24:33 +0400 Subject: Move info from README to Getting Started wiki page --- wiki/Getting-Started.md | 125 ++++++++++++++++++++++++++++++++++++++++++++++++ wiki/_Sidebar.md | 1 + 2 files changed, 126 insertions(+) create mode 100644 wiki/Getting-Started.md (limited to 'wiki') diff --git a/wiki/Getting-Started.md b/wiki/Getting-Started.md new file mode 100644 index 00000000..3cac7c56 --- /dev/null +++ b/wiki/Getting-Started.md @@ -0,0 +1,125 @@ +The easiest way to get niri is to install one of the distribution packages. +Here are some of them: [Fedora COPR](https://copr.fedorainfracloud.org/coprs/yalter/niri/) (which I maintain myself), [NixOS Flake](https://github.com/sodiboo/niri-flake), and some more from repology below. +See the [Building](#building) section if you'd like to compile niri yourself. + +[![Packaging status](https://repology.org/badge/vertical-allrepos/niri.svg)](https://repology.org/project/niri/versions) + +After installing, start niri from your display manager like GDM. +Press SuperT to run a terminal ([Alacritty]) and SuperD to run an application launcher ([fuzzel]). +To exit niri, press SuperShiftE. + +If you're not using a display manager, you should run `niri --session` from a TTY. +The `--session` flag will make niri import its environment variables globally into systemd and D-Bus, and start its D-Bus services. + +You can also run `niri` inside an existing desktop session. +Then it will open as a window, where you can give it a try. + +Next, see the [list of important software](./Important-Software.md) required for normal desktop use, like a notification daemon and portals. +Also, check the [configuration overview](./Configuration:-Overview.md) page to get started configuring niri. +There you can find links to other pages containing thorough documentation and examples for all options. +Finally, the [Xwayland](./Xwayland.md) page explains how to run X11 applications on niri. + +### Virtual Machines + +To run niri in a VM, make sure to enable 3D acceleration. + +## Default Hotkeys + +When running on a TTY, the Mod key is Super. +When running in a window, the Mod key is Alt. + +The general system is: if a hotkey switches somewhere, then adding Ctrl will move the focused window or column there. + +| Hotkey | Description | +| ------ | ----------- | +| ModShift/ | Show a list of important niri hotkeys | +| ModT | Spawn `alacritty` (terminal) | +| ModD | Spawn `fuzzel` (application launcher) | +| ModAltL | Spawn `swaylock` (screen locker) | +| ModQ | Close the focused window | +| ModH or Mod | Focus the column to the left | +| ModL or Mod | Focus the column to the right | +| ModJ or Mod | Focus the window below in a column | +| ModK or Mod | Focus the window above in a column | +| ModCtrlH or ModCtrl | Move the focused column to the left | +| ModCtrlL or ModCtrl | Move the focused column to the right | +| ModCtrlJ or ModCtrl | Move the focused window below in a column | +| ModCtrlK or ModCtrl | Move the focused window above in a column | +| ModHome and ModEnd | Focus the first or the last column | +| ModCtrlHome and ModCtrlEnd | Move the focused column to the very start or to the very end | +| ModShiftHJKL or ModShift | Focus the monitor to the side | +| ModCtrlShiftHJKL or ModCtrlShift | Move the focused column to the monitor to the side | +| ModU or ModPageDown | Switch to the workspace below | +| ModI or ModPageUp | Switch to the workspace above | +| ModCtrlU or ModCtrlPageDown | Move the focused column to the workspace below | +| ModCtrlI or ModCtrlPageUp | Move the focused column to the workspace above | +| Mod19 | Switch to a workspace by index | +| ModCtrl19 | Move the focused column to a workspace by index | +| ModShiftU or ModShiftPageDown | Move the focused workspace down | +| ModShiftI or ModShiftPageUp | Move the focused workspace up | +| Mod, | Consume the window to the right into the focused column | +| Mod. | Expel the focused window into its own column | +| ModR | Toggle between preset column widths | +| ModF | Maximize column | +| ModC | Center column within view | +| Mod- | Decrease column width by 10% | +| Mod= | Increase column width by 10% | +| ModShift- | Decrease window height by 10% | +| ModShift= | Increase window height by 10% | +| ModShiftF | Toggle full-screen on the focused window | +| PrtSc | Take an area screenshot. Select the area to screenshot with mouse, then press Space to save the screenshot, or Escape to cancel | +| AltPrtSc | Take a screenshot of the focused window to clipboard and to `~/Pictures/Screenshots/` | +| CtrlPrtSc | Take a screenshot of the focused monitor to clipboard and to `~/Pictures/Screenshots/` | +| ModShiftE | Exit niri | + +## Building + +First, install the dependencies for your distribution. + +- Ubuntu 23.10: + + ```sh + sudo apt-get install -y gcc clang libudev-dev libgbm-dev libxkbcommon-dev libegl1-mesa-dev libwayland-dev libinput-dev libdbus-1-dev libsystemd-dev libseat-dev libpipewire-0.3-dev libpango1.0-dev + ``` + +- Fedora: + + ```sh + sudo dnf install gcc libudev-devel libgbm-devel libxkbcommon-devel wayland-devel libinput-devel dbus-devel systemd-devel libseat-devel pipewire-devel pango-devel cairo-gobject-devel clang + ``` + +Next, get latest stable Rust: https://rustup.rs/ + +Then, build niri with `cargo build --release`. + +Check Cargo.toml for a list of build features. +For example, you can replace systemd integration with dinit integration using `cargo build --release --no-default-features --features dinit,dbus,xdp-gnome-screencast`. + +### NixOS/Nix + +We have a community-maintained flake which provides a devshell with required dependencies. Use `nix build` to build niri, and then run `./results/bin/niri`. + +If you're not on NixOS, you may need [NixGL](https://github.com/nix-community/nixGL) to run the resulting binary: + +``` +nix run --impure github:guibou/nixGL -- ./results/bin/niri +``` + +### Installation + +The recommended way to install and run niri is as a standalone desktop session. +To do that, put files into the correct directories according to this table. + +| File | Destination | +| ---- | ----------- | +| `target/release/niri` | `/usr/bin/` | +| `resources/niri-session` | `/usr/bin/` | +| `resources/niri.desktop` | `/usr/share/wayland-sessions/` | +| `resources/niri-portals.conf` | `/usr/share/xdg-desktop-portal/` | +| `resources/niri.service` | `/usr/lib/systemd/user/` | +| `resources/niri-shutdown.target` | `/usr/lib/systemd/user/` | + +Doing this will make niri appear in GDM and other display managers. + +[Alacritty]: https://github.com/alacritty/alacritty +[fuzzel]: https://codeberg.org/dnkl/fuzzel diff --git a/wiki/_Sidebar.md b/wiki/_Sidebar.md index d6d7cdad..fd5f9639 100644 --- a/wiki/_Sidebar.md +++ b/wiki/_Sidebar.md @@ -1,4 +1,5 @@ ## Usage +* [Getting Started](./Getting-Started.md) * [Example systemd Setup](./Example-systemd-Setup.md) * [Important Software](./Important-Software.md) * [Layer‐Shell Components](./Layer%E2%80%90Shell-Components.md) -- cgit