Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Hyprland Crash Course (xd1.dev)
120 points by gchamonlive on March 23, 2024 | hide | past | favorite | 70 comments


If you're a tinkerer/sysadmin/programmer (any combination of such) like me, and this is your first foray into these customizable DEs, be warned, it's somewhat addictive. I didn't sleep very well the first few nights after discovering hyprland due to staying up to customize "one more thing".


Lots of what the article talks about pertains to the difference between a 'full DE' and 'just a WM'. Gnome and KDE fall in the first category. They have a notification system, lockscreens, app launcher, etc by default. Hyprland doesn't. It puts windows on your screen and allows you to control their layout, everything beyond that, you can add yourself.

This article mentions dunst for notifications, Rofi for app launchers, Waybar for a status bar, swaylock for screen locking, ... I've been having a great time using just AGS [0]. AGS, at its core, is a framework to write all of those tools. It is based on the same technology that Gnome Shell uses, i.e. GJS. You can build up all of the widgets you want and need using Gtk and replace all of the tools I mentioned before. But be warned: AGS only provides you with the libraries you need, you'll still need to build the UI yourself. Unless you copy someone else's configuration of course ;)

[0] https://github.com/aylur/ags


This is very interesting! Do you think you could share what you have developed so far using that?


My work on AGS, so far, has been mostly focused on adding support for additional features that weren't available before. I implemented the possibility to write your own PolKit agent in AGS and have just recently gotten secure session locking via the ext-session-lock-v1 Wayland protocol working. I still need to clean up the code and send PRs upstream, though.

That said, my config is available on GitHub [0]. If you want to see much more complete setups, you should check out the configurations by Aylur (creator of AGS) [1], kotontrion [2], or end_4 [3]. I'm sure there are lots more that are notable, but these immediately came to mind.

[0] https://github.com/Cu3PO42/gleaming-glacier/tree/next/config...

[1] https://github.com/Aylur/dotfiles

[2] https://github.com/kotontrion/dotfiles

[3] https://github.com/end-4/dots-hyprland


That is awesome, thanks a lot!


If you want to get a system running from scratch quickly, and avoid the 'two days of setup' problem, I strongly recommend hyprdots. A lot of the things you'd be forced to manually find and install come pre-installed and configured.

https://github.com/prasanthrangan/hyprdots


Been using Hyprland for about a year on my arch box. I do like using it but I don't like that they seem to make breaking changes to the config file format regularly. There have been at least three time where an update left me with something not functioning correctly or a bunch of errors and I had to dig through my config file and find what things were no longer compatible with the new version.


That sounds like the earlier years of awesomewm. aweomsomewm's config API was notoriously volatile, but stabilized later on; hopefully Hyprland will also.


Well, that is... Worrying. Can you give specifics about the occasions when hyprland broke on you?


For example with the 0.36.0 release ## was changed to mean "escaped #" instead of a valid start of a comment line (comments start with #) so some heading type comments I had like ### Input config ### were suddenly throwing errors.


it's a known issue https://github.com/hyprwm/hyprlang/issues/30 and will likely be fixed in the future i use hyprland too since quite some time and when config options changed a red banner shows up and tells you what's broken, a quick look to the wiki and 5 minutes is all you need to fix configs breaking is expected since it's evolving really quickly


This is mostly correct, but I think 5 minutes is understating the effort for some changes. I've had a few head scratching moments where I wasn't sure what to do to get an equivalent configuration. That being said, it is still reasonable to do.


Does anybody knows about a tiling WM that allows customising the position of the first window you open? I have an ultra wide display, and I want the first window I open to be roughly 1/3 in screen width and placed in the centre. From memory of playing with i3/sway, it would allow different layouts but the 1st screen would always be full screen and I would have to do something like choose "thirds layout" and "open terminal, open app I want, open terminal".


I do something like that on a 49 inch 32:9 ultra wide with hyprland.i don't have my config handy but basically you want to use the master layout and set orientation to center. You can also play around with new_is_master and always_center_master based on your preferences.

https://wiki.hyprland.org/Configuring/Master-Layout/


Thanks, will take a look.


Please report back if it is working for you. I have the same problem.


