summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--xmonad.hs48
2 files changed, 36 insertions, 13 deletions
diff --git a/.gitignore b/.gitignore
index ee6844f..192c340 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,3 +3,4 @@
*.hi
xmonad.errors
xmonad-i386-linux
+xmonad-x86_64-linux
diff --git a/xmonad.hs b/xmonad.hs
index ba4322a..3390f30 100644
--- a/xmonad.hs
+++ b/xmonad.hs
@@ -7,12 +7,14 @@ import XMonad.Actions.PhysicalScreens
import XMonad.Actions.Warp
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.ManageHelpers
+import XMonad.Hooks.SetWMName
import XMonad.Layout.ResizableTile
import qualified XMonad.StackSet as W
import XMonad.Util.EZConfig
import Control.Monad
import Control.Monad.Trans
+import Data.Maybe
import Data.Monoid
import Ratio((%))
@@ -27,7 +29,7 @@ main = xmonad $ gnomeConfig
{ modMask = modm
, manageHook = myManageHook
, layoutHook = desktopLayoutModifiers myLayoutHook
- --, startupHook = myStartupHook
+ , startupHook = myStartupHook
, handleEventHook = myEventHook
}
`additionalKeysP`
@@ -68,19 +70,39 @@ viewOrWarp n = do
-- startupHook gnomeConfig
-- spawn "killall -u `id -un` -q xcompmgr; exec xcompmgr"
+myStartupHook :: X ()
+myStartupHook = do
+ startupHook gnomeConfig
+ setWMName "LG3D"
+
+atomProperty :: String -> Query Atom
+atomProperty p = ask >>= (\w -> liftX $ withDisplay $ \d -> fmap (fromMaybe 0) $ getAtomProperty d w p)
+
+getAtomProperty :: Display -> Window -> String -> X (Maybe Atom)
+getAtomProperty d w p = do
+ a <- getAtom p
+ md <- io $ getWindowProperty32 d a w
+ return $ fmap fromIntegral $ listToMaybe $ fromMaybe [] md
+
+
myManageHook :: ManageHook
-myManageHook = composeAll
- [ composeOne
- [ className =? "Guake.py" -?> doFloatMaybeFullscreen -- <+> doConfigBorderOff)
- --, className =? "Do" -?> (doFloat <+> doConfigBorderOff)
- , className =? "MPlayer" -?> doCenterFloat
- , className =? "Gimp" -?> doFloat
- , className =? "Display" -?> doFloat
- , className =? "Wine" -?> doFloat
- , isFullscreen -?> doFullscreen
- ]
- , manageHook gnomeConfig
- ]
+myManageHook = do
+ atom__NET_WM_WINDOW_TYPE_DIALOG <- liftX $ getAtom "_NET_WM_WINDOW_TYPE_DIALOG"
+ composeAll
+ [ composeOne
+ [ atomProperty "_NET_WM_WINDOW_TYPE" =? atom__NET_WM_WINDOW_TYPE_DIALOG -?> doFloat
+ , className =? "Guake.py" -?> doFloatMaybeFullscreen -- <+> doConfigBorderOff)
+ --, className =? "Do" -?> (doFloat <+> doConfigBorderOff)
+ , className =? "MPlayer" -?> doCenterFloat
+ , className =? "Gimp" -?> doFloat
+ , className =? "Display" -?> doFloat
+ , className =? "Wine" -?> doFloat
+ , className =? "Pcsx2" -?> doFloat
+ , stringProperty "WM_ICON_NAME" =? "ZeroGS" -?> doFloat
+ , isFullscreen -?> doFullscreen
+ ]
+ , manageHook gnomeConfig
+ ]
myLayoutHook = manageFullscreen $ smartBorders (Full ||| tiled ||| Mirror tiled)