Devil’s Pie
December 9th, 2009
I’ve been using Gnome for almost a year and a half now, and while I have grown to love a lot of the advantages it has, there are still some things I miss about FVWM. From a keyboard shortcut standpoint, many of them were alleviated when I discovered Gnome Do. However, I still found myself missing sticky, transparent shells that would give me a constant view into certain data, be it htop or tailing some files. It was really quick to set up in FVWM, but I had trouble finding a way to remove window decorations from windows in Gnome.
Sure, there are other ways to get the data I’m looking for, but having text rendered directly on the desktop like that just looks damn cool to me. It also intimidates the crap out of non-geeks when they see my office, which I fully admit is a big plus.
I came across a package called Devil’s Pie that gave me a lot more control over windows. Although I was looking for something that would let me actively select a window to give it certain properties (sticky, no decorations, etc), Devil’s Pie instead passively detects new windows and applies settings to them. It’s a mentality shift from my initial thoughts, but I think over time this model will actually be really useful. Plus, it has “pie” in the name, which is just awesome.
With a combination of gnome-terminal profiles/flags and Devil’s Pie configuration, I was able to get my desktop to automatically populate my desktop with all sorts of data. The following description of how is kinda wordy, but it’s really not complicated at all.
Install and Configure Devil’s Pie
sudo yum -y install devilspie mkdir ~/.devilspie touch ~/.devilspie/console.ds
Devil’s Pie reads all configuration files (I believe they have to end in .ds, but don’t quote me on that) in the above directory on startup. Those files define the rules that will be applied to new windows that are created (there’s also a way to ask it to apply rules to all existing windows as well). For this example, I put my rules in a file named console.ds.
(if (contains (window_name) "console" ) (begin (undecorate) (pin) (skip_pager) (skip_tasklist) ) )
There are two main parts to the above configuration. The first is the matching expression to decide if a window should have the rules applied. In this case, I indicate to apply the actions if the window name contains the string “console” (there are also options for “is” and “matches”). I’ll cover where that rule comes into play in a bit.
The actions do the following:
- undecorate – This is primarily what I was going for, I want the window decorations removed. This includes the title bar and border, though you can still use the shortcut key (alt+F8 by default) to resize a window without decorations.
- pin – Make this window available on all workspaces. There are also attributes to control putting a window on a particular workspace, which could be useful in my case since I use 12 workspaces and am, well, pretty anal retentive about having certain applications in certain workspaces.
- skip_pager – Don’t let the window show up in the pager. It removes the clutter in my pager since I don’t consider this a “real” application, just a status-type window.
- skip_tasklist – A little more useful than skip_pager, this keeps the window off the taskbar, for the same rationale as above.
Needless to say, I’m only scratching the surface of all of the actions supported. I haven’t found a good way to find this list yet; the man page says the -l flag will list symbols but when I try it, it just doesn’t do anything.
Run Devil’s Pie
devilspie
Not much to say about that. I’ll talk more about enabling a debug mode later, but I mention it now to say it’s not done through flags. You’ll need to restart it every time you change your confguration files, but once you’re set add it to System -> Preferences -> Startup Applications and you’re good to go on reboots.
Create Gnome Terminal Profile
To summarize above, Devil’s Pie will take care of removing window decorations and keeping it on the visible workspace. We still need to configure Gnome terminal to add some slickness to how it looks. Since I don’t want this slickness on all of my terminals, I created a new profile named “console” with the following changes:
- Background – Transparent background, with the slider set all the way to none.
- Scrolling – Scrollbar is: Disabled
That gives us a completely transparent shell, reflective of its use to simply throw data at me.
Start the Terminal
Now we just need to make sure we start the terminal such that it will use the right profile and will trigger the window detection from Devil’s Pie. Here’s where the matching expression from above comes into play. I don’t want all of my terminals to have no decorations, just specific ones I want to treat in this fashion. When starting the terminal, tell it to use a specific window title that will match our Devil’s Pie rule from above.
gnome-terminal -t console --profile=console --geometry=140x20+1680-0 -e htop
A quick explanation of above:
- -t – Sets the title of the terminal window. This value should match up to the window_name value from the Devil’s Pie configuration.
- –profile – Tells the terminal to use the slick console profile in all of its transparent goodness.
- –geometry – Initially size and place the terminal on my screen.
- -e – Run a specific command when it starts, in this case
htop.
My screenshot above simply uses a similar call to gnome-terminal, passing a tail command to -e and different geometry to get the log tail on the top of the screen.
Two other notes on Devil’s Pie:
There is a UI for editing the configuration files: gdevilspie. It’s handy because you can easily see the different types of matching expressions and actions, however the files it generated didn’t run for me. For some reason, even with one matching expression it still added a blank condition and an “and” statement and closed the conditions block too early. I haven’t looked to closely yet to see what is wrong.
Enabling debugging is as simple as adding another configuration file. I added one named “debug.ds” to my ~/.devilspie directory that contained simply:
(debug)
Once that is in place, running the devilspie executable from the command line output some really useful window information whenever a new window was created.
Gobby – Free Collaborative Editor
November 22nd, 2009
Despite the fact that the team I’m currently on only has around 8 people, we still manage to span three different time zones. Needless to say, it’s not exactly simple for us to gather around a whiteboard and hash things out. With our move to using agile process techniques (more on that in other blog, it’s a beefy topic), we had a monthly need to be able to work on user stories and tasks together. For a while, we tried frequent saving to a single wiki page, but that had a few obvious limitations.
After experimenting with a few different approaches, we found ourselves regularly using gobby. I took the post title directly from their site, but it doesn’t do justice to just how fluidly it all comes together.
Gobby lets everyone logged into a gobby server type at the same time on the same document. Ugh, even that doesn’t showcase how cool it works in practice. The changes are sent in real time to every user, which both provides a very seamless collaboration environment as well as lets my teammates know just how bad I really am at typing (I’m even worse when I realize other people are watching me mistype every third letter).
The screenshots on their site are a little small. And frankly after trying to take one myself, I realize why: text doesn’t shrink well. Anyway, I tried to take one from our last sprint planning meeting to give an example of what I’m talking about (click on it for the full sized version which looks a bit better):
Each person who logs into the gobby server chooses their own background color. Whenever a user types something, those changes are highlighted in that user’s color, which (in our case at least) is less about ownership and more about differentiating changes. Again, realize each user can simultaneously type in the same document, which leads to an incredibly collaborative environment. And yes, seeing a document come together in different colors like that just plain looks cool.
Future Red Hat Developer
November 18th, 2009
(Renamed from “Future Fedora Ambassador” because of the hat… not that she can’t be involved in both, but this picture happens to be Red Hat specific
)
It’s been a while since I got a good picture of my 2 year old geeking out. My wife actually took this one after my daughter found my red fedora which was still packed from moving.

Conky
September 28th, 2009
When I first started out using Linux, I was introduced to FVWM as a display manager. I quickly became, well, addicted to dorking with my .fvwm2rc config file. I was hooked on how many possibilities and customizations could be made. I’ve since stopped using FVWM for various reasons (not the least of which is their abrasive community) and thought my config file tweaking addiction was cured.
Then I found Conky. The easiest description is found directly on their site: “Conky is a free, light-weight system monitor for X, that displays any information on your desktop.” The addictive part is that there are hundreds of variables that can be displayed as part of its monitoring. Do I need, at all times, to see the amount of space left on my /home partition? No. Does the fact that I can do it make it awesome anyway? Hell yeah.
In the past week, I’ve had a number of coworkers see it running on my laptop and ask me what it was and how to configure it. The “what” part can be seen in the top right corner of my desktop below (click the image for the full size 1680×1050 version):
The “how”, or at least my settings, can be found here. I’m playing around with a personal github account for backing up and sharing this sort of stuff. I’m still not sure how much I’ll use it, but for now my conky config file can be found there. It’s a bit of a mess, but should be at least enough to give users an idea of what can be done. If anyone knows of any particularly cool use of it that I’m missing, definitely let me know.
Moodle
August 11th, 2009
I’m trying something new this semester. My school offers WebCT/Blackboard (I’m not sure which is the current name) for all classes, and while it has gotten the job done in the past I’ve never been overly happy with it. The interface is a little bit clunky in addition to being, well, a bit ugly (not sure if it offers themes or something similar that my school chooses to not utilize). It also lacks the flexibility I’ve become accustomed to in other sites I maintain, which is a nice way of saying I’ve become spoiled by hosting my own apps and having full access to their inner workings. It’s just a comforting feeling to know I can go in and dork around with the code if I need to.
There was a thread on http://teachingopensource.org/ about commonly used teaching apps and one of the more common ones I saw mentioned was moodle. Moodle is an open source, PHP based course management app, similar to other apps I’ve really liked working with (Wordpress, phpbb2, gallery2, etc.). A new database and some edits to the Apache conf files later, I was up and running.
So far, I’m really happy with it. The install was pretty painless and typical for this sort of PHP based app (enter database information, add config.php, that sort of stuff). The UI is a bit intimidating at first, but there’s a pretty sweet context sensitive help system in place that I found myself using pretty frequently.
It supports a lot of the things you’d expect to see in this sort of site. I can post quick news items, events to the class calendar, and lecture notes (assuming I actually prepared for lectures and didn’t just pull them out of my ass when I got to class). I can add assignments with much of the control I came to like in WebCT, such as setting a date when the project becomes available and a cut off time after which submissions will no longer be accepted. I’m still toying with the idea of allowing projects to be done in pairs this semester and I think that would be supported as well.
One area I love is the grade tracking. Again, it took me a little bit to get my bearings, but once I did I realized I can ditch the spreadsheet I’ve used in the past in favor of moodle. For example, it was pretty painless to set up the grade book to calculate the average of all quizzes, automatically drop the lowest one (that’s just an awesome feature, good job guys), and then weight that average as 20% of the final grade. One extra benefit of that is that each student’s current grade is always calculated and visible to them, a level of transparency I’m really happy to see. Oh, and that calculation can be set to ignore grades that haven’t yet been entered yet, so the participation grade I don’t enter until the end of the semester won’t be reflected as a giant zero for them over the course of the semester. Pure awesome.
The only drawback is also one of the benefits to my situation: I’m hosting it myself. So I can’t rely on the (what I hope is) strong backup strategy the university would provide. Not that I don’t have faith in my own backup scripts…
My biggest recommendation to anyone looking to try it out is to set up two sites. I’m keeping one around as a test site to try new things on and see how they work. That way, I can have some sample student accounts I can log in as to try things out (it should be mentioned that even when logged in as an admin you can have moodle show you only what a student would see, so it’s not like this step is entirely necessary). Of course, you may be able to alleviate a lot of this hands-on testing by, ya know, reading the documentation. But where’s the fun in that?
It should be an interesting experiment. Not that I want anything to go wrong with it, but it would make for an interesting open source example to my students if I was able to go to the moodle developers directly and ask for help.
Student Blogging
July 28th, 2009
There’s been a discussion going around the blogs on the teachingopensource.org planet blogs about teacher/student blogging that’s really gotten some interesting ideas going. It started out with a great post by Matt Jadud outlining some basic tenants of a blog in a guide for students. It also got picked up by David Humphrey which highlighted that it’s important for teachers to serve as a model for this sort of learning reflection as well.
My blog (as in, the one I’m writing this on) started out as an experiment to give students some outside information I thought they could use but couldn’t fit into class time. It’s since evolved (and continues to do so) into the sort of technical blog that I’ve found helpful in the past when looking for an answer to a specific question.
That evolution has proven to be important. Using a blog as the medium allows me to introduce a lot more of my personality into the entries than if I were to write a formal academic textbook. I think that’s a really important concept that I’ve seen unfortunately get lost on a number of professors. I’ve always found it easier to keep interested in a more conversational tone than when reading a preachy lecture.
My blog also gives a good insight into my tech-related projects and interests. I know many professors are looking for students to get involved in their research and projects. Often, the students either don’t know about the projects or are first presented with an ominous (read: cold, formal, dull) white paper describing the research. A blog is a natural marketing tool (not my word, I think Matt used it, but it’s a great term) for driving interest in these projects.
Meanwhile, a student authored blog is, among other things, a resume-padder. When I interview candidates, one of the most important factors I look for is enthusiasm. I want people who enjoy doing this stuff. A blog, even if it’s not 100% technically focused, shows the level of interest I’m looking for. Bonus points if you installed and administer the blog software yourself. Extreme bonus points if you contributed back to the blog software you used.
It’s also practice. I had one particular CSC professor stress the ability to write. I didn’t fully understand it at the time; I was going to be a coder and wouldn’t need to write. I’ve since told her, on a number of occasions, how much I came to appreciate the experience. The English/History/Philosophy papers students are writing for other classes are a very different voice than trying to explain to someone else why a project is a good idea or how you got around a particular bottleneck. Getting a feel for how to do that early on will be a tremendous advantage when students find themselves on team projects.
And like Matt said, it can even help propagate the awesomeness of keyboard cat.
Amazon MP3 Downloader on Fedora 11
July 3rd, 2009
I’ll cut to the chase: it doesn’t work. But have no fear, there’s an OSS solution.
I recently got into using Amazon for buying MP3s. It’s DRM-free and has a great integration with pandora.com, which lets me hear a new song and click directly in pandora’s interface to buy it. It’s technology at its finest, if not its most dangerous (to my credit card).
Amazon is annoying in the sense that you can download single MP3s as an MP3 file, but to buy a full album you have to use their proprietary downloader. This was bearable until a recent change where all MP3s now have to be downloaded using their downloader.
The problem? The most recent build of their client is for Fedora 9 (or Ubuntu 8.10 if you go that route). So their software is, um, I’ll just say “not up to date”. I was able to hack around to get it to run under Fedora 10, but it’s flat out busted in Fedora 11.
As I said at the outset, there is hope. Clamz is a command line app to download MP3s using Amazon’s .amz formatted files. It’s exactly what you think it is. You download the .amz file from Amazon (at the point in Amazon’s workflow where you should be just downloading the MP3 itself) and run the clamz executable passing in the .amz file. Poof, it just works.
I’m disappointed it has to come to this. I know Fedora 11 is still new, but that doesn’t change the fact that there was never a Fedora 10 build (and still is no Ubuntu 9.4 build) of the Amazon downloader. Serious good karma to the Clamz project for stepping up and filling this need (at least until I find a new outlet for buying MP3s; if Amazon doesn’t want to let me buy from them then I’m not gonna go nuts trying to).



