From 0d6d4ac1097c93ce3c0eb05113d471d1cb6e0648 Mon Sep 17 00:00:00 2001 From: Aly Raffauf Date: Sun, 4 Aug 2024 19:33:59 -0400 Subject: [PATCH] hyprland: restore old clamshell script --- homeManagerModules/desktop/hyprland/scripts.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/homeManagerModules/desktop/hyprland/scripts.nix b/homeManagerModules/desktop/hyprland/scripts.nix index 7c0879ac..c003b8fa 100644 --- a/homeManagerModules/desktop/hyprland/scripts.nix +++ b/homeManagerModules/desktop/hyprland/scripts.nix @@ -9,10 +9,10 @@ virtKeyboard = lib.getExe' pkgs.squeekboard "squeekboard"; in { clamshell = pkgs.writeShellScript "hyprland-clamshell" '' + NUM_MONITORS=$(${hyprctl} monitors all | grep Monitor | wc --lines) EDP_STATUS=$(${hyprctl} monitors all | grep -A 15 "Monitor eDP-1" | grep "disabled:") - if [ "$1" == "on" ]; then - if [[ "$(${hyprctl} monitors all)" =~ \s(DP|HDMI)-[0-9]+ ]]; then + if [ $NUM_MONITORS -gt 1 ]; then ${hyprctl} keyword monitor "eDP-1, disable" fi elif [ "$1" == "off" ]; then