569. Briefly: Dual monitor set-up on Debian Wheezy with Gnome and a single nvidia graphics card

This is very easy, but I might as well document it here anyway.

This morning another group threw out two functioning monitors and I grabbed both. While I haven't yet decided on what to do with the second one I decided to use one to make a dual monitor set-up for my work station.

My desktop has both onboard nvidia graphics and a separate pci-e nvidia (GT 430) graphics card. Using lspci only the external graphics card shows up, probably because the bios prioritises the external card and disables the onboard graphics.

The nvidia GT 430 card has three output ports: vga, hdmi and dvi. My main monitor (Dell P2411H, 1920x1080) has both vga and dvi, and my 'new' monitor (HP S1932, 1366x768) only has vga.

The first step was to physically connect both monitors to my computer. I originally thought I had to use one card per monitor, which would've necessitated me to reboot, change the bios and probably hand-craft an xorg.conf. I don't like rebooting, so I looked at the alternatives.

Apparently you can simply connect both monitors to the same card by using the different ports, so I hooked up the small screen to the vga port and the big one to the hdmi port.

After that it was a simple matter of opening 'displays' in the gnome 3 systems settings, setting both monitors to 'on', and arranging them side by side correctly by dragging them with the mouse:



I also had a look at it in nvidia-settings:

The only issue that remained was guake -- it was showing up in the 'wrong' screen (i.e. the left-most, smaller one).  This post showed how to edit: http://haifzhan.blogspot.com.au/2013/10/guake-dual-monitor-setup.html

This is how to do it on the version currently in wheezy, 0.4.3:
sudo vim `which guake`

814 def get_final_window_rect(self):
815 """Gets the final size of the main window of guake. The height
816 is the window_height property, width is window_width and the
817 horizontal alignment is given by window_alignment.
818 """
819 screen = self.window.get_screen()
820 height = self.client.get_int(KEY('/general/window_height'))
821 width = 100
822 halignment = self.client.get_int(KEY('/general/window_halignment'))
823
824 # get the rectangle just from the first/default monitor in the
825 # future we might create a field to select which monitor you
826 # wanna use
827
828 #monitor = 0 # use the left most monitor
829 monitor = screen.get_n_monitors() - 1 # use the rightmost monitor
830
831 monitor_rect = screen.get_monitor_geometry(monitor)
832 window_rect = monitor_rect.copy()
833 total_width = window_rect.width
834 window_rect.height = window_rect.height * height / 100
835 window_rect.width = window_rect.width * width / 100
836
837 if width < monitor_rect.width:
838 if halignment == ALIGN_CENTER:
839 window_rect.x = monitor_rect.x+(monitor_rect.width - window_rect.width) / 2
840 elif halignment == ALIGN_LEFT:
841 window_rect.x = monitor_rect.x
842 elif halignment == ALIGN_RIGHT:
843 window_rect.x = monitor_rect.x+monitor_rect.width-window_rect.width
844 window_rect.y = monitor_rect.y
845 return window_rect
846


Note that the edited version will be overwritten when you upgrade guake.
Previous
Next Post »