Skip to content

Dim keyboard on idle + turn off monitor at lid close - #76

Merged
malik-na merged 6 commits into
omacom:mainfrom
grevevarg:dim-keyboard
Jan 7, 2026
Merged

malik-na merged 6 commits into
omacom:mainfrom
grevevarg:dim-keyboard

Conversation

@grevevarg

Copy link
Copy Markdown

Adds a listener to default hypridle config that turns off keyboard backlights at the same time the screen turns off.
Also adds some commands to the default monitors config that turns off screen + keyboard when the lid is closed.

Closes #70

Implementation should theoretically work
Separate listener is used before DPMS off to save state
Restoring the state is handled by the original listener
Closes omacom#70
Previous implementation failed testing
It's possible that we could do a bare brightnessctl -s?
Then the restore in the other listener might work.
However for now, this is tested and functioning
Assumes that all built in monitors are eDP-1
Mac Minis dont have a lid event so this should never get reached
on them anyway.
Should hopefully mitigate some battery use + make it behave like
people expect laptops to behave.
@malik-na

Copy link
Copy Markdown
Member

Hi @grevevarg
Thanks for your work. I tested this. It seems to work only once and locks the screen when you close the lid. But once you open the lid and unlock, it doesn't work the next time you close the lid.

Please test again and let me know.
Cheers!

@grevevarg

Copy link
Copy Markdown
Author

Just so we're on the same page, is the issue that the screen+kb doesn't turn off when you close the lid again?
Or is the issue that the computer doesn't lock on lid down event?
Nothing here touches locking logic tied to the lid down event. Also are you on hyprland 0.49 or 0.51?

@grevevarg

Copy link
Copy Markdown
Author

This is slightly more reliable due to splitting up the binds and sending calls separately.
The issues with it not locking after a second time i believe is separate from this. I was only able to replicate those issues by opening and closing the lid multiple times in a short timeframe.
When repeatedly opening and closing lid even without these options, hyprlock fails to launch unless you wait for a while. It might rather be related to lockctl whichdoes pidof hyprlock || hyprlock to avoid opening multiple instances of hyprlock. Imo if its a priority to patch that it should be done in a separate issue

@malik-na malik-na left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I tested this again and it doesn't work. The display doesn't go off when I close the lid.
The lock works only first time, once you unlock and close the lid again, it doesn't lock.

@filipprober

Copy link
Copy Markdown

Works perfectly fine on my MacBook Pro M2 Max.

@malik-na
malik-na merged commit a7f0511 into omacom:main Jan 7, 2026
briantoll added a commit to briantoll/omarchy-mac that referenced this pull request Oct 12, 2026
migrations/1767821287.sh, 1767821288.sh and 1767821291.sh were written for
the hypridle-era tree (PR omacom#76) and each guards on a file quattro no longer
ships: ~/.config/hypr/hypridle.conf, monitors.conf and bindings/media.conf.
On a current install every one of them prints its "Add ..." header and
changes nothing; on an upgraded install they can only edit a leftover file
that nothing reads, since hypridle itself was retired with the 3.x stack.

What they stood for already lives in the Lua config: the Apple SMC lid binds
in default/hypr/bindings/utilities.lua and the keyboard backlight keys in
default/hypr/bindings/media.lua. Idle dimming is being built as a shell
service instead (omacom#340). Stale completion markers for the deleted files are
ignored by omarchy-migrate, which only walks the packaged migrations.

Fixes omacom#689

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Turn off keyboard backlight automatically after some time

3 participants