Mostly descriptions and instructions for little bits of technology I've found useful.

Sunday, July 26, 2009

Asus eee 1000 xmonad configs

I'm running Ubuntu 8.10 (Intrepid Ibex) on my Asus eee 1000, using the array.org kernel (highly recommended). I've been mostly happy with it - it provides a completely acceptable web browsing, ssh-ing and emacs text editing experience, and I'm much happier carrying it around on my back than my huge 15" MacBook Pro. Two of my major complaints, though, are that the screen is very small (1024 x 800) and the touchpad is very annoying.

I decided to try xmonad, a tiling window manager that lets me minimize both the amount of wasted space at the top and bottom of my screen (compared to GNOME) and the frequency with which I have to fight with the touchpad. I set up xmonad with a tabbed layout (the screen is way too small for tiling windows IMHO), a vertically-minimal xmobar with some basic information, and a runOrRaise prompt for starting programs. I've been using this configuration for a few months and I'm very happy with it. Check out some screenshots, and listed below are the configurations I'm using if you'd like to try it yourself.

xmonad.hs
import qualified Data.Map as M
import XMonad
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Layout.Tabbed
import XMonad.Prompt
import XMonad.Prompt.RunOrRaise
import XMonad.Util.Run(spawnPipe)
import XMonad.Util.EZConfig(additionalKeys)
import System.IO

main = do
xmproc <- spawnPipe "/usr/local/bin/xmobar /home/matt/.xmobarrc"
xmonad $ defaultConfig {
manageHook = manageDocks <+> manageHook defaultConfig,
layoutHook = avoidStruts $ simpleTabbed,
logHook = dynamicLogWithPP $ xmobarPP {
ppOutput = hPutStrLn xmproc,
ppLayout = const "",
ppTitle = xmobarColor "green" "" . shorten 66
},
modMask = mod4Mask,
borderWidth = 1,
normalBorderColor = "#404040",
focusedBorderColor = "#808080",
keys = allKeys
}

allKeys x = M.union (keys defaultConfig x) (M.fromList (myKeys x))
myKeys x =
[ ((modMask x, xK_x), runOrRaisePrompt defaultXPConfig),
((modMask x .|. shiftMask, xK_q), spawn "gnome-session-save --kill") ]

.xmobarrc
Config { font = "-Misc-Fixed-Bold-R-Normal--13-120-75-75-C-70-ISO8859-1"
, bgColor = "black"
, fgColor = "grey"
, position = TopW L 90
, commands = [ Run Cpu ["-L","3","-H","50","--normal","green","--high","red"] 10
, Run Memory ["-t","Mem: %"] 10
, Run Swap [] 10
, Run Date "%a %b %_d %l:%M" "date" 10
, Run StdinReader
]
, sepChar = "%"
, alignSep = "}{"
, template = "%StdinReader% }{ %cpu% %memory% %swap% %date%"
}

.xsession
xrdb -merge .Xresources

trayer --edge top --align right --SetDockType true --SetPartialStrut true \
--expand true --width 10 --transparent true --tint 0x000000 --height 12 &

xsetroot -solid black

if [ -x /usr/bin/gnome-settings-daemon ] ; then
gnome-settings-daemon &
fi

if [ -x /usr/bin/nm-applet ] ; then
nm-applet --sm-disable &
fi

if [ -x /usr/bin/gnome-power-manager ] ; then
gnome-power-manager &
fi

exec xmonad

No comments:

Post a Comment

Followers