PDA

View Full Version : [ubuntu] Choose different xorg.conf & environments from greeting screen



0-ashley
September 25th, 2015, 09:10 AM
Hello

I'm currently running Ubuntu 15.04 on a Core i5 computer, and have recently upgraded my ageing GT 630 GPU to a GTX 970. mostly for improvements to X-Plane flight sim and gaming (via Steam)
With the old card I had two simple bash scripts which used XRANDR to switch off or on a 2nd monitor, the reason being its nicer to play games with the other machine blanked and that Steam sometimes has a habit (might be a Ubuntu thing) of opening games on the 2nd, not the main, screen.

What I'd like to do is to be able to choose these from the login screen. For X-Plane I'm using some advice/scripts from within the X-Plane community.
To play X-Plane across two screens I hit CTRL-ALT-F1, and launch X-Plane thus:

launch.sh


#!/bin/bash


sudo service lightdm stop
xinit /home/ashley/X-Plane_Launch_Scripts/XP64 -config xorg.conf.wide


echo "restart unity ? (y/n)"
read reponse
if [ "$reponse" = "y" ]
then
sudo service lightdm start
fi
# end of script



XP64.sh

#!/bin/bash
xsetroot -cursor_name left_ptr
xset -dpms
xset s off
xset s noblank
/home/ashley/X-Plane\ 10/X-Plane-x86_64 > /dev/null 2>&1
#endofscript



the piping to /dev/null is because X-Plane is very chatty in console (it logs what its doing if there is a problem anyway)


I've got a symlink called "fly" to launch.sh in my executable path (usr/local/bin/) so after hitting CTRL-ALT-F1 I can just type "fly" (without quotes, of course)

What I would, ideally, like to do on the initial Ubuntu Greeting screen is:

Ubuntu - standard unity desktop, standard x-org.conf. This has an extended desktop, with the launch bar in each (not mirrored)
Games - standard unity desktop, x-org,conf set to use 1x screen only. Other screen would be blank (I've not got an xorg.conf for this yet)
Flying - extended desktop (xinerama), working with X-Plane as above and using the xorg.conf.wide (or an improvement of..) that I've posted below.

I'm not worried about auto launching Steam (Games) but auto-launching X-Plane (Flying) (with no desktop environment) would be nice.

My question is what would I begin to look at, copy, modify etc? I understand you can launch different desktop environments (if installed) from the Greeting screen, but how could I choose an xorg.conf and in the case of the Flying just launching the minimum needed (as per the scripts above) ?

My two xorg.conf files look like:

(STANDARD xorg,conf)


# nvidia-settings: X configuration file generated by nvidia-settings
# nvidia-settings: version 355.06 (buildd@lgw01-22) Mon Aug 3 21:32:29 UTC 2015


Section "ServerLayout"
Identifier "Layout0"
Screen 0 "Screen0" 0 0
InputDevice "Keyboard0" "CoreKeyboard"
InputDevice "Mouse0" "CorePointer"
Option "Xinerama" "0"
EndSection


Section "Files"
EndSection


Section "InputDevice"
# generated from default
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "auto"
Option "Device" "/dev/psaux"
Option "Emulate3Buttons" "no"
Option "ZAxisMapping" "4 5"
EndSection


Section "InputDevice"
# generated from default
Identifier "Keyboard0"
Driver "kbd"
EndSection


Section "Monitor"
# HorizSync source: edid, VertRefresh source: edid
Identifier "Monitor0"
VendorName "Unknown"
ModelName "DELL U2414H"
HorizSync 30.0 - 83.0
VertRefresh 56.0 - 76.0
Option "DPMS"
EndSection


Section "Device"
Identifier "Device0"
Driver "nvidia"
VendorName "NVIDIA Corporation"
BoardName "GeForce GTX 970"
EndSection


Section "Screen"
Identifier "Screen0"
Device "Device0"
Monitor "Monitor0"
DefaultDepth 24
Option "Stereo" "0"
Option "nvidiaXineramaInfoOrder" "DFP-4"
Option "metamodes" "DVI-I-1: nvidia-auto-select +0+0, DVI-D-0: nvidia-auto-select +1920+0"
Option "SLI" "Off"
Option "MultiGPU" "Off"
Option "BaseMosaic" "off"
SubSection "Display"
Depth 24
EndSubSection
EndSection



WIDE (xorg.conf.wide - as called currently by the launch.sh script mentioned above)
Note this one wasn't automatically generated by Nvidia settings, more that I copied the standard xorg.conf and modified it for xinerama to give me a wide two windscreen flight deck view in X-Plane.


# nvidia-settings: X configuration file generated by nvidia-settings
# nvidia-settings: version 355.06 (buildd@lgw01-22) Mon Aug 3 21:32:29 UTC 2015


Section "ServerLayout"
Identifier "Layout0"
Screen 0 "Screen0" 0 0
InputDevice "Keyboard0" "CoreKeyboard"
InputDevice "Mouse0" "CorePointer"
Option "Xinerama" "1"
EndSection


Section "Files"
EndSection


Section "InputDevice"
# generated from default
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "auto"
Option "Device" "/dev/psaux"
Option "Emulate3Buttons" "no"
Option "ZAxisMapping" "4 5"
EndSection


Section "InputDevice"
# generated from default
Identifier "Keyboard0"
Driver "kbd"
EndSection


Section "Monitor"
# HorizSync source: edid, VertRefresh source: edid
Identifier "Monitor0"
VendorName "Unknown"
ModelName "DELL U2414H"
HorizSync 30.0 - 83.0
VertRefresh 56.0 - 76.0
Option "DPMS"
EndSection


Section "Device"
Identifier "Device0"
Driver "nvidia"
VendorName "NVIDIA Corporation"
BoardName "GeForce GTX 970"
EndSection


Section "Screen"
Identifier "Screen0"
Device "Device0"
Monitor "Monitor0"
DefaultDepth 24
Option "Stereo" "0"
Option "nvidiaXineramaInfoOrder" "DFP-4"
Option "metamodes" "DVI-I-1: nvidia-auto-select +0+0, DVI-D-0: nvidia-auto-select +1920+0"
Option "SLI" "Off"
Option "MultiGPU" "Off"
Option "BaseMosaic" "off"
SubSection "Display"
Depth 24
EndSubSection
EndSection



Any pointers very much appreciated. I think I'm nearly there with it, its just a case of how to mange three different xorg.conf settings and being able to choose them from the greeting screen.

Thanks and best regards,

Ashley

0-ashley
September 28th, 2015, 08:27 PM
Oops, thanks deadflowr for correcting my (lack of) code tags!

I decided to try another desktop environment and am currently enjoying XFCE, it's a lot cleaner and seems to understand two monitors, extended desktop* much better than Unity. I still open a console with CTRL-ALT-F1 to run the xplane flight sim scripts, but XFCE, so far, opens my Steam games on the default screen and only the default screen - rather than randomly choosing.

Probably not for this thread or forum, I need to find out how to get my keyboard media keys working once in console, X-Plane running, lightdm quit.

* By extended desktop I mean more Mac-like, with the dock/launcher on one screen and the other screen the work area which is clean and clutter free.

Can this thread be marked as closed.

Cheers

Ashley