Results 1 to 10 of 15

Thread: Configuring Xorg for dual screen, single wacom

Hybrid View

  1. #1

    Configuring Xorg for dual screen, single wacom

    Hi, I've recently installed 10.04 on a dual screen machine. I use Twinview Via Nvidia drivers to stretch a single desktop across both monitors. As a result, drawing in GIMP becomes very difficult, as proportions are likewise stretched out. Under windows, I would simply configure the tablet and restrict it to a single monitor. But under Ubuntu 10.04, this has proven quite challenging. I've studied the question, and the obvious solution is to add the ScreenNo option to Xorg.conf. The problem is, Xorg.conf now seems a dated concept, no file being present by default under 10.04.

    I've tried to generate one using sudo Xorg -configure, but end up with:

    Fatal server error:
    Server is already active for display 0
    If this server is no longer running, remove /tmp/.X0-lock
    and start again.


    According to:

    https://wiki.ubuntu.com/X/Config

    I can simply write a simple xorg.conf file and Xorg will apply my script to the WACOM when loading. Trouble is, the one I've written up seems to be completely ignored. I'm rather inexperienced with xorg.conf, so perhaps I'm missing something in the file itself. Any advice?

    Thanks for any possible insight. Here's the .Conf file's content so far:

    Code:
    Section "InputDevice"
      Driver        "wacom"
      Identifier    "stylus"
      Option        "Device"        "/dev/input/wacom"    # USB ONLY
      Option        "Type"          "stylus"
      Option        "Tilt"          "on"
      Option        "USB"           "on"                  # USB ONLY
      Option        "Twinview"      "horizontal"
      Option     "ScreenNo" "0"
    
    EndSection
    
    Section "InputDevice"
      Driver        "wacom"
      Identifier    "eraser"
      Option        "Device"        "/dev/input/wacom"    # USB ONLY
      Option        "Type"          "eraser"
      Option        "Tilt"          "on"
      Option        "USB"           "on"                  # USB ONLY
      Option        "Twinview"      "horizontal"
      Option     "ScreenNo" "0"
    EndSection
    
    Section "InputDevice"
      Driver        "wacom"
      Identifier    "cursor"
      Option        "Device"        "/dev/input/wacom"    # USB ONLY
      Option        "Type"          "cursor"
      Option        "USB"           "on"                  # USB ONLY
      Option        "Twinview"      "horizontal"
      Option     "ScreenNo" "0"
    EndSection
    
    # This section is for Intuos3, CintiqV5, Graphire4, or Bamboo without touch
    Section "InputDevice"
      Driver        "wacom"
      Identifier    "pad"
      Option        "Device"        "/dev/input/wacom"    # USB ONLY
      Option        "Type"          "pad"
      Option        "USB"           "on"                  # USB ONLY
    EndSection

  2. #2
    Join Date
    Aug 2007
    Location
    Alsip
    Beans
    199
    Distro
    Ubuntu 11.10 Oneiric Ocelot

    Re: Configuring Xorg for dual screen, single wacom

    Just to be sure, do you have the right file path? should be:
    Code:
    /etc/X11/xorg.conf
    Made my own xorg also, and learned the hard way that the 'x' does need to be capitalized.
    It's funny to think how underdeveloped the world is, really makes it easier for a developer to get ahead.

    Linux User: #461968

  3. #3
    Join Date
    Nov 2005
    Location
    Uppsala, Sweden
    Beans
    2,180
    Distro
    Ubuntu 12.10 Quantal Quetzal

    Re: Configuring Xorg for dual screen, single wacom

    Not sure what you mean when you say the proportions are stretched? With twinview both your screens should run at their native resolutions, and any program you run should still be at the normal proportions...

    Is that the entire xorg.conf?
    You need more than just the InputDevice sections to get xorg to use them.
    First, to generate a proper xorg.conf using the nvidia driver with twinview, run this command:
    Code:
    nvidia-xconfig -o ~/xorg.conf --force-generate --twinview --twinview-orientation="RightOf"
    This will place the new xorg.conf in your home directory so you can edit it before you move it to /etc/X11/.

    I would try this simple xorg.conf first without adding any lines for the wacom device. To try it, run:
    Code:
    sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.bak1
    sudo cp ~/xorg.conf /etc/X11/xorg.conf
    Then restart X (press Alt + Print screen + K).

    If the wacom device don't work as you like it, open up the xorg.conf in your home directory, add your InputDevice sections and make sure they are used by adding the same input devices to the ServerLayout section, which should look something like this (from a link on the page you linked to):
    Code:
    Section "ServerLayout"
            Identifier     "Default Layout"
            Screen 0 "Screen0"   0 0
    #        InputDevice    "Mouse0"    "CorePointer"
    #        InputDevice    "Keyboard0" "CoreKeyboard"
            InputDevice    "stylus"    "SendCoreEvents"
            InputDevice    "eraser"    "SendCoreEvents"
            InputDevice    "cursor"    "SendCoreEvents"    # For non-LCD tablets only
        InputDevice    "touch"     "SendCoreEvents"    # Only a few TabletPCs support this type
            InputDevice    "pad"   # For Intuos3/CintiqV5/Graphire4/Bamboo tablets
    EndSection
    Note that I don't have any wacom device, so I have no idea if you need to change anything else to get your specific device working. I have noticed that the automatic detection of mouse and keyboard works better than having a static configuration in xorg.conf, which is why I commented out the mouse and keyboard lines.

    And when you have made the changes, save the file and copy it to /etc/X11 with these commands:
    Code:
    sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.bak2
    sudo cp ~/xorg.conf /etc/X11/xorg.conf
    Then restart X (press Alt + Print screen + K).

    To go back to your original xorg.conf:
    Code:
    sudo cp /etc/X11/xorg.conf.bak1 /etc/X11/xorg.conf
    And to go back to the new one without the wacom configuration:
    Code:
    sudo cp /etc/X11/xorg.conf.bak2 /etc/X11/xorg.conf
    Last edited by jocko; April 25th, 2010 at 07:03 AM.

  4. #4

    Re: Configuring Xorg for dual screen, single wacom

    Wow, now I'm getting somewhere... sortof. I managed to get the Wacom to stop working, and to screw up xorg, but at least that means I'm messing with the right files now. I've started over with a fresh xorg.conf, and I'll keep tweaking it until I get things right.

    Thanks for the feedback you two, very helpful. That's why I love Linux, the community is simply awesome.

  5. #5
    Join Date
    Apr 2010
    Beans
    2

    Re: Configuring Xorg for dual screen, single wacom

    Wacom tablets used to be configured via HAL FDI files, but since Lucid dropped HAL I'm not entirely sure how to set it up properly. I can provide a hacky method which lets you set up the Wacom tablet for the screen with the top left of the tablet in though, if you're using the default XOrg config. Because I'm using a Bamboo1, that's what's in my commands. You can find the appropriate string to put in by running
    Code:
    xsetwacom --list -v
    And look for the device which contains the STYLUS.

    Run the following:
    Code:
    xsetwacom --get "Wacom Bamboo1" BottomX
    This gives you the X resolution of your tablet. I'll call this TX. Next you need the resolution of the virtual screen, which can be found by
    Code:
    xsetwacom --get "Wacom Bamboo1" SBottomX0
    I'll call this WX. Finally, let's call the actual X resolution of your primary screen SX.

    The hacky method is to set the X resolution of your tablet to be bigger than it actually is. This effectively causes the driver to map an out-of-bounds area to your second screen. The value you should set it to, AX is TX * (WX / SX). You might like to set it a little less than that to stop the cursor jumping to the first pixel on the second screen, but that's preference. Anyway, once you've got AX, set it with:
    Code:
    xsetwacom --set "Wacom Bamboo1" BottomX AX
    And repeat for the Y coordinates if necessary. The set commands will have to be run whenever you start using the tablet, so you might want to put them in a script. In theory it can be automated via a devicekit rule, but I've not yet got around to doing so.

  6. #6

    Re: Configuring Xorg for dual screen, single wacom

    Well, that solved my problem. I ended up with the following two commands, one for the stylus, one for the eraser:

    Code:
    xsetwacom --set "Wacom Intuos3 6x8" BottomX 35700
    xsetwacom --set "Wacom Intuos3 6x8 eraser" BottomX 35700
    As you suggested, I messed with the numbers to remove the edge of the second monitor. I've simply added both commands as start-up applications, and created some temporary shortcuts under system tools. Everything works fine, but not one to be satisfied with fine, I'm going to try and write a script that toggles between single and dual screen mode, and perhaps link it to a button on my tablet, allowing me to switch modes.

    Thanks

  7. #7
    Join Date
    Dec 2009
    Location
    Finland
    Beans
    22
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Configuring Xorg for dual screen, single wacom

    This

    xsetwacom --list -v
    Gives me this ->
    Code:
    Unknown command '--list'
    Usage: xsetwacom [options] [command [arguments...]]

  8. #8
    Join Date
    Jun 2007
    Location
    Hikkaduwa, Sri Lanka
    Beans
    3,449
    Distro
    Ubuntu 22.04 Jammy Jellyfish

    Re: Configuring Xorg for dual screen, single wacom

    Quote Originally Posted by Don_Dragon View Post
    but not one to be satisfied with fine, I'm going to try and write a script that toggles between single and dual screen mode, and perhaps link it to a button on my tablet, allowing me to switch modes.
    Thanks
    If you are still following this post you might be interested in "switchconf" from the repositories.
    It allows you to switch between system configuration sets.

  9. #9
    Join Date
    Sep 2006
    Location
    Japan
    Beans
    352
    Distro
    Ubuntu

    Re: Configuring Xorg for dual screen, single wacom

    Habilain, thank you so much for this equation!

    I used to use TwinView with my 2 monitors, but recently switched to an ATI card, and it was hell trying to figure out how to do this without TwinView. (I remember having lots of difficulty WITH TwinView too, actually.)

    All I needed was how to figure out the number to set BottomX at, and by trail-and-error I got pretty close. But your solution there got me exactly to where I want to go, and now I've got my Wacom working properly on my non-nVidia dual monitor setup.

    Major kudos to you!


    Quote Originally Posted by habilain View Post
    Wacom tablets used to be configured via HAL FDI files, but since Lucid dropped HAL I'm not entirely sure how to set it up properly. I can provide a hacky method which lets you set up the Wacom tablet for the screen with the top left of the tablet in though, if you're using the default XOrg config. Because I'm using a Bamboo1, that's what's in my commands. You can find the appropriate string to put in by running
    Code:
    xsetwacom --list -v
    And look for the device which contains the STYLUS.

    Run the following:
    Code:
    xsetwacom --get "Wacom Bamboo1" BottomX
    This gives you the X resolution of your tablet. I'll call this TX. Next you need the resolution of the virtual screen, which can be found by
    Code:
    xsetwacom --get "Wacom Bamboo1" SBottomX0
    I'll call this WX. Finally, let's call the actual X resolution of your primary screen SX.

    The hacky method is to set the X resolution of your tablet to be bigger than it actually is. This effectively causes the driver to map an out-of-bounds area to your second screen. The value you should set it to, AX is TX * (WX / SX). You might like to set it a little less than that to stop the cursor jumping to the first pixel on the second screen, but that's preference. Anyway, once you've got AX, set it with:
    Code:
    xsetwacom --set "Wacom Bamboo1" BottomX AX
    And repeat for the Y coordinates if necessary. The set commands will have to be run whenever you start using the tablet, so you might want to put them in a script. In theory it can be automated via a devicekit rule, but I've not yet got around to doing so.

  10. #10
    Join Date
    Feb 2009
    Beans
    2

    Re: Configuring Xorg for dual screen, single wacom

    Hey guys,

    I know this thread is a little old, but...

    I'm pretty new to Ubunutu and Linux, and was struggling with these screen mapping issues as well. Thanks to the posts here, I was able to get my tablet mappings the way I wanted, but I needed a faster way to switch these around, so I wrote a little Python program to do it for me.

    so I just put wacomtoggle.py in at ~/bin/wacomtoggle.py
    I have the following in my ~/.bash_profile:
    Code:
    PATH=$PATH:$HOME/bin:.
    then I need to make sure it's executable:
    Code:
    chmod ugo+x wacomtoggle.py
    now I can do this to toggle and maintain square proportions:
    Code:
    wacomtoggle.py -p
    So now my main question...is there a way to map these commands to the buttons on the device itself?

    Unforunately, I have to modify the values in the script for the monitor sizes and the wacom tablet sizes by hand, so some secondary questions to make the script more automagic:

    - Is there a command to query the default BottomX size, even after it's been set?
    - Is there a way to query monitor sizes?

    If anyone has suggestions for the script feel free to share!
    Attached Files Attached Files

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •