aboutsummaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorDavid Runge <david.runge@frqrec.com>2014-02-20 14:58:39 +0100
committerDavid Runge <david.runge@frqrec.com>2014-02-20 14:58:39 +0100
commitcaf523eb653bf75c18f9c6d227fbd454a0c497a3 (patch)
tree91cff1be4ced5955729adf43931197366ec44230 /bin
parent3f2a9b99b4f9867a99a09a0e5b7e1c3612359d29 (diff)
downloaddotfiles-caf523eb653bf75c18f9c6d227fbd454a0c497a3.tar.gz
dotfiles-caf523eb653bf75c18f9c6d227fbd454a0c497a3.tar.bz2
dotfiles-caf523eb653bf75c18f9c6d227fbd454a0c497a3.tar.xz
dotfiles-caf523eb653bf75c18f9c6d227fbd454a0c497a3.zip
Adding all other screens.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/lid-switch-action16
1 files 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