Xmonad: More Cool Functionality and How It Was Achieved.

I’ve written a few times about my Xmonad configuration, and what I am doing using this unusual window manager.

If you haven’t read my previous posts then here is a quick summary:

  • Xmonad is a tiling window manager. This means that when you first launch a program it launches ‘full screen’ (minimise and maximise buttons are completely ineffectual). When you open a second program on a  screen then the new program gets 50% of the screen and the original program gets shrunk to 50% to. Adding further programs gives each progressive program less space, but the windows are all tiled together.
  • I took my configuration from the internet. It is something I plan to investigate and customise myself in future, but for now it works well.
  • Xmonad is written in Haskell which means that it has lead to me discovering a type of programming that I had no idea existed. I intend to look into this and blog about it in the future.

So I started to use Xmonad. Now I like to have a certain amount of things launch when I first log in, but I was finding it difficult to trigger these in Xmonad. The advice I found on line seemed to point to one of two ways of achieving these auto-starts, but neither approach appeared to work for me (another thing I will revisit at some point!). Amongst the things I wanted to happen were:

  • Switch to the Dvorak keyboard layout (British version with UK punctuation).
  • Swap the left hand ‘Ctrl’ and ‘Caps Lock’ keys. This is a customisation popular among Emacs users (Ctrl is an important key in Emacs) as it moves the Ctrl key onto the ‘home’ row of the keyboard.
  • Start the Emacs daemon in the background. This means that all of the initialisation files are pre-loaded, and an Emacs terminal can be started quickly.
  • Start the Dropbox daemon to update the local copies of any files to match those of the ‘cloud’ storage.
  • Start conky, the desktop monitoring app. My work configuration for conky is so extensive that it is split into three separate files which load at intervals.
  • Start the screensaver.

I have decided to do all of these things using a simple bash script. This way I don’t have to remember the complicated bit (the full command for setting the keyboard layout is the tricky bit), and I only have to run one very simple command.

There are currently a couple of minor issues that have arisen, and which needs a little bit more work, but things are going in the right direction.

  1. On my work machine the conky startup actually runs a script that then runs three separate instances of conky, each with a different configuration file, and in a different location. The three instances start up with a delay of 20 seconds each. Launching a program before this process is complete can end up leaving the output of conky ‘overlaying’ the window. Mostly this is an aesthetic issue, but it also means that at times I can’t reach the desktop to click on a button because conky is in the way.
  2. I have a folder which is configured so that scripts which are placed in it can be called just by typing their name. I am planning to make this folder a part of my ‘Dropbox’ configuration. Then I can have the script made universal across my various machines. There are some issues that will need to be addressed before this happens. These include the fact that I am using a different approach to managing the desktop wallpaper on my home machine to the approach I have for my work machine.
  3. I want to change the keyboard customisation for Xmonad. On my laptop I need to press a separate key to select the function keys (F1-F12). As these keys are used in combination with Alt and the ‘modifier’ key in Xmonad I have to press three keys to switch desktops. I plan to change the ‘desktop select’ to address this issue.

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s