Skip to content

config/lua: allow re-enabling monitors#14447

Merged
vaxerski merged 1 commit into
hyprwm:mainfrom
bizmythy:lua-monitor-disable-handling
May 12, 2026
Merged

config/lua: allow re-enabling monitors#14447
vaxerski merged 1 commit into
hyprwm:mainfrom
bizmythy:lua-monitor-disable-handling

Conversation

@bizmythy
Copy link
Copy Markdown
Contributor

@bizmythy bizmythy commented May 12, 2026

Describe your PR, what does it fix/add?

This PR configures the Lua configuration setting hl.monitor.disabled = false to enable the monitor.

This allows Lua scripts to enable monitors that were previously disabled. Without this change, the only way I could find to re-enable a disabled monitor was to reload the entire configuration.

Is there anything you want to mention? (unchecked code, possible bugs, found problems, breaking compatibility, etc.)

This is not how the original hyprlang configuration worked, so I totally understand if this is not a change that we want to make. However, I think the Lua configuration needs to provide some way to allow a user script to re-enable disabled monitors. Otherwise, I'm not sure how one would write a keybind that toggled a monitor on/off for example.

Is it ready for merging, or does it need work?

Ready for merging, very small change.

@github-actions
Copy link
Copy Markdown

Hello and thank you for making a PR to Hyprland!

Please check the PR Guidelines and make sure your PR follows them.
It will make the entire review process faster. :)

If your code can be tested, please always add tests. See more here.

beep boop, I'm just a bot. A real human will review your PR soon.

Copy link
Copy Markdown
Member

@vaxerski vaxerski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@vaxerski vaxerski merged commit b76a9e0 into hyprwm:main May 12, 2026
9 of 10 checks passed
Aqa-Ib pushed a commit to Aqa-Ib/Hyprland that referenced this pull request May 13, 2026
@alba4k
Copy link
Copy Markdown
Contributor

alba4k commented May 13, 2026

Doesn't seem to work, though?

Furthermore, I don't think reloading your config should always re-enable every single connected monitor (?)

@bizmythy
Copy link
Copy Markdown
Contributor Author

bizmythy commented May 14, 2026

Doesn't seem to work, though?

It does seem to be working for my configuration. I'm curious what isn't working for you.

I got the AI to write a small test script to show the state switching in a basic Lua config: https://gist.github.com/bizmythy/94afea4178eaf2f181d738349ea240fc
Note that the wayland/debugging live session doesn't properly visually show the monitors being disabled, but the log output inspecting hyprctl shows they are disabled/enabled. On real monitors in my config, the actual monitor fully disconnects/reconnects properly.

Furthermore, I don't think reloading your config should always re-enable every single connected monitor (?)

This is not what this does, to my knowledge. Reloading the config resets all configured monitors to their configured state. If a monitor specifies disabled = true, it will be disabled (was the case before). Now, if a monitor specifies disabled = false, it will be enabled.
This is important for things like toggling monitor states with a Lua function (run from a keybind or other event).
Before this change, once the config sets disabled = true for a monitor, there is no way to re-enable it without a full configuration reload.

@bizmythy bizmythy deleted the lua-monitor-disable-handling branch May 14, 2026 03:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants