hyprland: restore old clamshell script
Some checks are pending
git-mirror / gitlab-sync (push) Waiting to run
nix-build / default-build (push) Waiting to run
nix-build / fallarbor-build (push) Waiting to run
nix-build / lavaridge-build (push) Waiting to run
nix-build / mauville-build (push) Waiting to run
nix-build / petalburg-build (push) Waiting to run
nix-build / rustboro-build (push) Waiting to run
nix-check / fmt-check (push) Waiting to run
nix-check / eval-check (push) Waiting to run

This commit is contained in:
Aly Raffauf 2024-08-04 19:33:59 -04:00
parent b41dbea8ab
commit 0d6d4ac109

View file

@ -9,10 +9,10 @@
virtKeyboard = lib.getExe' pkgs.squeekboard "squeekboard"; virtKeyboard = lib.getExe' pkgs.squeekboard "squeekboard";
in { in {
clamshell = pkgs.writeShellScript "hyprland-clamshell" '' 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:") EDP_STATUS=$(${hyprctl} monitors all | grep -A 15 "Monitor eDP-1" | grep "disabled:")
if [ "$1" == "on" ]; then 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" ${hyprctl} keyword monitor "eDP-1, disable"
fi fi
elif [ "$1" == "off" ]; then elif [ "$1" == "off" ]; then