Hyprland: Difference between revisions
Confusedalex (talk | contribs) mNo edit summary |
m Updates |
||
| (8 intermediate revisions by 6 users not shown) | |||
| Line 1: | Line 1: | ||
[https://hyprland.org/ Hyprland] is an independent, extensible, bleeding-edge [[Wayland]] compositor written in modern C++ with an emphasis on looks. In addition, Hyprland also offers a number of first-party tools as well as a custom plugin system. The most up-to-date and complete documentation | [https://hyprland.org/ Hyprland] is an independent, extensible, bleeding-edge [[Wayland]] compositor written in modern C++ with an emphasis on looks. In addition, Hyprland also offers a number of first-party tools as well as a custom plugin system. The most up-to-date and complete documentation may be found on the project's own [https://wiki.hyprland.org/ wiki]. | ||
Some of the most notable features of Hyprland are: | Some of the most notable features of Hyprland are: | ||
* '''Independent Wayland implementation''': | * '''Independent Wayland implementation''': Does not rely on wlroots or other external libraries, and provides an in-house alternatives to common components (screen locking, idle daemon, etc). | ||
* '''Easy to configure''': | * '''Easy to configure''': Uses a live reloading config file in plain-text with useful defaults. | ||
* '''Dynamic tiling support''': | * '''Dynamic tiling support''': Supports both automatic tiling and floating mode with multiple layouts. | ||
* '''Socket-based IPC''': | * '''Socket-based IPC''': Allows controlling the compositor at runtime via UNIX socket. | ||
* '''Global shortcuts''': | * '''Global shortcuts''': Permits setting global keybinds for any application (for apps such as [[OBS Studio]]). | ||
* '''Window/Workspace Rules''': | * '''Window/Workspace Rules''': Set special behaviors for certain windows and workspaces. | ||
== Installation == | == Installation == | ||
NixOS 24.11 added support for launching Hyprland with [https://github.com/Vladimir-csp/uwsm Universal Wayland Session Manager] (UWSM) and is the recommended way to launch Hyprland as it neatly integrates with [[Systemd]]. | NixOS 24.11 added support for launching Hyprland with [https://github.com/Vladimir-csp/uwsm Universal Wayland Session Manager] (UWSM) and is the recommended way to launch Hyprland as it neatly integrates with [[Systemd]]. [[UWSM|Options for configuring UWSM may be found here]]. Also see the Hyprland wiki [https://wiki.hypr.land/Useful-Utilities/Systemd-start/#uwsm page for UWSM here]. | ||
{{file| | {{file|||<nowiki> | ||
{ | { | ||
programs.hyprland = { | programs.hyprland = { | ||
| Line 20: | Line 20: | ||
}; | }; | ||
} | } | ||
</nowiki>}} | </nowiki>|name=/etc/nixos/configuration.nix|lang=nix}}{{Warning|If you use the Home Manager module, make sure to disable systemd integration, as it conflicts with UWSM. | ||
</br> | |||
{{File|3=wayland.windowManager.hyprland.systemd.enable = false; | |||
|name=/etc/nixos/home.nix|lang=nix}}}} | |||
=== Nix on Non-NixOS Systems === | === Nix on Non-NixOS Systems === | ||
| Line 47: | Line 50: | ||
* '''hyprlock''': Hyprland's GPU-accelerated screen locking utility. | * '''hyprlock''': Hyprland's GPU-accelerated screen locking utility. | ||
* '''hypridle''': Hyprland's idle daemon. | * '''hypridle''': Hyprland's idle daemon. | ||
* | * [[hyprpaper]]: Hyprland's wallpaper utility. | ||
* '''hyprsunset''': Application to enable a blue-light filter on Hyprland. | * '''hyprsunset''': Application to enable a blue-light filter on Hyprland. | ||
* '''hyprpicker''': Wayland color picker that does not suck. | * '''hyprpicker''': Wayland color picker that does not suck. | ||
| Line 88: | Line 91: | ||
</nowiki>}} | </nowiki>}} | ||
If you experience performance drops in video games or graphics tools like Blender on stable NixOS, then it's likely a [[Mesa]] version mismatch with Hyprland and the rest of your system. This can be fixed by substituting the system's mesa package with Hyprland's own. | If you experience performance drops in video games or graphics tools like Blender on stable NixOS, then it's likely a [[Mesa]] version mismatch with Hyprland and the rest of your system. This can be fixed by substituting the system's mesa package with Hyprland's own. | ||
{{file| | {{file|3=<nowiki> | ||
{pkgs, inputs, ...}: let | {pkgs, inputs, ...}: let | ||
pkgs-unstable = inputs.hyprland.inputs.nixpkgs.legacyPackages.${pkgs.stdenv.hostPlatform.system}; | pkgs-unstable = inputs.hyprland.inputs.nixpkgs.legacyPackages.${pkgs.stdenv.hostPlatform.system}; | ||
in { | in { | ||
hardware. | hardware.graphics = { | ||
package = pkgs-unstable.mesa | package = pkgs-unstable.mesa; | ||
# if you also want 32-bit support (e.g for Steam) | # if you also want 32-bit support (e.g for Steam) | ||
enable32Bit = true; | |||
package32 = pkgs-unstable.pkgsi686Linux.mesa | package32 = pkgs-unstable.pkgsi686Linux.mesa; | ||
}; | }; | ||
} | } | ||
</nowiki>}} | </nowiki>|name=configuration.nix|lang=nix}} | ||
==== Cachix ==== | ==== Cachix ==== | ||
| Line 115: | Line 118: | ||
} | } | ||
</nowiki>}} | </nowiki>}} | ||
=== Screensharing === | |||
{{file|configuration.nix|nix|<nowiki> | |||
{ | |||
xdg.portal = { | |||
enable = true; | |||
extraPortals = with pkgs; [ xdg-desktop-portal-hyprland ]; | |||
}; | |||
} | |||
</nowiki>}} | |||
=== Display Manager Support === | === Display Manager Support === | ||
By default, Hyprland does not come with a [https://wiki.nixos.org/wiki/Wayland#Display_Managers display manager] and does not advertise support for one. Though one can start hyprland directly from tty with <code>Hyprland</code> or with <code>uwsm start select</code>, some display managers packaged in NixOS are compatible including but may not be limited to: | By default, Hyprland does not come with a [https://wiki.nixos.org/wiki/Wayland#Display_Managers display manager] and does not advertise support for one. Though one can start hyprland directly from tty with <code>Hyprland</code> or with <code>uwsm start select</code>, some display managers packaged in NixOS are compatible including but may not be limited to: | ||
* SDDM | * [[SDDM]] | ||
* GDM (works but crashes Hyprland on first launch) | * [[GDM]] (works but crashes Hyprland on first launch) | ||
* | * [[Greetd]] (especially with ReGreet) | ||
* | * [[Ly]] (not recommended but works) | ||
== Configuration == | == Configuration == | ||
| Line 127: | Line 141: | ||
=== Using [[Home Manager]] === | === Using [[Home Manager]] === | ||
Home Manager allows for | Home Manager allows for declarative configuration of Hyprland using Nix syntax. Entries with the same key should be written as lists. Variables’ and colors’ names should be quoted. | ||
Find additional options under [https://home-manager.dev/manual/23.11/options.xhtml#opt-wayland.windowManager.hyprland.enable Home Manager - wayland.windowManager.hyprland]. Also, see the [https://wiki.hypr.land/Nix/Hyprland-on-Home-Manager/ Hyprland Page for Home Manager] for more examples. | |||
{ | |||
{{File|3=wayland.windowManager.hyprland = { | |||
systemd.enable = false; | |||
settings = { | |||
decoration = { | decoration = { | ||
shadow_offset = "0 5"; | shadow_offset = "0 5"; | ||
| Line 138: | Line 154: | ||
"$mod" = "SUPER"; | "$mod" = "SUPER"; | ||
bind = [ | |||
# Execute Rofi with only the SUPER key | |||
"$mod, Super_L, exec, pkill rofi {{!}}{{!}} rofi -show drun" | |||
"$mod, F, exec, librewolf" | |||
"CONTROL ALT, T, exec, wezterm" | |||
]; | |||
# Startup Apps | |||
exec-once = [ | |||
"hyprpanel" | |||
]; | |||
bindm = [ | bindm = [ | ||
| Line 146: | Line 176: | ||
]; | ]; | ||
}; | }; | ||
};|name=/etc/nixos/home.nix|lang=nix}} | |||
} | |||
== Plugin Support == | == Plugin Support == | ||
| Line 155: | Line 183: | ||
The [[Home Manager]] module for Hyprland should be used instead: | The [[Home Manager]] module for Hyprland should be used instead: | ||
{{ | {{File|3={ | ||
{ | |||
wayland.windowManager.hyprland.plugins = [ | wayland.windowManager.hyprland.plugins = [ | ||
pkgs.hyprlandPlugins.PLUGIN_NAME | pkgs.hyprlandPlugins.PLUGIN_NAME | ||
]; | ]; | ||
} | }|name=/etc/nixos/home.nix|lang=nix}} | ||
[https://github.com/hyprwm/hyprland-plugins hyprland-plugins] is a repository of first-party plugins. If you wish to use these plugins it is recommended to use the Hyprland flake instead of the Nixpkgs version, and to use the [[Home Manager]] module for configuration. | |||
[https://github.com/hyprwm/hyprland-plugins hyprland-plugins] is a repository of first-party plugins. If you wish to use these plugins | |||
Add the flake | Add the flake into your flake inputs: | ||
{{file|flake.nix|nix|<nowiki> | {{file|flake.nix|nix|<nowiki> | ||
{ | { | ||
| Line 182: | Line 207: | ||
</nowiki>}} | </nowiki>}} | ||
Then, add the plugin using the hyprland-plugins input: | |||
{{file|/etc/nixos/home.nix or ~/.config/home-manager/home.nix|nix|<nowiki> | {{file|/etc/nixos/home.nix or ~/.config/home-manager/home.nix|nix|<nowiki> | ||
| Line 246: | Line 271: | ||
</nowiki>}} | </nowiki>}} | ||
or | or set themes using dconf in your Hyprland configuration file: | ||
{{file|hyprland.conf|conf|<nowiki> | {{file|hyprland.conf|conf|<nowiki> | ||
exec-once = dconf write /org/gnome/desktop/interface/gtk-theme "'Adwaita'" | exec-once = dconf write /org/gnome/desktop/interface/gtk-theme "'Adwaita'" | ||