Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add uwsm instructions #850

Merged
merged 52 commits into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from 47 commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
0d0cd83
Update Environment-variables.md
izmyname Nov 7, 2024
8eb9dcf
Update Environment-variables.md
izmyname Nov 7, 2024
615d85e
Edit callout type
izmyname Nov 7, 2024
d848918
Update Master-Tutorial.md
izmyname Nov 7, 2024
0d0e98b
Update Master-Tutorial.md
izmyname Nov 7, 2024
c5e7f88
Add instructions to directly start Hyprland with uwsm
izmyname Nov 7, 2024
dfe2cd2
Update Dispatchers.md
izmyname Nov 7, 2024
3287676
oops
izmyname Nov 7, 2024
4c9e536
Create Systemd-start.md
izmyname Nov 7, 2024
4c069dd
Update Other.md
izmyname Nov 7, 2024
f62056d
Update hypridle.md
izmyname Nov 8, 2024
5abf196
Update hyprpaper.md
izmyname Nov 8, 2024
e5a265d
Update hyprpolkitagent.md
izmyname Nov 8, 2024
01cc387
Update Status-Bars.md
izmyname Nov 8, 2024
00edfad
Update Systemd-start.md
izmyname Nov 8, 2024
d9055b8
Update Systemd-start.md
izmyname Nov 8, 2024
fd26a5d
Update Dispatchers.md
izmyname Nov 8, 2024
41006dd
Update Environment-variables.md
izmyname Nov 8, 2024
a0609f4
Update Status-Bars.md
izmyname Nov 8, 2024
8f4d61a
Update hypridle.md
izmyname Nov 8, 2024
da4daa3
Update hyprpaper.md
izmyname Nov 8, 2024
4008b42
Update hyprpolkitagent.md
izmyname Nov 8, 2024
981cb1f
Update Master-Tutorial.md
izmyname Nov 8, 2024
54ad1d2
Update Master-Tutorial.md
izmyname Nov 8, 2024
773a1c0
Update Systemd-start.md
izmyname Nov 8, 2024
1cecddb
Update pages/Configuring/Dispatchers.md
izmyname Nov 8, 2024
4593fab
Update pages/Useful Utilities/Systemd-start.md
izmyname Nov 8, 2024
356451b
Update pages/Useful Utilities/Systemd-start.md
izmyname Nov 8, 2024
7c5ccc2
Update pages/Getting Started/Master-Tutorial.md
izmyname Nov 8, 2024
0255b96
Update pages/Useful Utilities/Systemd-start.md
izmyname Nov 8, 2024
122aa07
Update Systemd-start.md
izmyname Nov 8, 2024
ad2a476
Update Systemd-start.md
izmyname Nov 8, 2024
90031ad
Update Systemd-start.md
izmyname Nov 8, 2024
087a349
Update Systemd-start.md
izmyname Nov 8, 2024
c7eb726
Update Systemd-start.md
izmyname Nov 8, 2024
35d931b
formatting fixes
fufexan Nov 8, 2024
22addec
Update pages/Useful Utilities/Systemd-start.md
izmyname Nov 8, 2024
ed30b72
fix
izmyname Nov 8, 2024
3734a37
fix 2
izmyname Nov 8, 2024
1e494e1
Update Master-Tutorial.md
izmyname Nov 8, 2024
009968f
spelling 1
izmyname Nov 8, 2024
1466e10
spelling 2
izmyname Nov 8, 2024
c87794b
Update pages/Useful Utilities/Systemd-start.md
izmyname Nov 8, 2024
09b0247
Add a simple example for exec-once
izmyname Nov 9, 2024
3624361
Update pages/Useful Utilities/Systemd-start.md
izmyname Nov 9, 2024
60e4645
Merge branch 'hyprwm:main' into main
izmyname Nov 9, 2024
5968c75
Update pages/Hypr Ecosystem/hyprpolkitagent.md
izmyname Nov 9, 2024
071dd40
Update pages/Configuring/Dispatchers.md
izmyname Nov 9, 2024
b91f3bf
Update pages/Configuring/Dispatchers.md
izmyname Nov 9, 2024
1986c91
Merge branch 'hyprwm:main' into main
izmyname Nov 9, 2024
5396fd0
Merge branch 'hyprwm:main' into main
izmyname Nov 10, 2024
aad67f3
Remove gdb make dependency
izmyname Nov 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions pages/Configuring/Dispatchers.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,14 @@ layout pages (See the sidebar).

