Hyprland: Difference between revisions

Phobos (talk | contribs)
m Added link for UWSM Page, added warning for home manager module
Pigeon (talk | contribs)
Swaylock: also mention Waylock in the troubleshooting tip (there is no mention of this fix for waylock on nixos wiki)
 
(4 intermediate revisions by 3 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 can be found in the project's own [https://wiki.hyprland.org/ wiki].  
<translate>
[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''': does not rely on wlroots or other external libraries and provides in-house alternatives to common components (screen locking, idle daemon, etc).
* '''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''': uses a live reloading config file in plain-text with useful defaults.
* '''Easy to configure''': Uses a live reloading config file in plain-text with useful defaults.
* '''Dynamic tiling support''': supports both automatic tiling and floating mode with multiple layouts.
* '''Dynamic tiling support''': Supports both automatic tiling and floating mode with multiple layouts.
* '''Socket-based IPC''': allows controlling the compositor at runtime via UNIX socket.
* '''Socket-based IPC''': Allows controlling the compositor at runtime via UNIX socket.
* '''Global shortcuts''': permits setting global keybinds for any application (for apps such as [[OBS Studio]]).
* '''Global shortcuts''': Permits setting global keybinds for any application (for apps such as [[OBS Studio]]).
* '''Window/Workspace Rules''': set special behaviors for certain windows and workspaces.
* '''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]]. [[UWSM|Options for configuring UWSM may be found here]].
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|||<nowiki>
{{file|||<nowiki>
Line 141: Line 142:


=== Using [[Home Manager]] ===
=== Using [[Home Manager]] ===
Home Manager allows for declarative configuration of Hyprland using Nix syntax.
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.  


{{file|||3={
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.
  wayland.windowManager.hyprland.settings = {
 
{{File|3=wayland.windowManager.hyprland = {
  systemd.enable = false;
  settings = {
     decoration = {
     decoration = {
       shadow_offset = "0 5";
       shadow_offset = "0 5";
Line 151: Line 155:


     "$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 159: Line 177:
     ];
     ];
   };
   };
  # ...
};|name=/etc/nixos/home.nix|lang=nix}}
}|name=/etc/nixos/home.nix or ~/.config/home-manager/home.nix|lang=nix}}


== Plugin Support ==
== Plugin Support ==
Line 167: Line 184:
The [[Home Manager]] module for Hyprland should be used instead:
The [[Home Manager]] module for Hyprland should be used instead:


{{file|/etc/nixos/home.nix or ~/.config/home-manager/home.nix|nix|<nowiki>
{{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}}
</nowiki>}}


=== hyprland-plugins ===
[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 then it's recommended to use the Hyprland flake instead of the Nixpkgs version as well as using the [[Home Manager]] module.


Add the flake to your flake inputs:
Add the flake into your flake inputs:
{{file|flake.nix|nix|<nowiki>
{{file|flake.nix|nix|<nowiki>
{
{
Line 194: Line 208:
</nowiki>}}
</nowiki>}}


And then add the plugin using the hyprland-plugins input:
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 210: Line 224:
[https://github.com/hyprland-community/awesome-hyprland#plugins List of plugins]
[https://github.com/hyprland-community/awesome-hyprland#plugins List of plugins]
== Troubleshooting ==
== Troubleshooting ==
=== Swaylock ===
=== Swaylock/Waylock ===
If swaylock cannot be unlocked with the correct password:
If swaylock/waylock cannot be unlocked with the correct password:
 
<code>
<code>
security.pam.services.swaylock = {};
security.pam.services.swaylock = {};</code>(or <code>waylock</code> repsectively)
</code>


=== Electron applications defaulting to X11 rather than Wayland ===
=== Electron applications defaulting to X11 rather than Wayland ===
Line 272: Line 286:
* [https://github.com/hyprwm/Hyprland/ Hyprland Github Page]
* [https://github.com/hyprwm/Hyprland/ Hyprland Github Page]
* [https://github.com/hyprland-community/awesome-hyprland Community-maintained list of tools, plugins and extensions]
* [https://github.com/hyprland-community/awesome-hyprland Community-maintained list of tools, plugins and extensions]
</translate>


[[Category:Window managers]]
[[Category:Window managers]]
[[Category:Applications]]
[[Category:Applications]]
[[Category:Hyprland]]