I just changed and this is a LOT nicer! Also on a 49" ultrawide

Thanks for the protip!


You can also use the swapwithmaster dispatch to cycle windows into the center position with a keyboard shortcut.


I wrote my own layout manager to do exactly this:

https://github.com/pkulak/filtile


I did this with AwesomeWM. The Lain (plugin/extension/i forget what its called in awesome) has a "centerwork" style layout that solves this exact issue.

Actually it's really surprising how few tiling WMs support this sort of scenario.

I eventually just gave up and switched to KDE+KZones as it covers 90% of what I'd get from a tiling WM anyway.


That's possible with Niri, with its center-focused-column and default-column-width settings. It's not a traditional tiling WM, though


I do it with PaperWM which is a niri-like Gnome extension.


Never heard of Niri before. Will take a look, cheers.


IIRC, Sway supports this. On an empty workspace, the first window I open is centered and about 800x800px, and on opening a second, both windows begin tiling and take up the whole screen.

I think is the relevant setting:

    # Only enable outer gaps when there is exactly one container
    smart_gaps inverse_outer
And I have these gap values in my config:

    gaps horizontal 1000px
    gaps vertical 100px
HTH


Hyprland can do that, quite easily. It has windows rules that allow you to place everything just so.


That's one of the reasons I use i3.

  gaps horizontal 417
  gaps inner      10
  smart_gaps inverse_outer
https://imgur.com/a/MjNBgms


Related question, since we're on the topic: does Linux have a way to split a single wide monitor into smaller "virtual" monitors?



X does, you can use xrandr --setmonitor.

For example, splitting a 5120x1440 monitor into three:

  xrandr --setmonitor DisplayPort-0-0 1280/297x1440/340+0+0 none
  xrandr --setmonitor DisplayPort-0-1 2560/595x1440/340+1280+0 none
  xrandr --setmonitor DisplayPort-0-2 1280/297x1440/340+3840+0 none


I'd like to do this under AwesomeWM but cannot https://github.com/awesomeWM/awesome/issues/3132


Dwm has a patch for this. I think you can use vanity gaps, and make the outer gaps depend on a layout or window rule.


you can write a script to hack that behaviour with i3-msg `i3-msg -t get_tree`. it's frustrating that you cant have empty tiles though, you'll need to write in your a script 0% opacity panes that get replaced when a new windows is created.


hyprland isnt a window manager, its a wayland compositor that doesnt sacrifice on looks


I've been a sway/i3 user for almost 10 years and when I tried to switch to Hyprland I ended up with the realization that once I had replicated my sway config there was no advantage over sway that I could think of.

This obviously has a strong habit and comfort aspect and should not discourage anyone trying Hyprland, especially if they are new to tiling WM's.

The exercise itself was not useless, following various Hyprland guides I picked up tools here and there that I had not been aware of that I integrated into my sway flow.


Agreed I also use sway since a few years and i3 before. The switch from i3 to sway was painless, and I really felt the benefits of wayland.

But a few months ago I also replicated my sway config to hyprland, as I heard many good things about it, and it seemed like it was the new "cool kid".

But I also didn't notice any benefit.

On the contrary, I've had more problems with it, frequent crashes, flickering windows. And It misses a way to move a whole workspace to another monitor. Nonetheless I used it for ~1 month, and then switched back to sway.

Switching back to sway really felt like an improvement.

Even if they'd fix all the issues I had, I still can't see what hyprland has to offer for me, that sway can not. (Except the animations, which I immediately turned off)


For me Hyprland offers the ability to share a specific window or region whereas Sway could only do the entire monitor. As I have an ultra widescreen monitor sharing a specific window or region is pretty important to me but I can see why others may have other priorities. I do still prefer the tiling layout of Sway over Hyprland though so probably would jump back if Sway/wlroots improve their screensharing support.


I honestly haven't read anything about sway. I didn't give much context, but the reason I moved to hyprland was because with plasma 6 my workflow basically died, with all my kwin scripts suddenly becoming useless.

I asked where I work and many recommended hyprland. After giving it a try I saw it was actually very good.

What do you like about sway and what advantages did you hope that hyprland had over sway for you to be compelled to move to it?


If you don't mind me replying in place of the orginal poster:

Sway is just i3 for Wayland, which in turn means you have multiple workspaces (which are also potentially mapped to multiple monitors). You assign workspace a label (number, or text, or emoji), and you may also bind some application to always open on that workspace. Or you just get a habit of putting specific applications to only specific workspaces. Your entire navigation then sits in your muscle memory - finger on the mod key (win or alt or ctrl - whatever), another finger on the digits row for the workspace index - and you're there.

It's a tiling WM, so you don't spend time arranging windows - they already take the full desktop real estate evenly split between them, and you can also adjust size of each window separately. Again, this sits in your muscle memory.

Point is - no mouse is needed to navigate through workspaces and windows.

You may read my blog post about setting sway up (on NixOS) here:

https://drakerossman.com/blog/wayland-on-nixos-confusion-con...


Thanks for that blog post! I have been meaning to tip my toes into nix for a while now, this might actually push me to it. How long have you been using nix for? How do you like it?


Something like for 3 years. Absolutely fascinated by it. Writing a book about it too: https://drakerossman.com/blog/practical-nixos-the-book

Also check the "nix" tag at blog.


Hyprland has: - Xwayland no scale so your apps don't turn into a blurry mess if you use scaling - Fancy animations

However, it also seems rather unstable. Over the past several months I've been using it, it had a few separate bugs that led to crashes. I haven't really used Sway, so I can't really comment on that, but the X11 WMs (i3 and bspwm) are both quite stable and I honestly can't recall them crashing.


That is really disappointing to hear. It's depressing how many projects don't have a commitment to backward compatibility.


I tried Hyprland from Sway, and my takeaway was that I liked auto tiling more than manual. Didn’t much care for all the extras though, so I actually moved to, and still use, River.


Not very much a crash course but a polishing guide. Sorry about the title. Also my first actual post to my blog, hope you enjoy!


Love a tiling WM post! Reading the "twos days to get setup" reminds me of fighting a blank xmonad setup back in the day :-), and makes me all the more appreciative of Regolith Desktop, a super-minimal Ubuntu+i3wm (and sway) setup; everything just works, Zoom sharing, multi-window, etc. Recommended!


And putting effort into adding every feature you need makes me appreciate it even more. I don't mean to say that humans derive value from suffering, but looking back at some of the headache and seeing that they are mostly solved now gives me this cool peace of mind. Plus, if anything breaks I know how to solve it. It is akin to moving from some batteries included distro like pop_os to arch. Nothing against pop, it is a wonderful effort, but reading through the documentation and putting your distro together gives you way more insight into the inner workings which is invaluable for when it breaks.


> reading through the documentation and putting your distro together gives you way more insight into the inner workings which is invaluable for when it breaks.

I definitely feel that way about the core libraries/frameworks I'm building my applications/codebases on top of, so can relate!

But for my WM/desktop, I'm pretty happy to a) not know it's innermost workings, and b) just have it not break in the first place! :-)

I guess we can each have our own yak-shaving preferences. :-)


I was exactly like that until kde decided it knew what was best for me and killed all the kwin scripts I relied upon with plasma 6 :(

But yeah! We can't know everything, it is very important to consciously decide what to be ignorant about. What is relevant to me might not be relevant to you and that is the beauty of it. If everyone got interested in the exact same thing, just imagine the chaos.


Does Hyprland still set the default wallpaper to randomly show their favorite anime girl?


There's a setting to disable it actually.

This should do the trick.

    misc {
      disable_hyprland_logo = true
    }


to me this was

    misc {
        force_default_wallpaper = 0 # Set to 0 or 1 to disable the anime mascot wallpapers
    }
https://wiki.hyprland.org/Configuring/Variables/#misc

disable_hyprland_logo will also disable the hyprland logo too, not only the anime mascots, and will display a solid color if not using hyprpaper


I used to use AwesomeWM [1] almost a decade ago. Nowadays I'm professionally stuck on macOS, and not a week goes by that I miss AwesomeWM... [2]

This is a fun reminder that the Linux Window Manager world continues to evolve. It looks like Hyprland is a cross between those tiling window managers and Enlightenment of yore (for the eye-candy)

Does Hyprland implement a similar thing to AwesomeWM's killer feature of "window tagging"? In AwesomeWM, it meant you could "tag" various windows (for example: Terminal, Editor, Browser) then display an arbitrary set of Tags. This way, I could trivially go from "Editor and Terminal" to just "Editor" to "Editor & Browser".

[1] https://awesomewm.org/

[2] I am aware of the various macOS window manager tools like Moom, SizeUp, and the like, but none that I've tried come to the ankle of the better Linux tiling WMs.


i believe it should be possible to make tag like experience for macos with hammerspoon (lua based scripting engine for macos), you can move windows between desktops with it, so you could have one desktop for tiled windows and default for maximized, so whenever you want to switch to tiled group of windows u somehow trigger that with hammerspoon shortcut, and when you switch to a single window you switch to default desktop

i have an implementation of window manipulation based on key/letter hints, you can use it as a reference

https://github.com/ivanbalashov239/hammerspoon.config


The animations are what drove me to Hyprland.

I used Enlightenment at bit back in the day and used Compiz/Beryl with GNOME a lot in the mid-00s. I'm a sucker for animations on the desktop, I even liked the wobbly windows.

I started using tiling window managers with i3 and then later bspwm. Using Hyprland for the first time gave me a feeling similar to what I felt using Compiz along with the productivity of a tiling window manager. Its like the best of both worlds.


Hyprland is nice, but goddamn is it a PITA to package. I wish they'd stop being that extremely bleeding-edge with the stuff they depend on.


I know little about the development culture of hyprland. Can you give more details about that and why being bleeding-edge makes packaging difficult? You mean packaging for distros or just the act of releasing new versions is hard because of deps breakage?


Hyprland builds using a pinned commit of wlroots instead of a tagged release because wlroots release schedule is too slow for Hyprland's development. [0]

This turns into a problem for maintainers because many distributions refuse to ship non tagged versions of software.

Hyprland used to depend on wlroots-git, but when it made the switch to use specific pinned commits instead, a lot more distributions started to package it [1], but some still refuse to do so such as Debian.

[0] https://github.com/hyprwm/hyprland/issues/302#issuecomment-1...

[1] https://gitlab.alpinelinux.org/alpine/aports/-/merge_request...


I’ve been using Hyprland for a few months. It’s been pretty stable and I haven’t had any issues so far


Is there any benefit in tiling only WMs vs using tiling let's say in KDE?


Hyprland isn't really tiling only, floating works quite well too! I'd say lightweight, customize, and eye-candy as the main advantages though.


As someone who always tiles windows to maximum screen usage, a tiling window saves me the step of dragging windows to snap points. I open the windows I want and they're already arranged how I would've arranged them manually. In the rare case that I don't want a simple split, the tiling layout has its own window dragging/snapping system that lets me easily make my windows into whatever grid arrangement I want far more easily than doing so with floating windows, as all I have to specific is the relative locations of the windows (left, right, above, below) and a split ratio, all with mouse drag targets similar to iPadOS's split screen.


KDE has tiling scripts for KWin which can do the same thing. So you can get the same functionality without the need to go barebones for everything else.


It had, but they are all dead until ported to the new kde 6.

https://github.com/Bismuth-Forge/bismuth/issues/471#issuecom...

This is what I used. I found no good replacement for it and that is what made me switch to hyprland.


This is a fork of bismuth that works with plasma 6. Haven't tried it, but it is supposedly quite nice

https://github.com/zeroxoneafour/polonium


Could be. Haven't really looked into third party scripts development since I'm not using tiling. But actual KWin APIs should support it.


I've tried a couple but they had a tendency to lose track of windows and bug out in annoying ways. Perhaps they are better now, but having already set up wofi, a notification daemon, and bt/wifi managers I don't see what Plasma would even get me.


Really been digging using Hyprland with arch.


Does anyone know what screen sharing looks like in apps like slack with hyprland?


It works, but you have to pick the app/screen you want to share 2 or 3 times, which is pretty annoying.


obs works and you can capture per-window via pipewire




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: