{-# OPTIONS_GHC -fno-warn-missing-signatures #-}
{-# LANGUAGE NoMonomorphismRestriction #-}
module XMonad.Config.Arossato
(
arossatoConfig
) where
import qualified Data.Map as M
import XMonad hiding ( (|||) )
import qualified XMonad.StackSet as W
import XMonad.Actions.CycleWS
import XMonad.Hooks.DynamicLog hiding (xmobar)
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.ServerMode
import XMonad.Layout.Accordion
import XMonad.Layout.LayoutCombinators
import XMonad.Layout.Magnifier
import XMonad.Layout.NoBorders
import XMonad.Layout.SimpleFloat
import XMonad.Layout.Tabbed
import XMonad.Layout.WindowArranger
import XMonad.Prompt.Shell
import XMonad.Prompt.Ssh
import XMonad.Prompt.Theme
import XMonad.Prompt.Window
import XMonad.Prompt.XMonad
import XMonad.Util.Run
import XMonad.Util.Themes
arossatoConfig = do
xmobar <- spawnPipe "xmobar"
return $ def
{ workspaces = ["home","var","dev","mail","web","doc"] ++
map show [7 .. 9 :: Int]
, logHook = myDynLog xmobar
, manageHook = newManageHook
, layoutHook = avoidStruts $
decorated |||
noBorders mytabs |||
otherLays
, terminal = "urxvt +sb"
, normalBorderColor = "white"
, focusedBorderColor = "black"
, keys = newKeys
, handleEventHook = serverModeEventHook
, focusFollowsMouse = False
}
where
mytabs = tabbed shrinkText (theme smallClean)
decorated = simpleFloat' shrinkText (theme smallClean)
tiled = Tall 1 (3/100) (1/2)
otherLays = windowArrange $
magnifier tiled |||
noBorders Full |||
Mirror tiled |||
Accordion
myManageHook = composeAll [ resource =? "win" --> doF (W.shift "doc")
, resource =? "firefox-bin" --> doF (W.shift "web")
]
newManageHook = myManageHook
myDynLog h = dynamicLogWithPP def
{ ppCurrent = xmobarColor "yellow" "" . wrap "[" "]"
, ppTitle = xmobarColor "green" "" . shorten 40
, ppVisible = wrap "(" ")"
, ppOutput = hPutStrLn h
}
defKeys = keys def
delKeys x = foldr M.delete (defKeys x) (toRemove x)
newKeys x = foldr (uncurry M.insert) (delKeys x) (toAdd x)
toRemove x =
[ (modMask x , xK_j)
, (modMask x , xK_k)
, (modMask x , xK_p)
, (modMask x .|. shiftMask, xK_p)
, (modMask x .|. shiftMask, xK_q)
, (modMask x , xK_q)
] ++
[(shiftMask .|. modMask x, k) | k <- [xK_1 .. xK_9]]
toAdd x =
[ ((modMask x , xK_F12 ), xmonadPrompt def )
, ((modMask x , xK_F3 ), shellPrompt def )
, ((modMask x , xK_F4 ), sshPrompt def )
, ((modMask x , xK_F5 ), themePrompt def )
, ((modMask x , xK_F6 ), windowPromptGoto def )
, ((modMask x , xK_F7 ), windowPromptBring def )
, ((modMask x , xK_comma ), prevWS )
, ((modMask x , xK_period), nextWS )
, ((modMask x , xK_Right ), windows W.focusDown )
, ((modMask x , xK_Left ), windows W.focusUp )
, ((modMask x , xK_F2 ), spawn "urxvt -fg white -bg black +sb" )
, ((modMask x .|. shiftMask, xK_F4 ), spawn "~/bin/dict.sh" )
, ((modMask x .|. shiftMask, xK_F5 ), spawn "~/bin/urlOpen.sh" )
, ((modMask x .|. shiftMask, xK_t ), spawn "~/bin/teaTime.sh" )
, ((modMask x , xK_c ), kill )
, ((modMask x .|. shiftMask, xK_comma ), sendMessage (IncMasterN 1 ) )
, ((modMask x .|. shiftMask, xK_period), sendMessage (IncMasterN (-1)) )
, ((modMask x .|. controlMask , xK_plus ), sendMessage MagnifyMore)
, ((modMask x .|. controlMask , xK_minus), sendMessage MagnifyLess)
, ((modMask x .|. controlMask , xK_o ), sendMessage ToggleOff )
, ((modMask x .|. controlMask .|. shiftMask, xK_o ), sendMessage ToggleOn )
, ((modMask x .|. controlMask , xK_a ), sendMessage Arrange )
, ((modMask x .|. controlMask .|. shiftMask, xK_a ), sendMessage DeArrange )
, ((modMask x .|. controlMask , xK_Left ), sendMessage (DecreaseLeft 10))
, ((modMask x .|. controlMask , xK_Up ), sendMessage (DecreaseUp 10))
, ((modMask x .|. controlMask , xK_Right), sendMessage (IncreaseRight 10))
, ((modMask x .|. controlMask , xK_Down ), sendMessage (IncreaseDown 10))
, ((modMask x .|. shiftMask , xK_Left ), sendMessage (MoveLeft 10))
, ((modMask x .|. shiftMask , xK_Right), sendMessage (MoveRight 10))
, ((modMask x .|. shiftMask , xK_Down ), sendMessage (MoveDown 10))
, ((modMask x .|. shiftMask , xK_Up ), sendMessage (MoveUp 10))
, ((modMask x , xK_b ), sendMessage ToggleStruts )
] ++
[( (m .|. modMask x, k), windows $ f i)
| (i, k) <- zip (workspaces x) [xK_1 .. xK_9]
, (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask .|. controlMask)]
]