summaryrefslogtreecommitdiffstats
path: root/xmonad.hs
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2011-09-03 12:12:07 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2011-09-03 12:12:07 +0200
commitd7735aa3cc1dbf273bb5464e15d9d4fea1b76495 (patch)
tree08da5480a1d0359483bea5852073e8bbd7577dee /xmonad.hs
parent4456299ef5af8958e777a92667f130990fdc88eb (diff)
downloadxmonad-conf-d7735aa3cc1dbf273bb5464e15d9d4fea1b76495.tar
xmonad-conf-d7735aa3cc1dbf273bb5464e15d9d4fea1b76495.zip
Add initial DynamicPerScreenWorkspaces implementation
Diffstat (limited to 'xmonad.hs')
-rw-r--r--xmonad.hs50
1 files changed, 30 insertions, 20 deletions
diff --git a/xmonad.hs b/xmonad.hs
index 9d21184..29dfe7a 100644
--- a/xmonad.hs
+++ b/xmonad.hs
@@ -31,13 +31,12 @@ modm = mod4Mask
main = xmonad $ ewmh $ defaultConfig
{ modMask = modm
, manageHook = myManageHook
- , unmanageHook = myUnmanageHook
, layoutHook = desktopLayoutModifiers myLayoutHook
, startupHook = myStartupHook
, handleEventHook = myEventHook
- , workspaces = myWorkspaces
- , borderWidth = 0
, logHook = ewmhDesktopsLogHook
+ , focusedBorderColor = "#008000"
+ , rescreenHook = dynamicRescreenHook dwConfig
}
`additionalKeysP` (
[ ("M-a", sendMessage MirrorShrink)
@@ -51,16 +50,21 @@ main = xmonad $ ewmh $ defaultConfig
, ("M-<F2>", viewOrWarp 1)
, ("M-<F3>", viewOrWarp 2)
, ("M-b", banishScreen LowerRight)
- , ("M-p", spawnOnCurrent "exe=`dmenu_path | /home/neoraider/bin/dmemu -b` && eval \"exec $exe\"")
+ , ("M-p", spawnOnCurrent "/home/neoraider/bin/dmemu_run -b")
, ("M-g", gets (W.currentTag . windowset) >>= regroupProcess)
, ("M-S-q", io (exitWith ExitSuccess))
, ("C-M1-l", spawn "gnome-screensaver-command --lock")
, ("M-`", spawn "xclip -o | qrencode -s 10 -o- | display -geometry +0+0")
+ , ("<XF86AudioLowerVolume>", spawn "amixer -q sset Master 5%- unmute")
+ , ("<XF86AudioMute>", spawn "amixer -q sset Master toggle")
+ , ("<XF86AudioRaiseVolume>", spawn "amixer -q sset Master 5%+ unmute")
, ("M1-<F4>", kill)
]
- ++ [ (("M-" ++ show n, windows $ W.greedyView ws)) | (ws, n) <- zip myWorkspaces ([1..9]++[0])]
+ -- ++ [ (("M-C-" ++ show n, windows $ W.greedyView ws)) | (ws, n) <- zip myWorkspaces ([1..9]++[0])]
++ [ (("M-S-" ++ show n, shiftGroup ws)) | (ws, n) <- zip myWorkspaces ([1..9]++[0])]
- ++ [ (("M-C-" ++ show n, shiftIgnoreGroup ws)) | (ws, n) <- zip myWorkspaces ([1..9]++[0])]
+ -- ++ [ (("M-C-" ++ show n, shiftIgnoreGroup ws)) | (ws, n) <- zip myWorkspaces ([1..9]++[0])]
+ ++ [ (("M-" ++ show n, view dwConfig ws)) | (ws, n) <- zip [0..] ([1..9]++[0])]
+ ++ [ (("M-C-" ++ show n, viewOnCurrent dwConfig ws)) | (ws, n) <- zip [0..] ([1..9]++[0])]
)
`additionalMouseBindings`
[ ((modm, button4), \_ -> sendMessage Shrink)
@@ -70,7 +74,20 @@ main = xmonad $ ewmh $ defaultConfig
]
-myWorkspaces = map (show . flip mod 10) [1..10]
+myWorkspaces = map show [1..10]
+
+dwConfig :: DynamicWorkspaceConfig
+dwConfig = DynamicWorkspaceConfig { defaultWorkspaceScreen = defWSScreen
+ , workspaceTag = show . (+1)
+ }
+
+defWSScreen :: WorkspaceScreens
+defWSScreen 1 _ = S 0
+
+defWSScreen _ i | i `elem` [0..7] = S 0
+defWSScreen _ i | i `elem` [8,9] = S 1
+
+defWSScreen n i = S (i `mod` n)
viewOrWarp :: Int -> X ()
@@ -82,13 +99,6 @@ viewOrWarp n = do
whenJust ws $ \w -> windows . W.view $ w
when (s == (W.screen . W.current $ wset)) $ warpToScreen s (1%2) (1%2)
-
---myStartupHook :: X ()
---myStartupHook = do
--- startupHook gnomeConfig
--- spawn "killall -u `id -un` -q xcompmgr; exec xcompmgr"
-
-
setFullscreenSupported :: X ()
setFullscreenSupported = withDisplay $ \dpy -> do
r <- asks theRoot
@@ -104,7 +114,7 @@ myStartupHook = do
startupHook desktopConfig
setWMName "LG3D"
setFullscreenSupported
- spawn "ibus-daemon -r -x"
+
isUtility :: Query Bool
isUtility = isInProperty "_NET_WM_WINDOW_TYPE" "_NET_WM_WINDOW_TYPE_UTILITY"
@@ -133,8 +143,7 @@ moveUp1 = stackHook up
myManageHook :: ManageHook
myManageHook = composeAll
- [ moveDown1
- , isDialog --> doFloat
+ [ isDialog --> doFloat
, composeOne
[ className =? "Guake.py" -?> doFloatMaybeFullscreen -- <+> doConfigBorderOff)
--, className =? "Do" -?> (doFloat <+> doConfigBorderOff)
@@ -144,17 +153,18 @@ myManageHook = composeAll
, className =? "jrummikub-JRummikub" -?> doFloat
, className =? "Stjerm" -?> doFloatMaybeFullscreen
, className =? "Display" -?> doFloat
+ , className =? "Dwarf_Fortress" -?> doFloat
, className =? "Wine" -?> doFloat
, className =? "Pcsx2" -?> doFloat
- , stringProperty "WM_ICON_NAME" =? "ZeroGS" -?> doFloat
+ , stringProperty "WM_ICON_NAME" =? "ZZogl-pg" -?> doFloat
, isFullscreen -?> doFullscreen
]
, isUtility =? False --> doAutoShift
, manageHook desktopConfig
]
-myUnmanageHook :: ManageHook
-myUnmanageHook = moveUp1
+--myUnmanageHook :: ManageHook
+--myUnmanageHook = moveUp1
myLayoutHook = processWorkspaceManager $ manageFullscreen $ smartBorders (Full ||| tiled ||| Mirror tiled)