Remix.run Logo
nickjj 2 days ago

Windows still has advantages for certain use cases, as much as I want to like Hyprland for everything.

For example, imagine this screencast recording set up:

    - You have a 4k monitor
    - You only want to record a 1920x1080 section of your screen (OBS can do this in both set ups)
    - You only want certain windows to appear in that 1920x1080 zone
    - You want other adhoc windows (notepad, etc.) floating around that recording zone
    - You want to easily be able to pick and flip between the apps in that 1920x1080 zone
On Windows this is quite possible and requires almost nothing to be done. You could install a tool like Sizer to resize and position windows into a specific spot and just drag / drop everything else around as needed. You could also optimize things with AHK to make it easier to only open apps in that zone.

With Hyprland this isn't as easy to pull off. A maintainer mentioned to me that I'd likely have to write a Hyprland plugin which would be C++. I'm not a C++ developer though.

I guess you could probably make a workable but not as good solution by hyprctl dispatching commands in a shell script to position specific windows into the zone and then have a notepad like app dedicated to always floating, but when you record hundreds of videos you want an optimized solution to the highest degree.

In Hyprland's defense I've only been using it for a few days but I saw nothing in their docs or the internet that would indicate there's features built into the tool to make this less painful.

If I could find a solution for this, I'd install it on my main machine.

ireadmevs 2 days ago | parent | next [-]

I haven’t the tried Hyprland, but I use i3, which I assume it should be similar. I do this sort of thing quite often when presenting on zoom at work. Suppose I want to present only the top-left section of my screen, then I split vertically first and the left side I split horizontally. This other 2 zones I use to put other supporting windows and to search stuff out of screen. When I need to present more apps, i3 also allow you to stack windows in a specific zone. It’s quite easy to switch between all the windows and have full control of the layout.

uberduper 2 days ago | parent | prev [-]

I'm probably not thinking about your use case the same way you are, but it seems like you could run a nested hyprland session in a 1920x1080 window and screenshare just the nested hyprland window. Run the apps you want to share inside that nested hyprland session.

I don't know of any reason that wouldn't work, but I haven't tried it so I'm not certain it would.

nickjj 2 days ago | parent | next [-]

I didn't even know that was possible but I think it would be the perfect solution, as long as it ran efficiently and managing the hotkeys between both sessions wasn't a problem. I wonder how that would work if you used the same configs.

If it were possible to pull off, that would be the perfect combo:

    - A dedicated 1920x1080 recording zone, using Hyrpland's config file to automatically resize and position this Hyprland session in whatever spot makes the most sense (top middle of a 4k monitor, etc.)
    - The nested session could use 1.5x or 2x scaling so fonts are larger on video[0]
    - There's no BS or manual steps because the nested session is a full fledged Hyprland set up, so tiling, floats, workspaces and app launching is fully working
    - Free to float whatever you want around the recording zone from the main Hyprland set up
[0]: On Windows with WSL 2 I work around this with a shell script I made to adjust my terminal's font size, etc.. I'd love to be able to drop that and have things be perfectly sized all the time when recording.

Edit:

The Hyprland docs mentions you should make a separate config and also avoid running any exec/exec-once commands. That could be a problem because I would want my wallpaper, mako, waybar and walker to come up in the videos which means running multiple copies of these.

Maybe it could work tho in the end. I will play with it and see how it goes. Thank you for introducing me to the idea, even if it doesn't work, it's an interesting concept.

uberduper a day ago | parent [-]

I've only used it for testing/debugging so I didn't need any of that capability. I'm not sure why they recommend avoiding exec in the config. Since it would still be under the same user session, dbus things could get wonky. Nested hyprland will automatically create/use ~/.config/hypr/hyprlandd.conf and you'll def want to have unique keybinds. If you haven't gone too crazy with keybinds, just changing the main mod key (I used capslock) in the nested config should take care of most things.

nickjj a day ago | parent [-]

Thanks yeah, I didn't go too crazy with binds yet. Maybe ALT + TAB is the only thing that's not using the main mod key.

It's probably going to get complicated though due to wanting to run waybar, walker, wallpaper, etc. in the nested session but if you do anything that's going to modify its state in that session is also going to affect the outer one since only 1 process runs for those tools.

It's almost like you need a separate copy for everything that runs in exec but with a different process name too.

christophilus 2 days ago | parent | prev [-]

Yep. I’ve done this with Niri, too. It’s a really nice capability.

nickjj 2 days ago | parent [-]

How did you end up managing things like waybar?

You'd end up with 2 copies of it running and you typically killall/pkill to reload it because it's expected you'd only run 1 copy but now with this nested solution there's 2 copies running.

The only thing really stopping me from Niri is it doesn't seem to have dynamic configs to let you have 1 main config and then source in a smaller 2nd config to overwrite settings in the main config.

That's really useful for having personalized changes per device or overwriting specific colors to change themes.

Hyprland has a `source` feature for this.