stumpwm-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [STUMP] Multiple monitors


From: Eric Larson
Subject: Re: [STUMP] Multiple monitors
Date: Fri, 03 Sep 2010 12:14:35 -0500
User-agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (Gojō) APEL/10.7 Emacs/23.2 (i686-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO)

At Thu, 02 Sep 2010 19:05:19 +0100,
Paulo J Matos wrote:
> 
> 
> Hi,
> 
> This might be a very simple question but I just started using StumpWM
> and when I get StumpWM started, it only seems to use one monitor. I
> can't seem to create frames on the other monitor. I looked at the manual
> but didn't find any information about this.
> 
> Is there any support for multiple monitors in StumpWM at the moment?
> 

It works for me. I had to make sure to use the latest stumpwm though
instead of the version I got with my distro (ubuntu 8 at the
time). Here is my xorg.conf:

  Section "Device"
        Identifier      "Configured Video Device"
  EndSection
   
  Section "Monitor"
        Identifier      "Configured Monitor"
  EndSection
   
  Section "Screen"
        Identifier      "Default Screen"
        Monitor         "Configured Monitor"
        Device          "Configured Video Device"
        SubSection "Display"
             Depth      24
             Modes      "1680x1050" "1280x1024" "1024x768" "800x600" "640x480"
           Virtual      2960 1850
        EndSubSection
  EndSection

The virtual part sets things up so I have a single virtual worspace
that encompasses both monitors. From what I can tell, stumpwm is then
able to use both monitors just fine. 

Since I'm using it on my laptop with an external monitor, I also wrote
a quick script that I can run when I unplug my external monitor.

  from subprocess import call
  import re
  import os
   
  class Randr(object):
   
      def __init__(self):
          self.screens = {
   
              'monitor': 'DVI1',
              'laptop': 'LVDS1'
          }
   
      def is_connected(self, fn):
          for line in open(fn, 'r'):
              if line.startswith('%s connected' % self.screens['monitor']):
                  return True
   
      def run(self):
          fn = '.tmp_buffer_python_xstart'
          p = call(['xrandr', '-q'], stdout=open(fn, 'w+'))
          if self.is_connected(fn):
              xrandr_cmd = [
                  'xrandr', '--output', self.screens['laptop'], # '--off'
                  '--right-of', self.screens['monitor']
              ]
              p = call(xrandr_cmd)
              p2 = call(['xrandr', '--output', self.screens['monitor'],
                         '--mode', '1680x1050'])
          os.remove(fn)
   
  if __name__ == '__main__':
      r = Randr()
      r.run()


That just turns the external monitor off using xrandr.

Hope that helps. 

Eric


> Cheers,
> 
> -- 
> PMatos
> 
> 
> _______________________________________________
> Stumpwm-devel mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/stumpwm-devel



reply via email to

[Prev in Thread] Current Thread [Next in Thread]