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.
|Designing Electronics with Linux||May 22, 2013|
|Dynamic DNS—an Object Lesson in Problem Solving||May 21, 2013|
|Using Salt Stack and Vagrant for Drupal Development||May 20, 2013|
|Making Linux and Android Get Along (It's Not as Hard as It Sounds)||May 16, 2013|
|Drupal Is a Framework: Why Everyone Needs to Understand This||May 15, 2013|
|Home, My Backup Data Center||May 13, 2013|
- RSS Feeds
- Dynamic DNS—an Object Lesson in Problem Solving
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- Designing Electronics with Linux
- Using Salt Stack and Vagrant for Drupal Development
- New Products
- A Topic for Discussion - Open Source Feature-Richness?
- Drupal Is a Framework: Why Everyone Needs to Understand This
- Validate an E-Mail Address with PHP, the Right Way
- What's the tweeting protocol?
- Kernel Problem
9 hours 29 min ago
- BASH script to log IPs on public web server
13 hours 56 min ago
17 hours 32 min ago
- Reply to comment | Linux Journal
18 hours 5 min ago
- All the articles you talked
20 hours 28 min ago
- All the articles you talked
20 hours 31 min ago
- All the articles you talked
20 hours 33 min ago
1 day 57 min ago
- Keeping track of IP address
1 day 2 hours ago
- Roll your own dynamic dns
1 day 8 hours ago
Enter to Win an Adafruit Pi Cobbler Breakout Kit for Raspberry Pi
Congratulations to our winners so far:
- 5-8-13, Pi Starter Pack: Jack Davis
- 5-15-13, Pi Model B 512MB RAM: Patrick Dunn
- 5-21-13, Prototyping Pi Plate Kit: Philip Kirby
- Next winner announced on 5-27-13!
Free Webinar: Hadoop
Some of key questions to be discussed are:
- What is the “typical” Hadoop cluster and what should be installed on the different machine types?
- Why should you consider the typical workload patterns when making your hardware decisions?
- Are all microservers created equal for Hadoop deployments?
- How do I plan for expansion if I require more compute, memory, storage or networking?