Hyprland
Hyprland copied to clipboard
Persistent workspaces on monitors
Hi :wave: and thanks for developing such a beautiful window manager :+1:
A bit of context first
- I come from BSPWM and I use between 1 and 3 monitors depending on where I am
- I work with 10 workspaces automatically created and dynamically rearranged on monitor plug/unplug (script here) e.g.
- with 1 monitor (on the laptop alone) I have workspaces 1-10 available
- with 2 monitors I have 1-5 on the first one, 6-10 on the second one
- with 3 monitors I have 1-3 on the 1st, 4-7 on the 2nd and 8-10 on the 3rd
Usage
- I put my main stuff on the "middle" where it's likely that I will have it on the main monitor. e.g. browser on workspace 4, terminal on 3
- When I move around and unplug my other monitors, the workspaces are just rearranged on the remaining monitors but they keep their number so I know where's what and it's not a big mess
Feature Request?
It does not seem that Hyperland allows this behavior as empty workspaces are destroyed. It seems that there have been similar questions in #654 and #349 but the workaround is to move the workspace to the right monitor upon creation. Or maybe I missed something?
I would like Hyperland to NOT destroy empty workspaces and allow their creation with hyprctl. This way I can create them where I want and rearrange them with a simple IPC script.
:point_right: Is there something I missed that could solve my problem? (started Hyperland just yesterday) :point_right: Would you accept such a feature request? I can contribute code with a few pointers.
Thanks!
I've tried to make persistent workspaces before but the workspace protocol really didnt like it, I might try in the future again.
Please remember that in those issues you linked, there is a solution that will work, so technically this is not a necessity.
Thanks for the quick answer! I did not know it was a limitation on the workspace protocol, where can I read more about Hyperland's internals?
I am currently working on a variation of this script to take into account plugging/unplugging monitors and redirecting the workspace to the right monitor. I'll post this here once I have finished :+1:
it's not a limitation - it's some annoying thing I was prolly doing wrong. The protocol doesnt disallow this
where can I read more about Hyperland's internals?
/src
Created a gist that does the job more or less. There is some flickering:
- The workspace is created on the active monitor
- It is then moved to the correct one
- The "leaving" animation triggers on the first monitor as if the workspace was there to begin with, and moved to another monitor -- could be a bug :bug: here as the leaving animation does not seem to take into account the right "starting point"
The workaround in #349 works but requires static monitor configuration as far as I understand. Reminder below:
# focus
bind=SUPER,1,focusmonitor,DP-2
bind=SUPER,1,workspace,1
# move
bind=SUPERSHIFT,1,movetoworkspace,1
bind=SUPERSHIFT,1,movecurrentworkspacetomonitor,DP-2
added wsbind in 006228109281ed4d07ace635cf419c605d62e4a6, partially solves this issue. See the wiki entry for its usage.
Wow that is awesome 🎉
- What is the behavior when said monitor is not connected? Does it fallback on another monitor?
- Would it be possible to reload another Hyprland configuration on monitor plug/unplug? I'm thinking disabling the autoreload, change the config symlink in an udev rule or something and trigger a reload with hyprctl
Wow that is awesome
no, it's Hyprland
What is the behavior when said monitor is not connected? Does it fallback on another monitor?
behaves as if the wsbind wasnt there
Would it be possible to reload another Hyprland configuration on monitor plug/unplug? I'm thinking disabling the autoreload, change the config symlink in an udev rule or something and trigger a reload with hyprctl
hyprctl reload
misc:disable_autoreload
read the wiki
Hi, wsbind is amazing! Can you add a possibility to bind "all other" workspaces? I have
wsbind=1,eDP-1
wsbind=3,DP-5
, and would like all other workspaces to open only on the 3rd monitor. Now I guess I'd have to list all of them individually
I had the same need, and created a script to do this. It will get the monitors, order them from left to right, top to bottom, and then it binds and moves the workspaces to the requested monitors. Left: workspace 1-5 | Right: workspace 6-10 or Left: 1-3 | Middle: 4-7 | Right: 8-10 (untested) By detecting the position of the monitors, you do not need to hardcode their IDs.
hyprmonitor.txt (It should obviously be a .py file but that is not accepted by github)
I will close this. wsbind exists. Workspaces are destroyed - but that's how it will be. It should be up to your bar to display persistent workspaces if you really need em. See e.g. https://github.com/Alexays/Waybar/issues/1629
Reviving this now that Waybar has support for persistent workspaces :star_struck: :clap:
Has anyone success with a multi monitor setup? I face many issues on my side and I wonder if it's my particular configuration or bugs:
- Selecting a workspace sometimes focuses the wrong workspace e.g. selecting workspace 3 makes workspace 7 active (I can create windows there). I could sometimes even select an invisible workspace and create windows there (as per the logs)
- Swipe does not stop on the edges of a monitor e.g. swiping from workspace 3 (on monitor A) to 4 (on monitor B)
- Cycling behavior is not intuitive to configure e.g. cycle only on the workspaces on the monitor. Although for this one it may be scriptable
- Monitor names can change, sometimes making the configuration obsolete if that happens
I created a gist to arrange workspaces on monitors dynamically, I'll plug that into an event listener on the IPC when I can get it to work :grimacing:
Help appreciated :pray: