From 90d05a6a5d2956a2ca696d0fe96eabd148388985 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 14 Aug 2024 03:56:56 +0200 Subject: ... --- accounts/gkleen@sif/hyprland.nix | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'accounts/gkleen@sif') diff --git a/accounts/gkleen@sif/hyprland.nix b/accounts/gkleen@sif/hyprland.nix index 83b13729..22b64611 100644 --- a/accounts/gkleen@sif/hyprland.nix +++ b/accounts/gkleen@sif/hyprland.nix @@ -271,6 +271,24 @@ in { "$mainMod, mouse:272, movewindow" "$mainMod, mouse:273, resizewindow" ]; + bindl = [ + ", switch:off:Lid Switch,exec,hyprctl dispatch dpms on eDP-1" + ", switch:on:Lid Switch,exec,hyprctl dispatch dpms off eDP-1" + + ", switch:off:Lid Switch,exec,${pkgs.writeShellScript "clamshell-off" '' + export PATH="${lib.makeBinPath (with pkgs; [ jq ])}:$PATH" + [[ $(hyprctl monitors -j | jq '.[] | select(.name == "eDP-1") | .disabled') = "true" ]] || exit 0 + + hyprctl keyword monitor \"eDP-1,3840x2160@59.99900,auto,1.5\"" + ''}" + ", switch:on:Lid Switch,exec,${pkgs.writeShellScript "clamshell-on" '' + export PATH="${lib.makeBinPath (with pkgs; [ jq ])}:$PATH" + + [[ $(hyprctl monitors -j | jq 'reduce (.[] | select(.disabled == false)) as $_ (0; .+1)') -gt 1 ]] || exit 0 + + hyprctl keyword monitor \"eDP-1,disable\" + ''}" + ]; windowrulev2 = [ "suppressevent maximize fullscreen, class:.*" -- cgit v1.2.3