diff options
author | Alexander Sulfrian <alexander.sulfrian@fu-berlin.de> | 2017-01-24 20:10:25 +0100 |
---|---|---|
committer | Alexander Sulfrian <alexander.sulfrian@fu-berlin.de> | 2017-01-24 20:13:16 +0100 |
commit | 6f4b75b1a963c35544d9ed89e83a8f5eb89576bd (patch) | |
tree | 780d093533294c0c3e903bdbfff2798fd0853ffe | |
parent | 7d30b7377578266576d7f25360b6b71776d7d9a7 (diff) | |
download | xmonad-config-6f4b75b1a963c35544d9ed89e83a8f5eb89576bd.tar.gz xmonad-config-6f4b75b1a963c35544d9ed89e83a8f5eb89576bd.tar.xz xmonad-config-6f4b75b1a963c35544d9ed89e83a8f5eb89576bd.zip |
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.
-rw-r--r-- | xmonad.hs | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -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 |