In the past few months, I’ve heard (i.e., read articles and seen videos) many good things about the Wayland compositor Hyprland. I decided to try it, and I’ve been using it for almost one month as my daily driver. I’m still not into “tiling” that much, but in Hyprland, you can also switch to classic “stack” window management. I like Hyprland; it feels fast and reactive (also on a PineBook Pro; I’ll blog about Hyprland on a PineBook Pro in the future).
By the way, if you don’t already know:
Hyprland is a dynamic tiling Wayland compositor based on wlroots that doesn’t sacrifice on its looks. It supports multiple layouts, fancy effects, has a very flexible IPC model allowing for a lot of customization, a powerful plugin system and more.
This post is the first of a few articles showing how to install, configure and use Hyprland and additional tools. You can find many GitHub repositories with installation scripts and configuration files for Hyprland, but you end up with the configurations of those repositories, probably without understanding the basic details of Hyprland. I found starting from scratch (following the Hyprland wiki) much more helpful, taking inspiration from some of the above-mentioned GitHub repositories.
By the way, most Hyprland configurations you find on GitHub are primarily about “ricing” (i.e., heavy aesthetic customizations of the desktop). While I love good-looking desktops, I won’t blog about aesthetic customizations much. I’ll focus mostly on configurations and tools for usability.
This first post is only about getting started and having a usable environment with minimal helpful tools: there will be follow-up posts for installing other tools (like a bar and notification system) and configuring other programs (actually, I have already blogged about Variety in Hyprland).
Moreover, all these posts are about Hyprland in Arch Linux since that’s the only OS where I experimented with Hyprland. In particular, I’m using EndeavourOS.
First, install EndeavourOS without a desktop environment (when you get to the installer’s part, where you have to select a desktop environment).
I will use the AUR helper “yay”, which is already installed in EndeavourOS. On Arch, you’ll have to install it yourself, e.g., with the following commands:
1 2 3 4 5 |
sudo pacman -Sy git git clone https://aur.archlinux.org/yay-bin.git cd yay-bin makepkg -si |
Let’s start from https://wiki.hyprland.org/Getting-Started/Master-Tutorial/ and install Hyprland from the official Arch repositories:
1 |
sudo pacman -S hyprland |
As suggested, let’s install the terminal “Kitty” (the default Hyprland configuration has a shortcut to run that).
1 |
sudo pacman -S kitty |
Of course, later, you can also install another terminal.
Now, you can execute “Hyprland” in your tty. (Remember, I haven’t installed any desktop environment or a login manager).
Note for virtual machines: If you test this in a virtual machine, ensure that 3D is enabled. Moreover, it’s crucial to start Hyprland with the following environment variables so that the mouse is usable; please, remember that the experience in a virtual machine will not be optimal anyway:
1 |
WLR_NO_HARDWARE_CURSORS=1 WLR_RENDERER_ALLOW_SOFTWARE=1 Hyprland |
When Hyprland starts, you see a warning and a few pieces of information:
To make the warning go away, we edit the generated default configuration file (use either “vi” or “nano” text editors that are already installed in EndeavourOS). To do that, we must start a terminal: by default, the keyboard shortcut is “SUPER + Q” (as shown in the yellow warning):
Now we can edit the file .config/hypr/hyprland.conf and remove the following line:
1 |
autogenerated = 1 # remove this line to remove the warning |
Save the file, and the warning will go away. In fact, one of the cool features of Hyprland is that it automatically applies changes to that file.
Let’s change the configuration file further. By default, the configuration uses a US keyboard layout. I had to change it to use the Italian layout: Edit that file and change the following part accordingly (in my case, I have an Italian keyboard):
1 2 3 4 |
... input { kb_layout = it ... |
Save the file, and the new keyboard layout will be immediately set.
You might want to install “neofetch” and run it in a terminal (in this example, I’m running inside a KVM virtual machine):
The default configuration uses the shortcut SUPER + E to start the file manager “Dolphin”, which is not installed by default. You could install it. Here, I’m doing something different: Let’s install the file manager “nemo”:
1 |
sudo pacman -S nemo |
and change the line
1 |
bind = $mainMod, E, exec, dolphin |
into
1 |
bind = $mainMod, E, exec, nemo |
Let’s save the file, press SUPER + E, and Nemo appears (tiled automatically)
Let’s install the application launcher “wofi” (personally, I prefer “rofi”, but I’ll blog about that in the future):
1 |
sudo pacman -S wofi |
Wofi is already configured with the following keyboard shortcut:
1 |
bind = $mainMod, R, exec, wofi --show drun |
For example, let’s use SUPER + R and run Firefox (already installed in EndeavourOS) using Wofi: just start typing “fir” until it appears in the list, move the cursor down to select it, and press ENTER (or keep on typing the other letters til “firefox” is the only choice).
Let’s exploit the blur effects of Hyprland: let’s modify the Kitty configuration file (create it if it doesn’t exist) ~/.config/kitty/kitty.conf by adding this line:
1 |
background_opacity 0.5 |
Save it and start another instance of Kitty and enjoy the blur effect with the default Hyprland background:
If “0.5” is too much transparency, make the value a bit bigger.
Let’s make Nemo transparent as well with an Hyprland window rule. By default, Nemo is not transparent:
Let’s modify the Hyprland configuration file by adding this line:
1 |
windowrulev2 = opacity 0.8 0.8,class:^(nemo)$ |
Save and restart Nemo, which is now transparent:
The two values in “opacity” set the opacity for the window when it’s focused and not, respectively. By changing the above line as follows:
1 |
windowrulev2 = opacity 0.9 0.6,class:^(nemo)$ |
The Nemo window will be less transparent when active and more transparent when not focused.
Monitor(s) configurations are specified in the Hyprland configuration and are applied on the fly as soon as you save the configuration file. This is the default configuration:
1 2 |
# See https://wiki.hyprland.org/Configuring/Monitors/ monitor=,preferred,auto,auto |
The last value is the scale value. Try to change it to “1.5” or “1.75”, save, and see the scaling automatically applied.
Note that, by default, when running on a real computer (not a virtual machine), Hyprland already scales the display for high resolutions (e.g., it sets it to “1.5” by default).
Running from a Display Manager
The default installation already created a file in the appropriate folder to let SDDM start the Hyprland session.
1 2 3 4 5 6 |
$ cat /usr/share/wayland-sessions/hyprland.desktop [Desktop Entry] Name=Hyprland Comment=An intelligent dynamic tiling Wayland compositor Exec=Hyprland Type=Application |
Let’s install the AUR package “sddm-git” (we need the Git version to avoid a bug that has been fixed but not in the current release; when reading this post, the official package might have already been fixed) with yay:
1 |
yay -S sddm-git |
Then, we enable the service at boot:
1 |
sudo systemctl enable sddm |
If we want to start it without rebooting, the first time we run:
1 |
sudo systemctl start sddm |
And now you can enter Hyprland from here.
If you’re running inside a virtual machine, you lose the environment variables we saw above: “WLR_NO_HARDWARE_CURSORS=1 WLR_RENDERER_ALLOW_SOFTWARE=1”. To restore them, you must modify the “/usr/share/wayland-sessions/hyprland.desktop” accordingly, in particular, the “Exec” line:
1 |
Exec=env WLR_NO_HARDWARE_CURSORS=1 WLR_RENDERER_ALLOW_SOFTWARE=1 Hyprland |
Then, restart “sddm” (by switching to a tty):
1 |
sudo systemctl restart sddm |
Or by rebooting the system.
That’s all for now! Stay tuned for more posts about Hyprland 🙂
This sounds interesting. I also am not convinced I want tiling window manager all the time. I don’t have a Pinebook, but I have an old Macbook Pro that works well on EndeavourOS. That’s where I’ll be playing along at home.
Just finished duplicatiing your results on my Mackbook Pro 8,1. This looks pretty good for a WM.
Thank you for the feedback! It’s great that it runs (smoothly?) on mac as well 🙂
By the way, you don’t have to use tiling if you don’t want to in Hyprland.
Really appreciate all your blogs and just wanted to let you know and thank you for it. The Snapper ones, now the Variety tip for Hyprland (using it right now) and many more things. Currently I am also using Hyprland (on Debian), next to KDE on Arch (on the laptop). Really interesting to read your musings. Thanks a lot! BR, Mark
Thank you Mark for the kind words 🙂
Welcome and well deserved Lorenzo, keep them coming 😉
Hi Lorenzo, I’d really like to follow your guide but after doing a clean install of endeavour os, i install hyprland and kitty but when i run ‘Hyprlans’ from tty i get the black screen, i tried to download the sddm graphic display but it’s the same… What could it be? Thank you
Of course, you meant “Hyprland” not “Hyprlans”, right?
If you get a black screen, maybe it’s due to your graphics card. Do you have an Nvidia?
The wiki describes the additional steps to perform to have Hyprland work with Nvidia. I’m afraid I don’t have such a card, so I cannot help.
Sorry, I meant “Hyprland”… I don’t have Nvidia graphics card i have a Lenovo x230 with Intel, maybe it’s old.
Thank you for the reply, Enrico
mh… you might want to check the official wiki for known problems. I seem to remember that a black screen is a known symptom, so you could find a solution.
Thank you for this guide Lorenzo! Helped the transition to hyprland a breeze. I had been using arch + i3wm for the last 8 years as my main driver and I was pretty happy with the snappiness, but it lacked the oomph and the buttery smoothness of modern macos or even windows for that matter. Thus far hyprland feels great, quite responsive.
Glad it helped! Thank you for the feedback 🙂
Hi, I have a question, how do I set the default layout to something else in Hyprland? Thank you
That should be documented in the wiki
Hi, thank you for this post and your part 2. I’m trying Hyprland on EndeavourOS for the first time and found them helpful. 🙂