summaryrefslogtreecommitdiff
path: root/desktop/xmonad
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2013-03-13 10:16:17 +0000
committerDaniel Silverstone <dsilvers@digital-scurf.org>2013-03-13 10:16:17 +0000
commit35775f9a7536cc0433f96bf2c69298a1e89a9ed7 (patch)
tree2e237d11c09e2102482abb4a8b068675904229af /desktop/xmonad
parentfe54b7de671018b3333ce83caeab3c23f91301f8 (diff)
downloadresources-35775f9a7536cc0433f96bf2c69298a1e89a9ed7.tar.bz2
Put Xmonad and TaffyBar configs into git
Diffstat (limited to 'desktop/xmonad')
-rw-r--r--desktop/xmonad/xmonad.hs65
1 files changed, 65 insertions, 0 deletions
diff --git a/desktop/xmonad/xmonad.hs b/desktop/xmonad/xmonad.hs
new file mode 100644
index 0000000..4b309ef
--- /dev/null
+++ b/desktop/xmonad/xmonad.hs
@@ -0,0 +1,65 @@
+import XMonad
+import XMonad.Config.Gnome
+import XMonad.Actions.DynamicWorkspaces
+import XMonad.Prompt
+import XMonad.Prompt.Shell
+import XMonad.Prompt.XMonad
+import qualified XMonad.Util.EZConfig as EZ
+import qualified XMonad.StackSet as W
+import XMonad.Actions.CycleWS
+import DBus.Client.Simple
+import qualified XMonad.Actions.DynamicWorkspaceOrder as DO
+import System.Taffybar.XMonadLog ( dbusLogWithPP, taffybarDefaultPP )
+import XMonad.Hooks.DynamicLog
+import XMonad.Hooks.EwmhDesktops
+import XMonad.Layout.NoBorders
+
+main :: IO ()
+main = do
+ client <- connectSession
+ let pp = taffybarDefaultPP { ppSort = DO.getSortByOrder }
+ xmonad $ gnomeConfig
+ { modMask = mod4Mask
+ , logHook = (logHook gnomeConfig) >> dbusLogWithPP client pp
+ , workspaces = defaultWorkSpaces
+ , handleEventHook = fullscreenEventHook
+ , layoutHook = smartBorders (layoutHook gnomeConfig)
+ } `EZ.additionalKeysP`
+ [ -- General keys
+ ("M-x", spawn "gnome-terminal")
+ , ("M1-<F2>", shellPrompt defaultXPConfig)
+ -- Screens, Workspaces and Windows
+ , ("M1-C-<Left>", DO.moveTo Prev AnyWS)
+ , ("M1-C-<Right>", DO.moveTo Next AnyWS)
+ , ("M1-C-S-<Left>", DO.shiftTo Prev AnyWS >> DO.moveTo Prev AnyWS)
+ , ("M1-C-S-<Right>", DO.shiftTo Next AnyWS >> DO.moveTo Next AnyWS)
+ , ("M1-C-<Up>", prevScreen)
+ , ("M1-C-<Down>", nextScreen)
+ , ("M1-C-S-<Up>", shiftPrevScreen >> prevScreen)
+ , ("M1-C-S-<Down>", shiftNextScreen >> nextScreen)
+ , ("M-<Tab>", windows W.focusDown)
+ , ("M-S-<Tab>", windows W.focusUp)
+ , ("M1-<F4>", kill)
+ -- Workspace management
+ , ("M-t", addWorkspacePrompt defaultXPConfig)
+ , ("M-r", renameWorkspace defaultXPConfig)
+ , ("M-w", removeEmptyWorkspace)
+ , ("M-C-M1-<Left>", DO.swapWith Prev AnyWS)
+ , ("M-C-M1-<Right>", DO.swapWith Next AnyWS)
+ -- Management keys
+ , ("M-<F12>", xmonadPrompt defaultXPConfig)
+ , ("M-S-r", spawn "if type xmonad; then xmonad --recompile && xmonad --restart; else xmessage xmonad not in \\$PATH: \"$PATH\"; fi")
+ ]
+ `EZ.additionalKeys` extraKeyMappings mod4Mask
+
+defaultWorkSpaces :: [String]
+defaultWorkSpaces = ["mail", "term", "www", "emacs"]
+
+extraKeyMappings :: ButtonMask -> [((ButtonMask, KeySym), X ())]
+extraKeyMappings modm =
+ [ ((modm, xK_Menu), spawn "dmenu_shutdown")
+ ] ++
+ zip (zip (repeat (modm)) [xK_1..xK_9]) (map (withNthWorkspace W.greedyView) [0..])
+ ++
+ zip (zip (repeat (modm .|. shiftMask)) [xK_1..xK_9]) (map (withNthWorkspace W.shift) [0..])
+