[HN Gopher] Hyprland Crash Course
       ___________________________________________________________________
        
       Hyprland Crash Course
        
       Author : gchamonlive
       Score  : 103 points
       Date   : 2024-03-23 21:40 UTC (1 days ago)
        
 (HTM) web link (xd1.dev)
 (TXT) w3m dump (xd1.dev)
        
       | gchamonlive wrote:
       | 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!
        
       | jnsaff2 wrote:
       | 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.
        
         | gchamonlive wrote:
         | 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?
        
           | drakerossman wrote:
           | 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...
        
             | gchamonlive wrote:
             | 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?
        
               | drakerossman wrote:
               | 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.
        
           | alwayslikethis wrote:
           | 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.
        
           | ta8645 wrote:
           | That is really disappointing to hear. It's depressing how
           | many projects don't have a commitment to backward
           | compatibility.
        
         | jborean93 wrote:
         | 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.
        
         | SushiHippie wrote:
         | 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)
        
         | pkulak wrote:
         | 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.
        
       | stephen wrote:
       | 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!
        
         | gchamonlive wrote:
         | 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.
        
           | stephen wrote:
           | > 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. :-)
        
             | gchamonlive wrote:
             | 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.
        
       | cmiller1 wrote:
       | 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.
        
         | gchamonlive wrote:
         | Well, that is... Worrying. Can you give specifics about the
         | occasions when hyprland broke on you?
        
           | cmiller1 wrote:
           | 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.
        
             | hollow-moe wrote:
             | 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
        
               | earthling8118 wrote:
               | 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.
        
         | Ferret7446 wrote:
         | That sounds like the earlier years of awesomewm. aweomsomewm's
         | config API was notoriously volatile, but stabilized later on;
         | hopefully Hyprland will also.
        
       | m1keil wrote:
       | 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".
        
         | FreeFull wrote:
         | That's possible with Niri, with its center-focused-column and
         | default-column-width settings. It's not a traditional tiling
         | WM, though
        
           | m1keil wrote:
           | Never heard of Niri before. Will take a look, cheers.
        
           | christophilus wrote:
           | I do it with PaperWM which is a niri-like Gnome extension.
        
         | nerdix wrote:
         | 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/
        
           | m1keil wrote:
           | Thanks, will take a look.
        
             | phero_cnstrcts wrote:
             | Please report back if it is working for you. I have the
             | same problem.
        
               | ccakes wrote:
               | I just changed and this is a LOT nicer! Also on a 49"
               | ultrawide
               | 
               | Thanks for the protip!
        
         | gryn wrote:
         | 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.
        
         | nullwarp wrote:
         | 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.
        
         | clircle wrote:
         | 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.
        
         | dsissitka wrote:
         | That's one of the reasons I use i3.                 gaps
         | horizontal 417       gaps inner      10       smart_gaps
         | inverse_outer
         | 
         | https://imgur.com/a/MjNBgms
        
         | pkkm wrote:
         | Related question, since we're on the topic: does Linux have a
         | way to split a single wide monitor into smaller "virtual"
         | monitors?
        
           | throw20240324 wrote:
           | I do this with xmonad. https://xmonad.github.io/xmonad-
           | docs/xmonad-contrib/XMonad-L...
        
         | pkulak wrote:
         | I wrote my own layout manager to do exactly this:
         | 
         | https://github.com/pkulak/filtile
        
         | kinleyd wrote:
         | Hyprland can do that, quite easily. It has windows rules that
         | allow you to place everything just so.
        
       | yogorenapan wrote:
       | I've been using Hyprland for a few months. It's been pretty
       | stable and I haven't had any issues so far
        
       | kelvie wrote:
       | 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".
        
       | habitue wrote:
       | Does anyone know what screen sharing looks like in apps like
       | slack with hyprland?
        
         | throwing_away wrote:
         | obs works and you can capture per-window via pipewire
        
         | Sanchless wrote:
         | It works, but you have to pick the app/screen you want to share
         | 2 or 3 times, which is pretty annoying.
        
       | ncrmro wrote:
       | Really been digging using Hyprland with arch.
        
       | shmerl wrote:
       | Is there any benefit in tiling only WMs vs using tiling let's say
       | in KDE?
        
         | luyu_wu wrote:
         | Hyprland isn't really tiling only, floating works quite well
         | too! I'd say lightweight, customize, and eye-candy as the main
         | advantages though.
        
         | idle_zealot wrote:
         | 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.
        
           | shmerl wrote:
           | 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.
        
             | gchamonlive wrote:
             | 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.
        
               | shmerl wrote:
               | Could be. Haven't really looked into third party scripts
               | development since I'm not using tiling. But actual KWin
               | APIs should support it.
        
               | pimeys wrote:
               | 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
        
       | ApolloFortyNine wrote:
       | 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
        
       | Arcuru wrote:
       | Does Hyprland still set the default wallpaper to randomly show
       | their favorite anime girl?
        
         | talhah wrote:
         | There's a setting to disable it actually.
         | 
         | This should do the trick.                   misc {
         | disable_hyprland_logo = true         }
        
       | AceJohnny2 wrote:
       | 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.
        
         | ivanbalashov239 wrote:
         | 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
        
       | zilti wrote:
       | 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.
        
         | gchamonlive wrote:
         | 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?
        
       | Cu3PO42 wrote:
       | 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
        
         | gchamonlive wrote:
         | This is very interesting! Do you think you could share what you
         | have developed so far using that?
        
           | Cu3PO42 wrote:
           | 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
        
             | gchamonlive wrote:
             | That is awesome, thanks a lot!
        
       ___________________________________________________________________
       (page generated 2024-03-24 23:01 UTC)