summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander.sulfrian@fu-berlin.de>2017-01-24 20:10:25 +0100
committerAlexander Sulfrian <alexander.sulfrian@fu-berlin.de>2017-01-24 20:13:16 +0100
commit6f4b75b1a963c35544d9ed89e83a8f5eb89576bd (patch)
tree780d093533294c0c3e903bdbfff2798fd0853ffe
parent7d30b7377578266576d7f25360b6b71776d7d9a7 (diff)
downloadxmonad-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.hs9
1 files changed, 9 insertions, 0 deletions
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