Lake Denman

Daily Log | 2011-05-28

XMonad Workspaces

Confession:

I am an xmonad user. However, I do not program in Haskell. I need to modify the xmonad.hs config file from time to time and find myself using trial and error. Then I cheat by using github to view everyone else’s “.hs files!”

Phew, now that I got that out, here’s a tip:

I decided to clean up my Desktop a bit and needed to get rid of most extra workspaces that xmonad provides; xmonad provides nine by default!

I sprinkled some of this magic code to force xmonad to only use three. It also takes the liberty of assigning my favorite applications to those workspaces.

-- ~/.xmonad/xmonad.hs

import XMonad
import XMonad.Config.Gnome
import qualified XMonad.StackSet as W

myWorkspaces = ["1:dev","2:web","3:mail"]

-- Define the workspace an application has to go to
myManageHook = composeAll
  [  className =? "GNU IceCat"   --> doF (W.shift "2:web")
   , className =? "Konsole"      --> doF (W.shift "1:dev") 
   , title     =? "mutt"         --> doF (W.shift "3:mail") 
  ]

main = xmonad $ gnomeConfig
  {  terminal   = "konsole" 
   , workspaces = myWorkspaces
   , manageHook = manageHook gnomeConfig <+> myManageHook
  }

Tip: Use xprop to find the window classes.

The three workspaces are looking great! I love how I can automatically assign applications to specific workspaces. Having a convenient convention in place helps me get used switching to the workspace I wanted.

I believe smaller is better in this case. When there were nine workspaces, it was difficult for me to switch to the correct workspace. I used to stumbled upon the one that I wanted.

Let me be clear that I use only the keyboard to select the workspaces. I did auto hide my workspace panel. The problem with that approach is that I have not found a way to unhide the panel with a key binding.

The solution now is to always show the panel. I love the full screen environment that xmonad gives me. And that gets screwed up by me needing to see the workspaces all the time.

That was with nine and with three it is a little different.

* Development applications (Terminal) shift to workspace 1. 
* Web (Browsers) shift to workspace 2. 
* Email shifts to workspace 3.

There is just not as much stumbling around with this approach. It has already been more pleasant to use. I auto hide my panel now.

Ubuntu Upgrade

I am weeks behind on getting the latest Ubuntu installed. Can we agree? “Easier said than done.” The installer has about 40 minutes left to go.

My main fear is that my system will break. I hope it all “just works”, but this project, like many others, are taken without warranty. Which is exactly why I backed up my system with deja-dup. There is only 15 minutes to go. Time to eat some cranberries.

As I returned to my newly booted Ubuntu 11.04 system, I realized that I was not booted into XMonad at all. I am booted into Unity. And I expected that for the most part.

I figured out how to get XMonad back up and running by following the advice of robmd.com.

Deja-dup

deja-dup is a great backup application. It comes with sane defaults, stays out of the way, can be scheduled, and more.

Although deja-dup provides the ability to backup to remote services, including Amazon S3, I chose to use a standard external hard drive.

Also, the fantastic backup program has been trained to only backup files that have changed. This feature makes multiple backups easier!

If you feel so inclined to start backing up today, give deja-dup a shot.

sudo apt-get install deja-dup

Prism

If you have ever seen the popular fluidapp.com for OS X, you will immediately understand what Prism is.

For those who have not a clue, Prism is a way to split web applications out of the browser and run them directly on the desktop.

sudo apt-get install prism

konsole and mutt

konsole and mutt play well together. I found this out when I needed to assign a title to the terminal window that runs mutt.

The command I came up with is easy and it just works.

konsole --title "mutt" -e "mutt"

Since I switched to Linux, I have only really used gnome-terminal. When I tried the command with gnome-terminal things were weird!

gnome-terminal --name "mutt" -e "mutt" 

The terminal would not refresh correctly. I have yet to understand why it will not work for me. Since then, I have switched to konsole and it works well.

Home