You are not logged in.

#1 2014-02-25 02:29:54

mathew
Member
Registered: 2013-07-09
Posts: 16

[SOLVED] Openbox - setting different dpi on external monitor

[SOLVED SUMMARY]

After the suggestion from Max, I've got two instances of openbox running on the different screens.
the xorg.conf I used for this is below.

then I used the following addition to ~/.xinitrc to start two instances and set the dpi of the laptop screen:

DISPLAY=:0.1
exec openbox & 

DISPLAY=:0.0
exec xrandr --output eDP1 --dpi 192 &
exec openbox-session

[/SOLVED SUMMARY]

[ORIGINAL POST BELOW]
Hello,

I want to be able to set a different dpi for my laptop screen  (macbook pro retina 13 inch late 2013  11,1   integrated graphics (not nvidia))
and my external monitor, as the laptop screen has a pixel density more than double that of the external monitor

if I start openbox using:                           

startx

then text on the laptop is too small,  but everything on the monitor is ok. Conversely if I start openbox with

startx -- -dpi 144

then for the most part, things scale up nicely on the laptop, but everything on the monitor is too big.

So what I have tried to do is set the the dpi with xrandr:

 xrandr --output eDP1 --auto --dpi 144 --output HDMI2 --auto --rotate right --dpi 96 --right-of eDP1 

xrandr outputs a configuration that looks ok, but the display doesn't change:

Screen 0: minimum 320 x 200, current 3760 x 1920, maximum 32767 x 32767
eDP1 connected 2560x1600+0+0 (normal left inverted right x axis y axis) 286mm x 179mm
   2560x1600      60.0*+
   2048x1536      60.0  
   1920x1440      60.0  
   1856x1392      60.0  
   1792x1344      60.0  
   1600x1200      60.0  
   1400x1050      60.0  
   1280x1024      60.0  
   1280x960       60.0  
   1024x768       60.0  
   800x600        60.3     56.2  
   640x480        59.9  
DP1 disconnected (normal left inverted right x axis y axis)
HDMI1 connected 1200x1920+2560+0 right (normal left inverted right x axis y axis) 495mm x 310mm
   1920x1200      60.0*+
DP2 disconnected (normal left inverted right x axis y axis)
HDMI2 disconnected (normal left inverted right x axis y axis)
VIRTUAL1 disconnected (normal left inverted right x axis y axis)

There seem to be a thousand ways to set up multiple screens, so it would be great to hear from anyone who has any suggestions about the best ways for me to approach this,
should I  set up seperate monitors in Xorg.conf,
or even seperate X DISPLAYs and launch multiple instances of openbox?

thanks

Mathew

[EDIT]
on re-examining, while the dimensions listed by xrandr seem about right, the xrandr command isn't changing them, they seem to be  defaults

Last edited by mathew (2014-02-26 09:37:46)

Offline

#2 2014-02-25 04:16:03

Max-P
Member
Registered: 2011-06-11
Posts: 164

Re: [SOLVED] Openbox - setting different dpi on external monitor

I don't think you can get away with this without running multiple X servers entirely. When using the standard method with randr, applications and X handles the screen as a giant surface spanning across both your monitors. When you drag a window to your external monitor, there's also a moment between the two where the same application is displayed on both screens. It would be extremely difficult to both have a library capable of efficiently managing that, and it would also be a nightmare for software programmers to handle windows being displayed at multiple resolutions at the same time.

I think you might be able to set up seperate X screens on the same server, but I'm not sure if X is able to support multiple DPI settings at the same time due to many configuration files for fonts not having sections for screens. By using two X screens entirely, you will also lose the ability to drag windows from one to another and will have to start applications on the screen it will live on (like if you had two computers). Worth giving it a chance anyway (replace as needed, this one was generated by the nvidia utility because I use nvidia):

Section "Monitor"
    # HorizSync source: edid, VertRefresh source: edid
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "TOPSYNC"
    HorizSync       30.0 - 88.0
    VertRefresh     59.0
    Option         "DPMS"
    Option                 "DPI" "144 x 144"
EndSection

Section "Monitor"
    # HorizSync source: edid, VertRefresh source: edid
    Identifier     "Monitor1"
    VendorName     "Unknown"
    ModelName      "LG Electronics L222W"
    HorizSync       28.0 - 83.0
    VertRefresh     56.0 - 75.0
    Option         "DPMS"
    Option                 "DPI" "96 x 96"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "Stereo" "0"
    Option         "metamodes" "DVI-I-2: nvidia-auto-select +0+0"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

Section "Screen"
    Identifier     "Screen1"
    Device         "Device1"
    Monitor        "Monitor1"
    DefaultDepth    24
    Option         "Stereo" "0"
    Option         "metamodes" "DVI-I-3: nvidia-auto-select +0+0"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection


Another solution that might be interesting is to use a scaled resolution and render both screens at high DPI and scale down to display on the low dpi screen (example: render in 2560x1600 with high DPI and display at 1650x1050 so the sizes look normal). The picture might be blurry though.

Offline

#3 2014-02-25 08:27:14

mathew
Member
Registered: 2013-07-09
Posts: 16

Re: [SOLVED] Openbox - setting different dpi on external monitor

Thanks Max,

zaphod mode looks like it would give me what I want. I'm trying to get it going, but with not a lot of success so far, and I'm finding lots of reports of it not working properly with intel integrated video so I'm not sure how this is going to work out yet.

Offline

#4 2014-02-25 13:03:08

mathew
Member
Registered: 2013-07-09
Posts: 16

Re: [SOLVED] Openbox - setting different dpi on external monitor

I created this xorg.conf

Section "ServerLayout"
	Identifier     "X.org Configured"
	Screen 0 "Screen0" 
	Screen 1 "Screen1" 
	Screen "Screen1" RightOf "Screen0"
	InputDevice    "Mouse0" "CorePointer"
	InputDevice    "Keyboard0" "CoreKeyboard"
EndSection

Section "Files"
	ModulePath   "/usr/lib/xorg/modules"
	FontPath     "/usr/share/fonts/misc/"
	FontPath     "/usr/share/fonts/TTF/"
	FontPath     "/usr/share/fonts/OTF/"
	FontPath     "/usr/share/fonts/Type1/"
	FontPath     "/usr/share/fonts/100dpi/"
	FontPath     "/usr/share/fonts/75dpi/"
EndSection

Section "Module"
	Load  "glx"
EndSection

Section "InputDevice"
	Identifier  "Keyboard0"
	Driver      "kbd"
EndSection

Section "InputDevice"
	Identifier  "Mouse0"
	Driver      "mouse"
	Option	    "Protocol" "auto"
	Option	    "Device" "/dev/input/mice"
	Option	    "ZAxisMapping" "4 5 6 7"
EndSection

Section "Monitor"
	Identifier   "Monitor0"
	VendorName   "Monitor Vendor"
	ModelName    "Monitor Model"
EndSection

Section "Monitor"
	Identifier   "Monitor1"
	VendorName   "Monitor Vendor"
	ModelName    "Monitor Model"
EndSection

Section "Device" 
	Identifier "Card0" 
	Driver  "fbdev"
	BusID "PCI:0:2:0" 
	Option "ZaphodHeads" "eDP1,DP1,HDMI1,DP2,HDMI2,VIRTUAL1" 
EndSection 

Section "Screen"
	Identifier "Screen0"
	Device     "Card0"
	Monitor    "Monitor0"
	SubSection "Display"
		Viewport   0 0
		Depth     1
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     4
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     8
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     15
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     16
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     24
	EndSubSection
EndSection

Section "Screen"
	Identifier "Screen1"
	Device     "Card0"
	Monitor    "Monitor1"
	SubSection "Display"
		Viewport   0 0
		Depth     1
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     4
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     8
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     15
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     16
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     24
	EndSubSection
EndSection

If I put this in ./.xinitrc


DISPLAY=:0.0
exec openbox & 

DISPLAY=:0.1
exec openbox

it fails, unfortunately there's not much of an explanation in the Xorg.log

This will launch:

DISPLAY=:0.0
exec openbox 

but the screen will be mirrored at the resoultion of the smallest screen.

I'm guessing my xorg.conf is wrong, but I haven't been able to find any good information on setting up seperate X screens with intel integrated video

Offline

#5 2014-02-25 13:07:24

mathew
Member
Registered: 2013-07-09
Posts: 16

Re: [SOLVED] Openbox - setting different dpi on external monitor

just discovered there's man entries for fbdev and intel, I'll see how that goes...

Offline

#6 2014-02-25 13:41:24

mathew
Member
Registered: 2013-07-09
Posts: 16

Re: [SOLVED] Openbox - setting different dpi on external monitor

seems I've mixed and matched options for fbdev and intel drivers, I try to clean that up and see what I get...

Offline

#7 2014-02-26 07:07:41

mathew
Member
Registered: 2013-07-09
Posts: 16

Re: [SOLVED] Openbox - setting different dpi on external monitor

So I've made some progress.

I now have two openbox instances, I just need to figure out how to tell them their correct dpi at start up

This xorg.conf has allowed me to define two different screens, on which I run two different openbox instances.

If I could pass the dpi to the instances at start up I think this would be a satisfactory solution.

I can currently use xrandr,

xrandr --output eDP1 --dpi 192

This fixes most of the text, but this doesn't update the text size of the openbox menus and titlebars as  startx -- -dpi 192 does

DETAILS

Section "Files"
	ModulePath   "/usr/lib/xorg/modules"
	FontPath     "/usr/share/fonts/misc/"
	FontPath     "/usr/share/fonts/TTF/"
	FontPath     "/usr/share/fonts/OTF/"
	FontPath     "/usr/share/fonts/Type1/"
	FontPath     "/usr/share/fonts/100dpi/"
	FontPath     "/usr/share/fonts/75dpi/"
EndSection

Section "Module"
	Load  "glx"
EndSection

Section "InputDevice"
	Identifier  "Keyboard0"
	Driver      "kbd"
EndSection

Section "InputDevice"
	Identifier  "Mouse0"
	Driver      "mouse"
	Option	    "Protocol" "auto"
	Option	    "Device" "/dev/input/mice"
	Option	    "ZAxisMapping" "4 5 6 7"
EndSection

Section "Device" 
	Identifier 	"Card0" 
	Driver  	"intel"
	BusID 		"PCI:0:2:0" 
	Option 		"ZaphodHeads" "eDP1" 
	Option 		"AccelMethod" "sna" 
	Screen 0
EndSection 

Section "Device" 
	Identifier "Card1" 
	Driver  "intel"
	BusID "PCI:0:2:0" 
	Option "ZaphodHeads" "DP1,HDMI1,DP2,HDMI2" 
	Option 	"AccelMethod" "sna" 
	Screen 1
EndSection 

Section "Screen"
	Identifier "Screen0"
	Device     "Card0"
EndSection

Section "Screen"
	Identifier "Screen1"
	Device     "Card1"
EndSection

Section "ServerLayout"
	Identifier 		"default"
	Screen 			"Screen0" 0 0  
	Screen 			"Screen1" RightOf "Screen0"
	InputDevice    	"Mouse0" "CorePointer"
	InputDevice    	"Keyboard0" "CoreKeyboard"
EndSection

start up code in ~/.xinitrc

DISPLAY=:0.1
exec openbox &

DISPLAY=:0.0
exec openbox-session

Offline

#8 2014-02-26 09:33:45

mathew
Member
Registered: 2013-07-09
Posts: 16

Re: [SOLVED] Openbox - setting different dpi on external monitor

Solved!

in the end the trick was to put the xrandr call before openbox-session:

DISPLAY=:0.1
exec openbox & 
#--startup "/home/mathew/.config/openbox/autostart.1"&

DISPLAY=:0.0
exec xrandr --output eDP1 --dpi 192 &
exec openbox-session

Thanks Max!

Offline

Board footer

Powered by FluxBB