Skip to content

Instantly share code, notes, and snippets.

@fehrenbach
Created September 9, 2011 12:15
Show Gist options
  • Select an option

  • Save fehrenbach/1206061 to your computer and use it in GitHub Desktop.

Select an option

Save fehrenbach/1206061 to your computer and use it in GitHub Desktop.
import XMonad
import XMonad.Actions.UpdatePointer
import XMonad.Config.Desktop
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.ManageHelpers
import XMonad.Hooks.EwmhDesktops
import XMonad.Hooks.SetWMName
import XMonad.Layout.PerWorkspace
import XMonad.Layout.Reflect
import XMonad.Layout.Spiral
import XMonad.Layout.IM
import XMonad.Layout.NoBorders
import XMonad.Util.EZConfig(additionalKeys)
import qualified XMonad.StackSet as W
import qualified Data.Map as M
import Data.Ratio
win = mod4Mask
myWorkspaces = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0"]
myKeys =
[((win, xK_b), spawn "chromium"), -- browser on win+b
((win, xK_r), spawn "konsole"),
((win, xK_e), spawn "emacs"),
-- Restart xmonad
--((win, xK_q), spawn "xmonad --recompile; xmonad --restart"),
-- close focused window
((win, xK_c), kill),
((win, xK_m), spawn "kmail --composer"),
((win, xK_F7), spawn "amarok -t"),
((win, xK_F8), spawn "amarok -f")
] ++
-- switch workspace and move to workspace with win-[1..9] win-shift-[1..9]
-- DVORAK AWARE!
-- Meaning: & [ { } ( = * ) + ] ! are 0 1 2 3 4 5 6 7 8 9 10
[((m .|. win, k), windows $ f i)
| (i, k) <- zip myWorkspaces [xK_ampersand,
xK_bracketleft,
xK_braceleft,
xK_braceright,
xK_parenleft,
xK_equal,
xK_asterisk,
xK_parenright,
xK_plus,
xK_bracketright,
xK_exclam] --[xK_1 .. xK_10]
, (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]]
myLayoutHook = smartBorders $ desktopLayoutModifiers $ onWorkspace "8" (spiral (1/2)) (reflectHoriz tall) ||| Mirror tall ||| Full
where tall = (Tall 1 (3/100) (1/2))
-- mouse pointer follows focus
myLogHook = updatePointer (Relative 0.618 0.618)
myManageHook = composeAll
[className =? "Choqok" --> doF (W.shift "8"),
className =? "Kopete" --> doF (W.shift "8"),
className =? "Quasselclient" --> doF (W.shift "8"),
className =? "Skype" --> doF (W.shift "8"),
className =? "Kontact" --> doF (W.shift "7"),
className =? "plus.google.com" --> doF (W.shift "9"),
className =? "www.facebook.com" --> doF (W.shift "9"),
className =? "Vlc" --> doFloat,
isFullscreen --> doF W.focusDown <+> doFullFloat]
myStartupHook = do
spawn "kioclient exec /home/stefan/bin/Facebook.desktop"
spawn "kioclient exec /home/stefan/bin/Google+.desktop"
setWMName "LG3D" -- fix Java GUI
main = xmonad $ desktopConfig
{ modMask = win, -- use windows button as mod
terminal = "konsole",
normalBorderColor = "#000000",
focusedBorderColor = "#FF0000", -- "#2B74C7",
-- borderWidth = 2,
focusFollowsMouse = True,
manageHook = myManageHook <+> manageHook desktopConfig,
layoutHook = myLayoutHook,
logHook = myLogHook >> logHook desktopConfig,
startupHook = startupHook desktopConfig >> myStartupHook
} `additionalKeys` myKeys
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment