Results 1 to 5 of 5

Thread: Set Gnome 3 Window Rules, such as "Always on Visible Workspace"

  1. #1
    Join Date
    Jan 2010
    Beans
    6

    Set Gnome 3 Window Rules, such as "Always on Visible Workspace"

    When using Compiz as my window-manager, I can set special window rules so that, say, a window with class "Gnome-terminal" can always be sticky, and consistently appear on all workspaces (desktops).

    In Gnome 3's "Gnome Shell", Compiz rules do not seem to apply. Does anyone know how I can set these?

  2. #2
    Join Date
    Jan 2010
    Beans
    6

    Re: Set Gnome 3 Window Rules, such as "Always on Visible Workspace"

    Well I (unhappily) succeeded in what I was doing, although it's nowhere near as easy as in Compiz.

    I downloaded DevilsPie:
    Code:
    sudo apt-get install devilspie
    Then I created a Configuration directory to hold my "sticky window" rules file, which I'll describe later:
    Code:
    mkdir ~/.devilspie

    And I used "xprop" to get the information about the windows I wanted to create rules for:
    Code:
    xprop
    You run that command, and then click the window. In my case, I clicked on the gnome-terminal window I had open, and got a whole ton of stuff, which included this:
    Code:
    WM_CLASS(STRING) = "gnome-terminal", "Gnome-terminal"
    That told me the class of the window was "Gnome-terminal".

    So I then created my sticky windows rule file: (I use vim, but you could use anything)
    Code:
    vim ~/.devilspie/sticky.ds
    Inside, I put exactly this, which covers both my Gnome-terminal window by class and my Empathy chat client by role:
    Code:
    (if
      (or
        (is (window_role) "chat")
        (contains (window_class) "Gnome-terminal")
      )
      (begin
        (stick)
      )
    )
    I saved that file and ran devilspie in my terminal, with -a to attach it to existing windows, and --debug to check for errors:
    Code:
    devilspie -a --debug
    There were no errors, so I killed it (ctrl-c), and then hit alt-F2, and typed:
    Code:
    devilspie -a
    Which runs it in the background, attached to all existing windows. Success!
    Last edited by Offlein; May 8th, 2012 at 08:29 PM. Reason: Forgot BBCode

  3. #3
    Join Date
    Oct 2005
    Location
    De Kwakel - Holland
    Beans
    3,657

    Re: Set Gnome 3 Window Rules, such as "Always on Visible Workspace"

    Quote Originally Posted by Offlein View Post
    Well I (unhappily) succeeded in what I was doing, although it's nowhere near as easy as in Compiz.
    Indeed, but Compiz is nowhere near as powerfull as DevilsPie

    Since DevilsPie is unmaintained you may be interested in DevilsPie2

  4. #4
    Join Date
    Jun 2006
    Location
    Brisbane Australia
    Beans
    713

    Re: Set Gnome 3 Window Rules, such as "Always on Visible Workspace"

    Quote Originally Posted by Offlein View Post
    In Gnome 3's "Gnome Shell", Compiz rules do not seem to apply. Does anyone know how I can set these?
    FYI - If you don't have 2 displays then you won't know this but in gnome-shell the default is that all windows on the secondary display are "sticky" across workspaces. It works out well - so consider getting a second display!

  5. #5
    Join Date
    Jun 2007
    Beans
    133

    Re: Set Gnome 3 Window Rules, such as "Always on Visible Workspace"

    While that may be true about the secondary display, for me I prefer to not have the sticky monitor and instead both of my displays change with the workspace.
    Ubuntu on every computer in my house

Tags for this Thread

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
  •