Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16

Thread: [SOLVED] xorg.conf editing

  1. #11
    Join Date
    Apr 2007
    Location
    Canada
    Beans
    570
    Distro
    Ubuntu 11.10 Oneiric Ocelot

    Re: xorg.conf editing

    Thank you. I've been busy and I've come up with a Reg. Exp. for Xorg sections. Here's what I came up with...

    Code:
    ^[ \t]*Section[ \t]+\"\w+\".*?|^\s+\w+\s+.*?$|^EndSection
    This is my first real attempt at using the re module so any feedback to improve this critical item is much appreciated.

  2. #12
    Join Date
    Jan 2006
    Beans
    Hidden!
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: xorg.conf editing

    Perl6 way:
    Code:
    grammar Config {
      token TOP { [<section>|<option>]* }
      token section { '<Section ' <name> '>' [<option>|<section>]* </Section> }
      token option { <name> ['=' <value>]? <value>* \n }
      token name { \w+ }
      token value { \w+ }
    }
    Code is untested, but should be similar to what is pictured above. Of course that is only for reading the Xorg/Apache style config, writing them would be a bit different.

    Also, Apache can have options not belonging to a section, Xorg does not.
    I am infallible, you should know that by now.
    "My favorite language is call STAR. It's extremely concise. It has exactly one verb '*', which does exactly what I want at the moment." --Larry Wall
    (02:15:31 PM) ***TimToady and snake oil go way back...
    42 lines of Perl - SHI - Home Site

  3. #13
    Join Date
    May 2005
    Location
    Lecce, Italy
    Beans
    6,168
    Distro
    Ubuntu

    Re: xorg.conf editing

    Quote Originally Posted by cmat View Post
    I turned out empty on google but I'm interested in a library that can edit/add/remove keys within the xorg.conf file. Preferably in Python but if you have some code in other languages I could translate it. I'm interested in this so I can create a script that can modify the files contents.
    I developed X-Kit which is installed by default in Ubuntu now (since Intrepid) as it's already used by Jockey (Restricted Drivers Manager), EnvyNG, (in some cases) Update Manager and Mythbuntu. The name of the package is "python-xkit".

    It's a Python library which does exactly what you need. You can get the latest stable release from my bazaar branch or simply download the tarball.

    Quote Originally Posted by cmat View Post
    I'm making an application that manipulates xorg.conf for setting up Wacom tablets. The driver exists on linux but various features don't work yet without hacking the xorg.conf file.
    I'm working on this as you can see in this spec. We discussed this project at the UDS in Mountain view.

  4. #14
    Join Date
    Apr 2007
    Location
    Canada
    Beans
    570
    Distro
    Ubuntu 11.10 Oneiric Ocelot

    Re: xorg.conf editing

    Quote Originally Posted by tseliot View Post
    I developed X-Kit which is installed by default in Ubuntu now (since Intrepid) as it's already used by Jockey (Restricted Drivers Manager), EnvyNG, (in some cases) Update Manager and Mythbuntu. The name of the package is "python-xkit".

    It's a Python library which does exactly what you need. You can get the latest stable release from my bazaar branch or simply download the tarball.


    I'm working on this as you can see in this spec. We discussed this project at the UDS in Mountain view.
    Excellent! Thanks for all your help. Marked as solved.

    EDIT: Where can I get documentation for X-Kit?
    Last edited by cmat; December 28th, 2008 at 05:08 AM.

  5. #15
    Join Date
    Jan 2006
    Beans
    Hidden!
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: xorg.conf editing

    Quote Originally Posted by tseliot View Post
    I developed X-Kit which is installed by default in Ubuntu now (since Intrepid) as it's already used by Jockey (Restricted Drivers Manager), EnvyNG, (in some cases) Update Manager and Mythbuntu. The name of the package is "python-xkit".

    It's a Python library which does exactly what you need. You can get the latest stable release from my bazaar branch or simply download the tarball.


    I'm working on this as you can see in this spec. We discussed this project at the UDS in Mountain view.
    5 point infraction to you for not posting sooner.
    I am infallible, you should know that by now.
    "My favorite language is call STAR. It's extremely concise. It has exactly one verb '*', which does exactly what I want at the moment." --Larry Wall
    (02:15:31 PM) ***TimToady and snake oil go way back...
    42 lines of Perl - SHI - Home Site

  6. #16
    Join Date
    May 2005
    Location
    Lecce, Italy
    Beans
    6,168
    Distro
    Ubuntu

    Re: xorg.conf editing

    Quote Originally Posted by cmat View Post
    Excellent! Thanks for all your help. Marked as solved.

    EDIT: Where can I get documentation for X-Kit?
    It's all in the docstrings:
    Code:
    import XKit.xorgparser
    help(XKit.xorgparser)
    or
    Code:
    import XKit.xutils
    help(XKit.xutils)
    NOTE: xutils has some features you might want to use (it's all documented).

    Quote Originally Posted by slavik View Post
    5 point infraction to you for not posting sooner.
    ouch

Page 2 of 2 FirstFirst 12

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
  •