Created
December 21, 2025 02:45
-
-
Save thetrung/286116c3008a011d378268d62827b6e4 to your computer and use it in GitHub Desktop.
Hyprland Monitors config for Laptop : auto disable/enable on lid open/close
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # See https://wiki.hyprland.org/Configuring/Monitors/ | |
| # List current monitors and resolutions possible: hyprctl monitors | |
| # Format: monitor = [port], resolution, position, scale | |
| # Optimized for retina-class 2x displays, like 13" 2.8K, 27" 5K, 32" 6K. | |
| env = GDK_SCALE,1.75 | |
| monitor=,preferred,auto,auto | |
| # monitor=eDP-1,disable | |
| # monitor=HDMI-A-1,2560x1440@120,auto,1#,mirror,eDP-1 | |
| # Trigger when the lid is closing (switch:off) | |
| # Disables the laptop monitor when an external one is connected | |
| bindl = ,switch:on:Lid Switch,exec,hyprctl keyword monitor "eDP-1, disable" | |
| bindl = ,switch:on:Lid Switch,exec,hyprctl keyword monitor "HDMI-A-1,2560x1440@120,auto,1" | |
| # Trigger when the lid is opening (switch:on) | |
| # Re-enables the laptop monitor | |
| bindl = ,switch:off:Lid Switch,exec,hyprctl keyword monitor "eDP-1,preferred,auto,auto" | |
| bindl = ,switch:off:Lid Switch,exec,hyprctl keyword monitor "HDMI-A-1,disable" | |
| # Good compromise for 27" or 32" 4K monitors (but fractional!) | |
| # env = GDK_SCALE,1.75 | |
| # monitor=,preferred,auto,1.666667 | |
| # Straight 1x setup for low-resolution displays like 1080p or 1440p | |
| # env = GDK_SCALE,1 | |
| # monitor=,preferred,auto,1 | |
| # Example for Framework 13 w/ 6K XDR Apple display | |
| # monitor = DP-5, 6016x3384@60, auto, 2 | |
| # monitor = eDP-1, 2880x1920@120, auto, 2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment