From 6f4b75b1a963c35544d9ed89e83a8f5eb89576bd Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Tue, 24 Jan 2017 20:10:25 +0100 Subject: myEventHook: Add updateWindowTitle Run the logHook (to update the window title in the dzen bar) if a property event with a new window title was received. --- xmonad.hs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/xmonad.hs b/xmonad.hs index 546c168..4d56ba1 100644 --- a/xmonad.hs +++ b/xmonad.hs @@ -5,6 +5,7 @@ import Codec.Binary.UTF8.String as UTF8 (decodeString) import Data.Ratio ((%)) import Data.List import qualified Data.Map as M +import Data.Monoid import XMonad import XMonad.Core @@ -359,6 +360,14 @@ myEventHook = <+> serverModeEventHook <+> focusOnMouseMove <+> docksEventHook + <+> updateWindowTitle + where + updateWindowTitle PropertyEvent { ev_window = _, ev_atom = a, ev_propstate = ps } = do + pa <- mapM getAtom ["WM_NAME", "_NET_WM_NAME"] + when (a `elem` pa && ps == propertyNewValue) $ do + ask >>= logHook . config + return (All True) + updateWindowTitle _ = return (All True) myStartupHook = do ewmhDesktopsStartup -- cgit v1.2.3