{{< callout type=warning >}}

[uwsm](../../Systemd-start) users should avoid using `exit` dispatcher, as exiting Hyprland this way causes various systemd-related problems after restarting the compositor, such xdg-desktop-portal-hyprland and other services do not restart. Use `loginctl terminate-user ""` instead.

It's also strongly advised to replace the `exit` dispatcher with `loginctl terminate-user ""` inside `hyprland.conf` keybinds section.

{{< /callout >}}

{{< callout type=warning >}}

It is NOT recommended to set DPMS with a keybind directly, as it might cause
undefined behavior. Instead, consider something like

Expand Down
6 changes: 6 additions & 0 deletions pages/Configuring/Environment-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ them explicitly.
If your [desktop portal](https://wiki.archlinux.org/title/XDG_Desktop_Portal) is malfunctioning for seemingly
no reason (no errors), it's likely your XDG env isn't set correctly.

{{< callout type=info >}}

[uwsm](../../Systemd-start) users don't need to explicitly set XDG environment variables, as uwsm sets them, automatically.

{{< /callout >}}

## Qt Variables

- `env = QT_AUTO_SCREEN_SCALE_FACTOR,1` -
Expand Down
3 changes: 2 additions & 1 deletion pages/Getting Started/Master-Tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ Please bear in mind 3D acceleration in VMs may be pretty slow.

Hyprland can be executed by typing `Hyprland` in your tty.

Systemd users can also start Hyprland, by typing `systemctl --user start hyprland-session.service` in tty. This method provides additional features, such as [xdg-autostart](https://www.freedesktop.org/software/systemd/man/latest/systemd-xdg-autostart-generator.html) support and ability to enable services for programs that rely on a graphical session and provide such services (e.g waybar).
Systemd users can also start Hyprland, using [uwsm](https://github.com/Vladimir-csp/uwsm). This is the recommended method of launching Hyprland on systemd-based distros, as it provides additional features such as [xdg-autostart](https://www.freedesktop.org/software/systemd/man/latest/systemd-xdg-autostart-generator.html) support, launching any application as a systemd-unit with `uwsm app` helper, and the ability to enable services for programs that rely on a graphical session and provide such services (e.g waybar). See [uwsm](../../Systemd-start) page for further instructions.


{{< callout type=warning >}}

Expand Down
2 changes: 1 addition & 1 deletion pages/Hypr Ecosystem/hypridle.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ hypridle is Hyprland's idle management daemon.

Configuration is done via the config file at `~/.config/hypr/hypridle.conf`. A
config file is required; hypridle won't run without one. To run hypridle at
startup, edit `hyprland.conf` and add: `exec-once = hypridle`. If Hyprland is started as a systemd service, you can use `systemctl --user enable --now hypridle.service`.
startup, edit `hyprland.conf` and add: `exec-once = hypridle`. If Hyprland is started with [uwsm](../../Systemd-start), you can use `systemctl --user enable --now hypridle.service`.

### General

Expand Down
2 changes: 1 addition & 1 deletion pages/Hypr Ecosystem/hyprpaper.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ preload another and set it to your monitor(s). It has the same syntax as
### Run at startup

To run hyprpaper at startup edit `hyprland.conf` and add: `exec-once =
hyprpaper`. If you start Hyprland as a systemd service, you can also use `systemctl --user enable --now hyprpaper.service` command.
hyprpaper`. If you start Hyprland with [uwsm](../../Systemd-start), you can also use `systemctl --user enable --now hyprpaper.service` command.

### Misc options

Expand Down
2 changes: 1 addition & 1 deletion pages/Hypr Ecosystem/hyprpolkitagent.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ or use a different agent, e.g. [KDE's one](https://github.com/KDE/polkit-kde-age
Add `exec-once = systemctl --user start hyprpolkitagent` to your Hyprland config and restart hyprland.
(obviously change that to whatever you are using if you are not using the hypr one)

If Hyprland is started as a systemd service, you can autostart for polkit with the command `systemctl --user enable --now hyprpolkitagent.service`.
If Hyprland is started with [uwsm](../../Systemd-start), you can autostart the polkit agent with the command `systemctl --user enable --now hyprpolkitagent.service`.

On distributions that use a different init system, such as Gentoo, it may be
necessary to use
Expand Down
4 changes: 0 additions & 4 deletions pages/Useful Utilities/Other.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,6 @@ exec-once = udiskie

[See more uses here](https://github.com/coldfix/udiskie/wiki/Usage).

### Advanced Systemd Session Management

[UWSM](https://github.com/Vladimir-csp/uwsm) by _Vladimir-csp_: Wraps standalone Wayland compositors into a set of Systemd units on the fly. Provides robust session management including environment, XDG autostart support, bi-directional binding with login session, login shell integration, and clean shutdown. Optional user unit control utility via dmenu-like menu, failed unit monitor.

### Other useful utilities

The website [We Are Wayland Now](https://wearewaylandnow.com/) details some other useful utilities and applications for Wayland like docks, email clients, and so on, along with some other useful information about compatibility on Wayland.
6 changes: 6 additions & 0 deletions pages/Useful Utilities/Status-Bars.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ Hyprland, add this line to your Hyprland configuration:
exec-once = waybar
```

Waybar also provides a systemd service. If you use Hyprland with [uwsm](../../Systemd-start), you can enable it, using the following command.

```ini
systemctl --user enable --now waybar.service
```

### Waybar FAQ

#### Waybar popups render behind the windows
Expand Down
102 changes: 102 additions & 0 deletions pages/Useful Utilities/Systemd-start.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
---
weight: 12
title: Systemd startup
---

## UWSM

- [Universal Wayland Session Manager](https://github.com/Vladimir-csp/uwsm) is a recommended way to start Hyprland session on systemd distros. uwsm wraps standalone Wayland compositors into a set of Systemd units and provides robust session management including environment, XDG autostart support, bi-directional binding with login session, and clean shutdown.

## Installation

{{% details title="Arch" closed="true" %}}

uwsm is available in AUR. You can install it either with an AUR helper, or build PKGBUILD manually. Here's an example for yay.

```sh
yay -S uwsm
```

{{% /details %}}

{{% details title="Nix/NixOS" closed="true" %}}

```nix
programs.uwsm = {
enable = true;
waylandCompositors.hyprland = {
binPath = "/run/current-system/sw/bin/Hyprland";
comment = "Hyprland session managed by uwsm";
prettyName = "Hyprland";
};
};
```

The above option generates a new desktop entry, `hyprland-uwsm.desktop`, which will be available in display managers.

For more info, read the [option](https://search.nixos.org/options?channel=unstable&show=programs.uwsm.enable&from=0&size=50&sort=relevance&type=packages&query=uwsm).

{{< callout >}}

If you use the [Home Manager module](../../Nix/Hyprland-on-Home-Manager), make sure to disable the systemd integration, as it conflicts with uwsm.

```nix
wayland.windowManager.hyprland.systemd.enable = false;
```

{{< /callout >}}

{{% /details %}}

{{< callout type=info >}}

For instructions for other distros and manual building, see [building and installing](https://github.com/Vladimir-csp/uwsm?tab=readme-ov-file#installation) section on the project's page.

{{< /callout >}}

## Launching Hyprland with uwsm

{{< callout type=info >}}

Pay attention to the warnings in [Environment variables](../../Environment-variables#xdg-specifications) and [Dispatchers](../../Dispatchers) sections.

{{< /callout >}}

### In tty

To launch Hyprland with uwsm, add this code in your shell profile.

```
if uwsm check may-start && uwsm select; then
exec systemd-cat -t uwsm_start uwsm start default
fi
```

This will bring uwsm compositor selection menu after you log in tty1. Choose Hyprland entry and you're good to go.

If you want to bypass compositor selection menu and launch Hyprland directly, use this code in your shell profile, instead.

```
if uwsm check may-start; then
exec uwsm start hyprland.desktop
fi
```

### Using a display manager

If you use a display manager, choose `hyprland (uwsm-managed)` entry in a display manager selection menu.

## Launching applications inside session

The concept of a session managed by Systemd implies also running applications as units. Uwsm [provides](https://github.com/Vladimir-csp/uwsm#3-applications-and-slices) a helper to do it.

Prefix application startup commands with `uwsm app --`. It also supports launching Desktop Entries by IDs or paths. See `man uwsm` or `uwsm app --help`.

Examples for autostart and bind entries:

```
exec-once = uwsm app -- mycommand --arg1 --arg2
bind = SUPER, E, exec, uwsm app -- pcmanfm-qt.desktop
```

Running applications as child processes inside compositor's unit is discouraged.