Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workspace Rules with hyprctl (or similar) #9453

Open
jbirnick opened this issue Feb 21, 2025 · 5 comments
Open

Workspace Rules with hyprctl (or similar) #9453

jbirnick opened this issue Feb 21, 2025 · 5 comments
Labels
enhancement New feature or request

Comments

@jbirnick
Copy link

Description

I have a laptop which I

  • sometimes use as a a laptop alone,
  • and sometimes use connected to a docking station with external monitors.

So my workspace rules (that bind the workspaces to monitors etc.) depend on which monitors are connected.

The best way would be if hyprland could support this out of the box. It doesn't, but I thought "well I could code it using the IPC sockets".
But in fact, I can't. Because the IPC (i.e. hyprctl) doesn't allow me to set workspace rules.

So it would be great to have a solution to change the workspace rules on the fly. Either by adding this functionality to IPC. Or, what would also be cool, to generally have an IPC command that says "read that additional config file and execute it". So that one could combine multiple config files. So I have one main big config file, and then I have a couple of additional ones which only contain workspace rules for the monitor/workspace setup.

@jbirnick jbirnick added the enhancement New feature or request label Feb 21, 2025
@vaxerski
Copy link
Member

whats the problem with writing a script to output to some config file (e.g. localConfig.conf) based on the state of the system?

@jbirnick
Copy link
Author

Yeah but that's a very hacky solution:

  • you would have to merge the whole config file with the local stuff
  • now when someone edits the main config file, it's not automatically reloaded, etc.

@jbirnick
Copy link
Author

jbirnick commented Feb 21, 2025

Btw why do workspace rules not work with hyprctl? I expected hyprctl keyword workspace [params] to work, but it doesn't.

Wait, I just notice that such dynamically created rules are actually listed in hyprctl workspacerules, but somehow they don't show any effect? EDIT: I noticed they can't overwrite existing workspace rules, I guess that's the problem.

@jbirnick
Copy link
Author

Okay I guess I can source a local config which is adapted by a script, and then reload the main config whenever the local config has changed.

@vaxerski
Copy link
Member

Okay I guess I can source a local config which is adapted by a script, and then reload the main config whenever the local config has changed.

No need. If the file is sourced, any changes to it will reload them instantly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants