Ignore disabled monitors for -m

Don't check monitors without dimensions in xrandr's output.
Addresses #26.
break
noctuid 8 years ago
parent 45e9d72711
commit e9e222f6fa

@ -244,6 +244,7 @@ update_geometry_settings_for_monitor() {
monitors_info=$(xrandr --query | awk '/ connected/ {gsub("primary ",""); print}') monitors_info=$(xrandr --query | awk '/ connected/ {gsub("primary ",""); print}')
while read -r monitor; do while read -r monitor; do
monitor_geo=$(echo "$monitor" | awk '{print $3}') monitor_geo=$(echo "$monitor" | awk '{print $3}')
if [[ $monitor_geo =~ ^[0-9]+x[0-9]+\+[0-9]+\+[0-9]+$ ]]; then
x_begin=$(echo "$monitor_geo" | awk -F '+' '{print $2}') x_begin=$(echo "$monitor_geo" | awk -F '+' '{print $2}')
y_begin=$(echo "$monitor_geo" | awk -F '+' '{print $3}') y_begin=$(echo "$monitor_geo" | awk -F '+' '{print $3}')
x_width=$(echo "$monitor_geo" | awk -F 'x' '{print $1}') x_width=$(echo "$monitor_geo" | awk -F 'x' '{print $1}')
@ -255,6 +256,7 @@ update_geometry_settings_for_monitor() {
current_monitor=$(echo "$monitor" | awk '{print $1}') current_monitor=$(echo "$monitor" | awk '{print $1}')
break break
fi fi
fi
done <<< "$monitors_info" done <<< "$monitors_info"
fi fi

Loading…
Cancel
Save