Page 1 of 6 123 ... LastLast
Results 1 to 10 of 55

Thread: Devilspie (version 0.13 and greater) s-expressions examples

  1. #1
    Join Date
    Sep 2005
    Location
    USA
    Beans
    777
    Distro
    Ubuntu 10.10 Maverick Meerkat
    The latest versions of devilspie uses s-expressions instead of xml syntax for the configuration files. This thread will be an attempt to collect s-expression examples from users so that others can use and learn from them. Let's try to follow a similar format and be sure to number your s-expressions so that they can easily be referred to if anyone has any questions (browse the ones already posted to make sure you are not reposting).

    This thread should be only for devilspie versions 0.13 and greater. The latest version in the repos is only 0.10. You can get the latest source for devilspie at http://www.burtonini.com/blog/computers/devilspie. If you are using a previous version there is already a great howto on the forums that you should read.

    Be sure to read: /usr/share/doc/devilspie-0.16/README (substitute 0.16 with the appropriate version). Most of the names of the logical operations, matchers, and actions should be descriptive enough to know what they do. If you aren't sure, try it and see! It would then be really nice if you could report back here to help others out with what you find . Here is a list, which may not be complete, of the possible code (for proper syntax search the examples):

    Code:
      /* Logical operations */
    "is"
    "contains"
    "matches"
      /* Matchers-- these give you some info about the window that opens*/
    "window_name"
    "window_role"
    "window_class"
    "application_name"
      /* Actions */
    "debug"
    "print"
    "geometry"
    "fullscreen"
    "focus"
    "center"
    "maximize"
    "maximize_vertically"
    "maximize_horizontally"
    "minimize"
    "shade"
    "unshade"
    "close"
    "pin"
    "unpin"
    "set_workspace"
    "skip_pager"
    "skip_tasklist"
    "above"
    "below"
    "undecorate"
    "wintype"
    Other functions: if, and, or, begin.

    And now some sample s-expressions to use in your ~/.devilspie/*.ds files (I'll copy the readme ones for completion). When reading these try to think of nested functions and read the innermost parentheses first:

    1.
    Code:
    (debug)
    This will run the debug action for every window created. debug function will output the window title, geometry, etc. to the terminal window when you run devilspie in a terminal. This is a good way to determine application names to use in your s-expressions.

    2.
    Code:
    (if (is (application_name) "XMMS") (set_workspace 2) (set_workspace_3))
    If a window's application_name is "XMMS", the first action, (set_workspace 2), will be run, which will send XMMS to your second workspace everytime you open it. If (is (application_name) "XMMS") returns false, if will run the second action instead, in this case (set_workspace 3). So all aplications that are not XMMS will show up in your third workspace.

    3.
    Code:
      (if (matches (window_name) "^Ubuntu.+") (begin maximize (set_workspace 2)))
    Matches allows you to use regular expressions. Here, if a window name starts with "Ubuntu" if will run the first action, (begin maximize (set_workspace 2)). This will then maximize those windows and send them to your second workspace.

    4.
    Code:
    (if (or (is (application_name) "gaim") (is (application_name) "xchat")) (pin))
    If an application has the name "gaim" or an application has the name "xchat", the first action, (pin), will be run. (pin) will make your window visible on all workspaces.


    List of Tutorials (updated 2-2-2006):
    Last edited by jrib; March 1st, 2006 at 02:27 AM.

  2. #2

    Re: Devilspie (version 0.13 and greater) s-expressions examples

    5
    Code:
    (if (is (application_name) "Terminal") (undecorate (pin (below (skip_tasklist (skip_pager))))))
    This will make your terminal appear like it is on your wallpaper. In the profile preferences for the terminal uncheck "Show menubar by default in new terminals" in the General tab. In the Effects tab, use the desired transparency. In the Scrolling tab, disable the scrollbar.

    You can use the geometry option to change the size of the terminal. To move it, hold alt and drag the window.

    Edit: Hmm... It seems for me that when I run devilspie from a terminal, my settings will work for the terminal that devilspie was ran from, but when I open another terminal, devilspie doesn't affect it.

    Edit 2: Ok, now when I run devilspie from the terminal, it doesn't affect any currently opened terminals, only ones opened after devilspie was started. I don't know why, haha.
    Last edited by souled; December 5th, 2005 at 04:34 AM.

  3. #3
    Join Date
    Apr 2005
    Location
    Not-So-Sunny Hawaii
    Beans
    Hidden!

    Re: Devilspie (version 0.13 and greater) s-expressions examples

    Quote Originally Posted by souled
    5
    Code:
    (if (is (application_name) "Terminal") (undecorate (pin (below (skip_tasklist (skip_pager))))))
    This will make your terminal appear like it is on your wallpaper. In the profile preferences for the terminal uncheck "Show menubar by default in new terminals" in the General tab. In the Effects tab, use the desired transparency. In the Scrolling tab, disable the scrollbar.

    You can use the geometry option to change the size of the terminal. To move it, hold alt and drag the window.

    Edit: Hmm... It seems for me that when I run devilspie from a terminal, my settings will work for the terminal that devilspie was ran from, but when I open another terminal, devilspie doesn't affect it.

    Edit 2: Ok, now when I run devilspie from the terminal, it doesn't affect any currently opened terminals, only ones opened after devilspie was started. I don't know why, haha.
    any way to make it so clicking 'show desktop' doesn't hide it? i'm using that s-expression for Conky

    <<edit>>

    also, could someone post the readme? my compile didn't install it :/ (checkinstall)
    Last edited by benplaut; December 5th, 2005 at 04:43 AM.
    So... a 1337 java programmer walks into a bar...

  4. #4
    Join Date
    Sep 2005
    Location
    USA
    Beans
    777
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Devilspie (version 0.13 and greater) s-expressions examples

    Quote Originally Posted by souled
    5
    Code:
    (if (is (application_name) "Terminal") (undecorate (pin (below (skip_tasklist (skip_pager))))))
    I didn't realize that you could use the syntax like that. Is that equivalent to:
    Code:
    (if (is (application_name) "Terminal") (begin (undecorate) (pin) (below) (skip_tasklist) (skip_pager))

  5. #5
    Join Date
    Sep 2005
    Location
    USA
    Beans
    777
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Devilspie (version 0.13 and greater) s-expressions examples

    Quote Originally Posted by benplaut
    also, could someone post the readme? my compile didn't install it :/ (checkinstall)
    I've updated the original post with a clickable link

  6. #6

    Re: Devilspie (version 0.13 and greater) s-expressions examples

    Quote Originally Posted by benplaut
    any way to make it so clicking 'show desktop' doesn't hide it? i'm using that s-expression for Conky

    also, could someone post the readme? my compile didn't install it :/ (checkinstall)
    Not sure how to go about doing that. The readme is included in the source files. I'll attach it anyway. I also attached parser.c which has more information.

    Quote Originally Posted by _jason
    I didn't realize that you could use the syntax like that. Is that equivalent to
    I think the readme does it the way I did it, so I just copied the style. Didn't know if could be achieved different ways.
    Attached Files Attached Files

  7. #7
    Join Date
    Apr 2005
    Location
    Sintra, Portugal
    Beans
    835

    Question Re: Devilspie (version 0.13 and greater) s-expressions examples

    Very nice howto.

    I think I'm getting it.

    How about the close action? How do I use it? Or better stating it, how to I make my windows unclosable through the window manager? Is this possible?

  8. #8
    Join Date
    Apr 2005
    Location
    Not-So-Sunny Hawaii
    Beans
    Hidden!

    Re: Devilspie (version 0.13 and greater) s-expressions examples

    Quote Originally Posted by souled
    Not sure how to go about doing that. The readme is included in the source files. I'll attach it anyway. I also attached parser.c which has more information.



    I think the readme does it the way I did it, so I just copied the style. Didn't know if could be achieved different ways.
    yeah... i was hoping there was a more extensive readme
    So... a 1337 java programmer walks into a bar...

  9. #9
    Join Date
    Mar 2005
    Location
    Freiburg/Germany
    Beans
    653
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    Re: Devilspie (version 0.13 and greater) s-expressions examples

    Cool thread, Jason!

    Can someone tell me what "print" does? Does it send a screenshot of the window to the printer?

    Quote Originally Posted by benplaut
    any way to make it so clicking 'show desktop' doesn't hide it? i'm using that s-expression for Conky
    Not that I know of, I doubt "Never minimize" is in the windowmanager specs and devilspie currently only checks windows on startup and window creation, not on actions performed on windows. -_-

  10. #10

    Re: Devilspie (version 0.13 and greater) s-expressions examples

    Quote Originally Posted by benplaut
    yeah... i was hoping there was a more extensive readme
    I think the old parser.c from v .14 has a little more information. I was unaware the .16 version only has the list of options. I think v .14 has some other things; you might want to check it out. However, there is still very little explanation given. You just have to try out some expressions and see if they work

Page 1 of 6 123 ... LastLast

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
  •