Hyprland: Difference between revisions
imported>Srestegosaurio m Added a warning linking the upstream nix docs regarding installation as the page is currently incomplete and outdated. |
m Proper way to write in XDG config directory |
||
(10 intermediate revisions by 6 users not shown) | |||
Line 5: | Line 5: | ||
== Installation == | == Installation == | ||
{{Note|The respective modules should already take care of the majority of mentioned items in this list. }} | |||
To run Hyprland properly you need to enables critical components, such as: | To run Hyprland properly you need to enables critical components, such as: | ||
* [[polkit]] | * [[polkit]] | ||
* | * xdg-desktop-portal-hyprland | ||
* graphics drivers : [[Nvidia]], [[ | * graphics drivers : [[Nvidia]], [[AMD_GPU|AMD]] | ||
* [[fonts]] | * [[fonts]] | ||
* [[dconf]] | * [[dconf]] | ||
* [[xwayland]] | * [[xwayland]] | ||
* [[display manager]] | * [[display manager]] | ||
If you use [[gdm]] or [[ldm]]: add a proper [[Desktop Entry]] to your | If you use [[gdm]] or [[ldm]]: add a proper [[Desktop Entry]] to your [[display manager]]. | ||
=== Using [[NixOS]] === | === Using [[NixOS]] === | ||
Line 25: | Line 26: | ||
# Whether to enable XWayland | # Whether to enable XWayland | ||
xwayland.enable = true; | xwayland.enable = true; | ||
}; | }; | ||
# ... | # ... | ||
Line 51: | Line 48: | ||
# Whether to enable hyprland-session.target on hyprland startup | # Whether to enable hyprland-session.target on hyprland startup | ||
systemd.enable = true; | systemd.enable = true; | ||
}; | }; | ||
# ... | # ... | ||
Line 94: | Line 89: | ||
{config, pkgs, ... }: | {config, pkgs, ... }: | ||
{ | { | ||
xdg.configFile."hypr/hyprland.conf".text = '' | |||
decoration { | decoration { | ||
shadow_offset = 0 5 | shadow_offset = 0 5 | ||
Line 143: | Line 138: | ||
== Troubleshooting == | == Troubleshooting == | ||
=== Swaylock === | |||
If swaylock cannot be unlocked with the correct password: | |||
<code> | |||
security.pam.services.swaylock = {}; | |||
</code> | |||
== See also == | == See also == |
Latest revision as of 08:45, 30 August 2024
Hyprland is a wlroots-based tiling Wayland compositor written in C++. Noteworthy features of Hyprland include dynamic tiling, tabbed windows, a clean and readable C++ code-base, and a custom renderer that provides window animations, rounded corners, and Dual-Kawase Blur on transparent windows. General usage and configuration is thoroughly documented at Hyprland wiki.
Installation
To run Hyprland properly you need to enables critical components, such as:
- polkit
- xdg-desktop-portal-hyprland
- graphics drivers : Nvidia, AMD
- fonts
- dconf
- xwayland
- display manager
If you use gdm or ldm: add a proper Desktop Entry to your display manager.
Using NixOS
/etc/nixos/configuration.nix
{pkgs, ...}:
{
programs.hyprland = {
# Install the packages from nixpkgs
enable = true;
# Whether to enable XWayland
xwayland.enable = true;
};
# ...
}
Using Home Manager
/etc/nixos/home.nix or ~/.config/home-manager/home.nix
{config, pkgs, ... }:
{
wayland.windowManager.hyprland = {
# Whether to enable Hyprland wayland compositor
enable = true;
# The hyprland package to use
package = pkgs.hyprland;
# Whether to enable XWayland
xwayland.enable = true;
# Optional
# Whether to enable hyprland-session.target on hyprland startup
systemd.enable = true;
};
# ...
}
See all modules for Home Manager
Using Flake
Configuration
Using Home Manager
You have two options for configuring the settings:
1. Compose the configuration using Nix syntax:
/etc/nixos/home.nix or ~/.config/home-manager/home.nix
{config, pkgs, ... }:
{
wayland.windowManager.hyprland.settings = {
decoration = {
shadow_offset = "0 5";
"col.shadow" = "rgba(00000099)";
};
"$mod" = "SUPER";
bindm = [
# mouse movements
"$mod, mouse:272, movewindow"
"$mod, mouse:273, resizewindow"
"$mod ALT, mouse:272, resizewindow"
];
};
# ...
}
2. You can also use Hyprland's syntax to write the file like this: :
/etc/nixos/home.nix or ~/.config/home-manager/home.nix
{config, pkgs, ... }:
{
xdg.configFile."hypr/hyprland.conf".text = ''
decoration {
shadow_offset = 0 5
col.shadow = rgba(00000099)
}
$mod = SUPER
bindm = $mod, mouse:272, movewindow
bindm = $mod, mouse:273, resizewindow
bindm = $mod ALT, mouse:272, resizewindow
'';
# ...
}
Plugin
You need use flake for her, example:
put this in your flake.nix
/etc/nixos/flake.nix or ~/.config/home-manager/flake.nix
{
inputs = {
# ...
hyprland.url = "github:hyprwm/Hyprland";
plugin_name = {
url = "github:maintener/plugin_name";
inputs.hyprland.follows = "hyprland"; # IMPORTANT
};
};
}
then, inside your home-manager module:
/etc/nixos/flake.nix or ~/.config/home-manager/flake.nix
{
wayland.windowManager.hyprland = {
plugins = [
inputs.plugin_name.packages.${pkgs.system}.default
];
};
}
Usage
Troubleshooting
Swaylock
If swaylock cannot be unlocked with the correct password:
security.pam.services.swaylock = {};