Hack and / - Memories of the Way Windows Were
Once you click the Window Rules icon, you will see the first set of window attributes Compiz can remember, split into tabs for Matches and Size Rules. Matches (Figure 3) contains standard window attributes, such as Above, Below, Sticky and Fullscreen, that you could set on a window manually, as well as many options you can't, such as non-movable, non-resizable, non-maximizable and no focus. To assign one of these attributes to a window, you need to add some sort of identifier in the field next to the attribute.
Compiz can match windows based on a number of different attributes documented at wiki.compiz-fusion.org/WindowMatching, such as window type, role, class, title, xid and state—all of which you can find out about with the xprop command-line utility. Simply run xprop, and then click on the particular window for which you want information. Even though there are lots of possible attributes to match, probably the easiest attribute to use is the window title. To figure out a window's title, either view its title bar, or alternatively, run:
xprop WM_NAME | cut -d\" -f2
and then click on the window of interest. Compiz doesn't necessarily need the full title of the window, just some identifying information. So for instance, if you want Mozilla Firefox to be sticky, you could add title=Mozilla Firefox to the Sticky option, or you simply could add title=Firefox.
You also can add multiple window attributes to each of these fields and separate them with a | for “or” or & for “and”. So if I wanted both xterms and aterms to be sticky, I would add the following to the sticky field:
title=xterm | title=aterm
Note that I use the or operator. If I had used the and operator, only windows with both xterm and aterm in their titles would be sticky.
You even can use basic regular expressions to match windows (so ^ and $ would match the beginning and the end of a string, respectively), along with more advanced nested expressions. All of these more advanced options are documented on the Compiz Wiki page mentioned above.
The second tab in the Windows Rules window is labeled Size Rules and allows you to force windows to a particular geometry (Figure 4). The configuration is pretty straightforward. Click New to add a new size rule, input the attribute to match your particular window (in Figure 4, I match only on title), and then add the width and height in pixels for that window. Once you finish your changes, click the Back button at the bottom of the left pane to return to the main ccsm screen.
The CompizConfig Settings Manager makes a logical distinction between window geometry and settings and actual window placement. Click Place Windows from the main ccsm screen, and you will see two different options on the right pane (Figure 5): “Windows with fixed positions” and “Windows with fixed viewport”. In “Windows with fixed positions”, you can configure the exact X and Y coordinates to use for a particular window. Use the same window-matching statements (such as, title=) for these options. I noticed this typically requires a little trial and error unless I'm placing a window exactly in the left-hand corner.
You also can configure a window to appear only in a particular viewport. Again, you can match on window attributes and then specify the X and Y viewport positions to use. In my case, I have a desktop that is five viewports wide and only one viewport high, so my Y viewport setting was always set to 0, and I could choose between 0–4 for my X viewport.
Now that I have all of these window management options, how do I use them? Well, I always have liked my first desktop to be for normal terminals, so I have my default terminals always open there at a particular size. I also have a different terminal I use exclusively for IRC. I want that to be available on all desktops, so I set that to sticky and also move it to a particular position on the desktop. I like my second desktop to be for Web applications, such as Firefox, so I configure them for that viewport. I also like to segregate terminals, browsers and IM clients I use exclusively for work, so I have all of those open automatically on a special desktop.
Other options you could consider might be to move GIMP and all of its windows to a special desktop. I also run a number of scripts in the background that do things such as sync my e-mail to a local directory. These scripts actually open their own small terminal in the background, so I move them to a desktop specifically created for them and also have them configured to not steal focus. I find I naturally end up assigning window memory for windows once I get tired of positioning them every time. The time it saves me in the long run makes up for the initial configuration, and it also saves me from always Alt-tabbing through the junk drawer that is the default user desktop. Most important, it helps keep this Linux user organized—at least half the time.
Kyle Rankin is a Senior Systems Administrator in the San Francisco Bay Area and the author of a number of books, including Knoppix Hacks and Ubuntu Hacks for O'Reilly Media. He is currently the president of the North Bay Linux Users' Group.
Kyle Rankin is a systems architect; and the author of DevOps Troubleshooting, The Official Ubuntu Server Book, Knoppix Hacks, Knoppix Pocket Reference, Linux Multimedia Hacks, and Ubuntu Hacks.
- Readers' Choice Awards 2013
- The Geek's Guide to the Coolest 2013 Holiday Gifts
- A Plexible Pi
- Sublime Text: One Editor to Rule Them All?
- Swap Your Laptop for an iPad + Linode
- RSS Feeds
- Raspberry Pi: the Perfect Home Server
- Linux Kernel News - November 2013
- Mars Needs Women
- Advanced Hard Drive Caching Techniques
- "RasPlex Linux-based OS
1 hour 32 min ago
- Clarification; RasPlex is not
8 hours 21 min ago
- Clarification; RasPlex is not
8 hours 23 min ago
- Starting the conversation is the first step.
9 hours 23 min ago
11 hours 10 min ago
11 hours 10 min ago
- Nice but....
11 hours 32 min ago
- great specs
18 hours 1 min ago
- Reply to comment | Linux Journal
19 hours 8 min ago
- rilakkuma onesie
21 hours 44 min ago