Created
December 10, 2013 21:22
-
-
Save sbechtel/7900440 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import XMonad | |
import XMonad.Hooks.DynamicLog | |
import XMonad.Hooks.ManageDocks | |
import XMonad.Util.EZConfig | |
import XMonad.Util.Run | |
import XMonad.Layout.Spacing | |
import XMonad.Layout.NoBorders | |
import XMonad.Layout.PerWorkspace | |
import XMonad.Layout.StackTile | |
import XMonad.Prompt | |
import XMonad.Prompt.Shell | |
import XMonad.Prompt.Man | |
import XMonad.Actions.Search | |
import XMonad.Actions.ShowText | |
import XMonad.Actions.CycleWS | |
import System.IO | |
import qualified Data.Map as M | |
import qualified XMonad.Actions.Submap as SM | |
main = do | |
xmproc <- spawnPipe "/usr/bin/xmobar" -- /home/sebastian/.xmobarrc" | |
xmonad $ defaultConfig | |
{ layoutHook = avoidStruts $ myLayouts | |
, workspaces = myWorkspaces | |
, manageHook = myManageHooks <+> manageHook defaultConfig | |
, handleEventHook = handleTimerEvent | |
, logHook = dynamicLogWithPP xmobarPP | |
{ ppTitle = xmobarColor "blue" "" . shorten 50 | |
, ppOutput = hPutStrLn xmproc | |
, ppLayout = const "" | |
} | |
, borderWidth = 2 | |
, normalBorderColor = "#abc123" | |
, focusedBorderColor = "#456def" } | |
-- additional key bindings | |
`additionalKeys` | |
[ | |
((0, xK_Print), spawn "scrot -e '$f /home/sebastian/Dropbox/Screenshots/'") | |
, ((mod1Mask, xK_Print), spawn "scrot -s") | |
, ((mod1Mask, xK_a), promptSearch defaultXPConfig google) | |
, ((0, 0x1008ff2d), spawn "i3lock -d -i /home/sebastian/tile.png -t") | |
-- Prompts | |
, ((mod1Mask, xK_F3), shellPrompt defaultXPConfig) | |
, ((mod1Mask, xK_s), SM.submap $ searchEngineMap $ promptSearch defaultXPConfig) | |
, ((mod1Mask, xK_F1), manPrompt defaultXPConfig) | |
-- WS management stuff | |
, ((mod1Mask, xK_Right), flashText defaultSTConfig 1 "-->" >> nextWS) | |
, ((mod1Mask, xK_Left), flashText defaultSTConfig 1 "<--" >> prevWS) | |
, ((mod1Mask, xK_Tab), flashText defaultSTConfig 1 "<->" >> toggleWS) | |
] | |
-- define map of search engines for a submapping | |
searchEngineMap method = M.fromList list | |
where | |
list = map (\(key, engine) -> ((0, key), method engine)) | |
[ (xK_a, alpha) | |
, (xK_y, youtube) | |
, (xK_w, wikipedia) | |
, (xK_m, maps) | |
, (xK_i, images) | |
, (xK_h, hoogle) | |
, (xK_g, google) | |
] | |
myLayoutsPlain = spacing 3 $ Tall nmaster delta ratio ||| Full ||| StackTile nmaster delta ratio | |
where | |
-- number of windows in the master pane | |
nmaster = 1 | |
-- percent of screen to increment by when resizing panes | |
delta = 3/100 | |
-- proportion of screen occupied by master pane | |
ratio = 2/3 | |
myLayouts = onWorkspace "1:www" noBordersFull myLayoutsPlain | |
noBordersFull = noBorders Full | |
myWorkspaces = let wsListNames = ["www", "code", "misc"] | |
wsList = zip [1 ..] wsListNames | |
in map (\(number, name) -> show number ++ ":" ++ name) wsList | |
myManageHooks = composeAll | |
[ className =? "Firefox" --> doShift "1:www" | |
, className =? "Claws-mail" --> doShift "1:www" | |
, className =? "URxvt" --> doShift "2:code" | |
, className =? "Gimp" --> doFloat | |
, className =? "Skype" --> doFloat | |
, className =? "Xmessage" --> doFloat | |
, className =? "stalonetray" --> doIgnore | |
, className =? "trayer" --> doIgnore | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment