update lid settings

This commit is contained in:
Glen Goodwin 2023-09-06 18:05:33 -04:00
parent 6e3bd00d04
commit d7103b0a00
2 changed files with 144 additions and 126 deletions

View file

@ -0,0 +1,9 @@
#!/usr/bin/env bash
if grep open /proc/acpi/button/lid/LID/state; then
hyprctl keyword monitor "eDP-1, 1920x1080, 0x0, 1"
else
if [[ $(hyprctl monitors | grep -c "Monitor") != 1 ]]; then
hyprctl keyword monitor "eDP-1, disable"
fi
fi

View file

@ -5,9 +5,10 @@ let
monitor=,preferred,auto,auto
# trigger when the switch is turning off
bindl = , switch:off:Lid Switch,exec,hyprctl keyword monitor "eDP-1, 1920x1080, 0x0, 1"
# bindl = , switch:off:Lid Switch,exec,hyprctl keyword monitor "eDP-1, 1920x1080, 0x0, 1"
# trigger when the switch is turning on
bindl = , switch:on:Lid Switch,exec,hyprctl keyword monitor "eDP-1, disable"
# bindl = , switch:on:Lid Switch,exec,hyprctl keyword monitor "eDP-1, disable"
bindl=,switch:Lid Switch, exec, displayswitch
$mainMod=SUPER
@ -188,4 +189,12 @@ in
];
systemdTarget = "xdg-desktop-portal-hyprland.service";
};
home.packages = [
(pkgs.writeShellApplication {
name = "displayswitch";
runtimeInputs = [ ];
text = builtins.readFile ./displayswitch.sh;
})
];
}