Skip to content

Instantly share code, notes, and snippets.

@nailor
Created August 13, 2009 21:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nailor/167449 to your computer and use it in GitHub Desktop.
Save nailor/167449 to your computer and use it in GitHub Desktop.
import XMonad
import XMonad.Config.Gnome
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.EwmhDesktops
import XMonad.Hooks.ManageDocks
import XMonad.Layout.ToggleLayouts as TL
import XMonad.Layout.PerWorkspace
import XMonad.Layout.NoBorders
import XMonad.Layout.ResizableTile
import XMonad.Util.Run(spawnPipe)
import XMonad.Hooks.ManageHelpers
import System.IO
import qualified Data.Map as M
-- colors match Ubuntu Human theme and Gnome panels
selected = "'#fad184'"
background = "'#efebe7'"
foreground = "'#000000'"
-- height matches Ubuntu top Gnome panel
barHeight = "24"
-- font intended to match Ubuntu default application font
appFontXft = "'xft\
\:Sans\
\:pixelsize=14\
\:weight=regular\
\:width=semicondensed\
\:dpi=96\
\:hinting=true\
\:hintstyle=hintslight\
\:antialias=true\
\:rgba=rgb\
\:lcdfilter=lcdlight\
\'"
-- currently dzen2 compiled locally to get xft support
-- (-e prevents loss of title if naive user clicks on dzen2)
myDzenTitleBar =
"dzen2\
\ -ta l\
\ -x 300 -w 700 -y 0\
\ -e 'entertitle=uncollapse'\
\ -h " ++ barHeight ++ "\
\ -bg " ++ background ++ "\
\ -fg " ++ foreground
-- dmenu patched and compiled locally to add xft support
myDmenuTitleBar =
"exec `dmenu_path | dmenu\
\ -p 'Run:'\
\ -i\
\ -nb " ++ background ++ "\
\ -nf " ++ foreground ++ "\
\ -sb " ++ selected ++ "\
\`"
myLayoutHook = smartBorders $ avoidStruts $ tiled ||| Mirror tiled ||| Full
where
tiled = Tall nmaster delta ratio
nmaster = 1
ratio = 1/2
delta = 4/100
main = do
xmproc <- spawnPipe myDzenTitleBar
xmonad $ gnomeConfig
{ modMask = mod4Mask -- Rebind Mod to Windows key
, logHook = myLogHookWithPP $ defaultPP
{ ppOutput = hPutStrLn xmproc
, ppOrder = take 1 . drop 2
}
, manageHook = manageHook gnomeConfig <+> myManageHook
, keys = myKeys
, terminal = "urxvt"
, layoutHook = myLayoutHook
}
where
myManageHook = composeAll [
(resource =? "Do" --> doIgnore)
, (className =? "Pidgin" <&&> title =? "Buddy List") --> doShift "3"
, className =? "Gwibber" --> doShift "3"
, isFullscreen --> doFullFloat
-- , isDialog --> doCenterFloat
]
myLogHookWithPP :: PP -> X ()
myLogHookWithPP pp = do
logHook gnomeConfig
dynamicLogWithPP pp
defKeys = keys defaultConfig
delKeys x = foldr M.delete (defKeys x) (toRemove x)
myKeys x = foldr (uncurry M.insert) (delKeys x) (toAdd x)
-- remove some of the default key bindings
toRemove x =
[ (modMask x , xK_p )
, (modMask x .|. shiftMask, xK_q ) -- don't strand naive users
]
toAdd x =
[
((modMask x, xK_b ), sendMessage ToggleStruts)
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment