Skip to content

[FEAT] Add disable property to monitors #159

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

Open
leiserfg opened this issue Feb 5, 2025 · 7 comments
Open

[FEAT] Add disable property to monitors #159

leiserfg opened this issue Feb 5, 2025 · 7 comments
Assignees
Labels
enhancement New feature or request

Comments

@leiserfg
Copy link

leiserfg commented Feb 5, 2025

Is your feature request related to a problem? Please describe.
monitors plugin allow to set the position of the monitors, but sometimes is useful to disable them (like in the case of connecting the laptop to a big screen while I don't want to see the laptop).

Describe the solution you'd like
Expose the disable flag of the monitors

Describe alternatives you've considered
I use shikane but the way hyprland makes it not to work sometimes, given that pyprland uses hyprland directly instead of wayland protocols it should work better.

@leiserfg leiserfg added the enhancement New feature or request label Feb 5, 2025
@fdev31
Copy link
Collaborator

fdev31 commented Feb 24, 2025

How do you see the feature ? Would something such as the following work for you?

[monitors]
disabled = ['HDMI-A-1']

@leiserfg
Copy link
Author

leiserfg commented Feb 24, 2025

Sorry, after double checking I figured out that the monitors plugin is kinda static, so one can't have many profiles. I thought it was more like an alternative to shikane or kanshi but via direct hyprland bindings. My use case is more like, having the laptop enabled but to disable it when my external monitor is connected. But that seems not to be possible with this plugin. Feel free to close the issue is that is too far from the scope.

@fdev31
Copy link
Collaborator

fdev31 commented Feb 24, 2025

Hm... I use https://github.com/fdev31/wlr-layout-ui?tab=readme-ov-file#magic-layout for such scenario, but maybe it's more limited (I don't know the tools you are mentioning). It calls hyprctl for the settings.

But if you can think of a syntax that would allow such things in the monitors plugin it's probably doable.

@leiserfg
Copy link
Author

With shikane (kanshi is similar but less powerful) you can setup the monitors using any tool and then record the current setup and make it a rule (by matching model, connector ...) and it checks the rules every time there is a wayland notification. But in the way hyprland works, the part of recording does not work well because it does not allow too apps to control the monitors at the same time. That's why I was looking into an alternative doing the same but using hyprland native messages instead. Let me have a look at wlr-layout thanks.

@fdev31
Copy link
Collaborator

fdev31 commented Feb 24, 2025

Wlr-layout doesn't have any complex matching rules, it just takes the currently connected monitors to guess which profile to use... It only matches the connected ports, not the models, but the current code for the matching is relatively simple and more (complex) options can be added.
I understand matching by model can be useful, what other option do you use the most?

@leiserfg
Copy link
Author

I think models and ports is enough, maybe models should allow taking wildcards (so one can define profiles that catch any monitor as fallback). I think the design of shikane could be a good example.

@fdev31
Copy link
Collaborator

fdev31 commented Feb 25, 2025

I'm not sure to understand how it selects which profile to enable, if every output has a match and none is left over? Then it's very close to wlr-layout-ui if I add support for matching the monitor names instead of the ports. There would be 3 options (set for each monitor): port, name or both. I am not sure the regex thing is useful... but maybe I can also allow it.

I see it could always use the port, and optionally the name... and the most specific profile wins.

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