Code: Select all
pman grep
grep is a common linux command for the shell.
Code: Select all
-SCRNSECTION="
+#handle multiple screens
+SCREEN_LIST=$(grep -o '^[^a-zA-Z]*Screen[^"]*"Screen[0-9]\+"' /etc/X11/xorg.conf | grep -o 'Screen[0-9]\+' | grep -o '[0-9]\+')
+SCRNSECTION=""
+for i in $SCREEN_LIST; do
+SCRNSECTION="$SCRNSECTION
Section \"Screen\"
- Identifier \"Screen0\"
- Device \"Card0\"
- Monitor \"Monitor0\"
- DefaultDepth $FINALDEPTH
- Subsection \"Display\"
- Depth $FINALDEPTH
- Modes \"${FINALXY}\"
- EndSubsection
+ Identifier \"Screen$i\"
+ Device \"Card$i\"
+ Monitor \"Monitor$i\"
+ DefaultDepth $FINALDEPTH
+ Subsection \"Display\"
+ Depth $FINALDEPTH
+ Modes \"${FINALXY}\"
+ EndSubsection
EndSection
"
+done
echo "$SCRNSECTION" >> /etc/X11/xorg.conf
This code should create a monitor section for the monitors
Code: Select all
grep -o '^[^a-zA-Z]*Screen[^"]*"Screen[0-9]\+"' /etc/X11/xorg.conf | grep -o 'Screen[0-9]\+' | grep -o '[0-9]\+'
Simply
Code: Select all
grep -o '^[^a-zA-Z]*Screen[^"]*"Screen[0-9]\+"' /etc/X11/xorg.conf
Code: Select all
Screen 0 "Screen0"
Code: Select all
grep -o '^[^a-zA-Z]*Screen[^"]*"Screen[0-9]\+"' /etc/X11/xorg.conf | grep -o 'Screen[0-9]\+' | grep -o '[0-9]\+'
Code: Select all
0
Code: Select all
for monitor in 0 1;do
SCRNSECTION="$SCRNSECTION
Section \"Screen\"
Identifier \"Screen$monitor\"
Device \"Card$monitor\"
Monitor \"Monitor$monitor\"
DefaultDepth $FINALDEPTH
Subsection \"Display\"
Depth $FINALDEPTH
Modes \"${FINALXY}\"
EndSubsection
EndSection
"
done
echo "$SCRNSECTION" >> /etc/X11/xorg.conf
These two monitors must be inside xorg.conf already at this stage.
One problem to me is that the whole xorgwizard seems to need "for loops" also for the different FINALDEPTH and FINALXY of the monitors, if there is a program available - besides ddcprobe - to detect them .