From caf523eb653bf75c18f9c6d227fbd454a0c497a3 Mon Sep 17 00:00:00 2001 From: David Runge Date: Thu, 20 Feb 2014 14:58:39 +0100 Subject: Adding all other screens. --- bin/lid-switch-action | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/bin/lid-switch-action b/bin/lid-switch-action index e8376aa..94c05c3 100755 --- a/bin/lid-switch-action +++ b/bin/lid-switch-action @@ -26,15 +26,19 @@ IFS=$'\r\n' connectedOutputs=($(xrandr | grep " connected" | sed -e "s/\([A-Z0-9 # TODO: Add checks for other ports #Check for HDMI1 connection -HDMI=$(containsElement "HDMI1" "${connectedOutputs}") +HDMI1=$(containsElement "HDMI1" "${connectedOutputs}") +HDMI2=$(containsElement "HDMI2" "${connectedOutputs}") +VGA1=$(containsElement "VGA1" "${connectedOutputs}") +DP1=$(containsElement "DP1" "${connectedOutputs}") +DP2=$(containsElement "DP2" "${connectedOutputs}") # Suspend or switch screen setup, depending on how many screens are connected # If the lid was closed if [ $1 = 0 ];then - # Check if more than one screen or HDMI1 is connected - if [[ ${#connectedOutputs[@]} -gt 1 || $HDMI ]];then - echo "More than one screen connected, or HDMI1 connected" - echo "Not suspending, disabling eDP1, making HDMI1 primary screen." + # Check if more than one screen is connected + if [[ ${#connectedOutputs[@]} -gt 1 || $HDMI1 || $HDMI2 || $VGA1 || $DP1 || $DP2 ]];then + echo "More than one screen connected." + echo "Not suspending, disabling eDP1, making other screen primary." autorandr -l external-docked else echo "Only one screen connected" @@ -44,7 +48,7 @@ if [ $1 = 0 ];then # If the lid was opened elif [ $1 = 1 ];then # Check if more than one screen or HDMI1 is connected - if [[ ${#connectedOutputs[@]} -gt 1 || $HDMI ]];then + if [[ ${#connectedOutputs[@]} -gt 1 || $HDMI || $HDMI2 || $VGA1 || $DP1 || $DP2 ]];then echo "More than one screen connected, or HDMI1 connected" echo "Setting up all connected screens." autorandr -l multi-docked -- cgit v1.2.3-54-g00ecf