update lid settings
This commit is contained in:
parent
6e3bd00d04
commit
d7103b0a00
2 changed files with 144 additions and 126 deletions
9
modules/desktop/hyprland/displayswitch.sh
Normal file
9
modules/desktop/hyprland/displayswitch.sh
Normal 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
|
||||
|
|
@ -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;
|
||||
})
|
||||
];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue