jasonwryan.com

Miscellaneous ephemera…

Intuxication

image

I have previously posted about using Mercurial to share dotfiles, and how I have been using bitbucket as a free host for that service.

Recently, I came across Intuxication, who describe themselves thus:

Intuxication provides a free, fast and lightweight platform to host your Mercurial repositories.

You will see from their URL that they are only in beta, but the service—while undeniably rough around the edges—looks quite promising.

For small projects, the limit is 1GB disk space, Intuxication provides all of the basic features you need to maintain a mercurial repository.

One of the advantages it has over bitbucket is that the default stylesheet makes it much easier to read the files that you host. And while there are obviously plans to introduce more styles (from the Configure menu you can select a dropdown of five different styles), currently only one works.

If I had any criticism at all, it would be that the unfinished nature of the website (like the broken styles and the fact that quite a few of the other features like that don’t work) means that it feels a lot more like an alpha than a beta.

However, I’m sure that with time and some support (there is a donate button on every page), Intuxication will continue to develop. I think it is a site with potential, and I’m currently pushing my EeePC dotfiles there.

Mail Checking Script

image

I use mutt and offlineimap to manage email on my Arch Linux machines. I like the simplicity and the power that this approach offers; that’s power in the sense of extensibility and customization, by the way…

Using dwm as my window manager, I had relied on conky and dzen2 to pipe system information into my status bar. Unfortunately, conky only supports one mail spool so if, like me, you use offlineimap to synchronize multiple mailboxes, conky would only show new mail in your primary box. I had asked in #conky about multiple mail spools, but it doesn’t seem to be supported.

When I recently started using WMFS I decided to move to a bash script for my status information. So I approached the problem afresh and decided to write a script to poll the new mail directories and update my status bar when mail arrived.

Offlineimap creates a directory structure like so:

   Mail/ -------
      |         |
      |     Mail_Account_1
      |         |
      |         | --  INBOX 
      |         |       | -- cur
      |         |       | -- new
      |         |       | -- temp
      |         |
      |         | -- INBOX.Drafts
      |         |       | -- cur

As I was only interested in checking the INBOX/new directory of each account, I had imagined that it would be necessary to set up some elaborate array to effectively check each of the requisite sub-directories…

No, it was pretty simple. Just globbing and find, actually.

mailcheck.sh
1
2
3
4
5
6
#!/bin/bash
# Set maildirs
maildirs="$HOME/Mail/*/INBOX/new/"

find $maildirs -type f | wc -l
exit 0

The glob (*) takes care of the different mail account names, and has the added bonus of being portable, and find returns any files (-type f) with wc counting the number of lines (the -l switch).

WMFS - Window Manager From Scratch

image

I have been experimenting with a couple of new window managers over the last week or so. Not that I am in any way dissatisfied with dwm — far from it; I do from time to time, however, like to see what else is on offer.

WMFS is a fairly new entrant in the window manager marketplace. The developers describe it as:

a lightweight and highly configurable tiling window manager for X… It supports Xft (Freetype) fonts and is compliant with the Extended Window Manager Hints (EWMH) specifications, Xinerama and Xrandr.

The git version is available in AUR, and is straightforward to build and install. The fun, as always, comes with customization…

As is says on the box, WMFS is highly configurable. The configuration is all done (initially) in one file, which you will need to copy to your ~/.config/wmfs/directory:

1
cp /etc/xdg/wmfs/wmfsrc ~/.config/wmfs/

Even the default config is relatively fully featured. There are nine default layouts (about five more than I usually need, but it is always better to over cater). The wmfsrc is quite well commented, so most of the options are self explanatory.

One thing I did note about editing this file, which is probably more a reflection of my haste rather than the wm itself, is that it seemed very unforgiving of any errors. More than once I had to copy the default wmfsrc back across and start again. My advice is to make any changes cumulatively, and test by reloading before continuing.

You can see my config file in my bitbucket repo. Most of the changes have been made in setting up my preferred tags and keybindings – so they are consistent with my dwm and echinus setups.

One of the great features of WMFS is the status bar. You can pipe all sorts of information into it with a bash script, and you can use colours and icons (if that is your thing). Simply sourcing the bash script from within wmfsrc will see it up and running:

1
background_command = "$HOME/.config/wmfs/autostart.sh"

Or, if you prefer to use conky:

1
conky | while read -r; do wmfs -s -name "$REPLY"; done

I use the status bar to display some basic system information. You can see from my status script that most of it is simply piping commands through the awesomeness that is awk.

I hadn’t thought that I would find a replacement for dwm, but WMFS is a serious contender. It has all of the functionality out-of-the-box, including:

  • pre-set layout per tag
  • rules to send applications to specific tags
  • completely customizable keybinds, and – as a bonus,
  • Vi-driven command interface

Unlike dwm, it requires no patching for any of this. It has been completely stable while I have been using it and, while not as light as dwm, it is still in the minimalist camp in terms of size.