aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Main.hs20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/Main.hs b/src/Main.hs
index 6166518..507bd43 100644
--- a/src/Main.hs
+++ b/src/Main.hs
@@ -57,7 +57,7 @@ import XMonad
title,
withWindowSet,
(-->),
- (=?),
+ (=?), mouseDrag, refresh, modify, XState (dragging),
)
import qualified XMonad as X (xmonad)
import XMonad.Hooks.DynamicProperty (dynamicTitle)
@@ -65,6 +65,8 @@ import XMonad.Hooks.EwmhDesktops (ewmh)
import XMonad.Hooks.ManageDocks (docks)
import XMonad.Hooks.ManageHelpers (doFullFloat, isFullscreen)
import XMonad.Layout.Fullscreen (fullscreenEventHook)
+import Data.List (isPrefixOf)
+import Rahm.Desktop.Keys.Wml (wmlLogHook)
main = do
logHook <- xMobarLogHook
@@ -107,7 +109,8 @@ main = do
title =? "gxmessage" --> doCenterFloat,
title =? "Volume Control" --> doCenterFloat,
className =? "mpv" --> doFloat,
- className =? "gnubby_ssh_prompt" --> doFloat
+ className =? "gnubby_ssh_prompt" --> doFloat,
+ shouldChromeFloat --> doFloat
],
-- This config uses dynamic workspaces, but I have to seed XMonad
-- with something. However, this configuration only supports 36
@@ -126,9 +129,20 @@ main = do
],
focusFollowsMouse = False,
clickJustFocuses = False,
- logHook = logHook xmobar
+ logHook = wmlLogHook >> logHook xmobar
}
+-- Should the chrome window float? Returns false if the window's title starts
+-- with "New Tab" because this usually means a new window was launched. If the
+-- window name does not start with "New Tab", it is likely the tab was torn out
+-- of the browser. These windows should float to avoid screwing with tiling.
+shouldChromeFloat :: Query Bool
+shouldChromeFloat = do
+ className <- className
+ title <- title
+ return $
+ className == "Google-chrome" && not ("New Tab" `isPrefixOf` title)
+
changeHook :: Location -> Location -> X ()
changeHook l1 l2 =
logs Info "Change %s -> %s" (show l1) (show l2)