Removing desktop icons in Gnome

December 11th, 2009

A friend of mine is migrating from Windows to Fedora and has been asking me a bunch of questions about my setup. As I was looking over my wiki for notes I’ve taken, I realized one of the tasks I always find myself doing in Gnome is to disable the default desktop icons. My reasoning is a combination of the fact that I try to use the mouse as little as possible and a compulsive desire to have an empty desktop. I should probably seek some psychiatric help on the compulsion, but since I was able to disable the icons the doctor will have to wait until my next episode.

There is unfortunately no menu option for this in preferences, so I had to use gconf-editor. That’s not installed by default, but it’s easy enough to fix that.

sudo yum -y install gconf-editor

Once it’s installed, run it and navigate to apps -> nautilus -> desktop. Uncheck the *_icon_visible options until your compulsion subsides and you’re good to go.

Child’s Play Charity

December 10th, 2009

Child's Play Charity

http://www.childsplaycharity.org/

I’m not the type to get preachy about charity and donations and Christmas and all that stuff. But since this is the time of year where people are more inclined to give to charity, I wanted to drop a quick note about Child’s Play Charity just to increase awareness. More information can be found on their site, but I’ll mention a quick snippet to summarize what they are:

Since 2003, we’ve set up and organized Child’s Play, a game industry charity dedicated to improving the lives of children with toys and games in our network of over 60 hospitals worldwide. In five short years, you as a community have answered the call and come together to raise millions of dollars.

And just to be clear, I’m not affiliated with them in any way. I’m a video game geek and have a soft spot for children, so this initiative has always resonated with me.

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.

Devil's Pie + Gnome Terminal = WinClick for 1680×1050 version

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.

I’ve had my printer since 1998. That’s a damn good run for any piece of hardware. It still works insofar as it prints, but in 2009, we know it could do more. As it is, I only have one desktop left in the house with the old school printer connector so I can actually use it (it doesn’t have a network connection).

We’re not looking for anything crazy, just a fairly standard all-in-one:

  • Direct connection to the network. Wired is fine, it’s gonna sit next to a big ass gigabit switch.
  • Printer (duh). Standard paper size, we don’t have much of a need to print anything bigger.
  • Scanner for the five times a year we actually want to scan something.
  • Fax for the two times a year we actually need to fax something.
  • Ability to make coffee (we’re willing to bend on this one).

I’m looking at the HP all-in-ones, but I wanted to throw this out there to see if anyone had any recommendations and comments on Linux support.

Any advice is appreciated. Happy Holidays :)