From 0175e021022599c507d361d48364b3a4dcc95503 Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Thu, 3 Feb 2011 21:39:43 +0100 Subject: More XPROPS for the xmobar exec --- NEWS | 3 +++ src/Xmobar.hs | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/NEWS b/NEWS index 2166cfd..4ff68b4 100644 --- a/NEWS +++ b/NEWS @@ -7,6 +7,8 @@ _New features_ - New `Volume` monitor displaying ALSA soundcards information, by Thomas Tuegel. + - xmobar app new has WM_CLASS, WM_NAME and _NET_WM_PID xprops + ([issue 38]). _Incompatible changes_ @@ -31,6 +33,7 @@ _Bug fixes_ [issue 28]: http://code.google.com/p/xmobar/issues/detail?id=28 [issue 30]: http://code.google.com/p/xmobar/issues/detail?id=30 [issue 36]: http://code.google.com/p/xmobar/issues/detail?id=36 +[issue 38]: http://code.google.com/p/xmobar/issues/detail?id=38 ## Version 0.12 (Dec 24, 2010) diff --git a/src/Xmobar.hs b/src/Xmobar.hs index 15abca3..cf912b7 100644 --- a/src/Xmobar.hs +++ b/src/Xmobar.hs @@ -42,6 +42,7 @@ import Control.Exception hiding (handle) import Data.Bits import Data.Maybe(fromMaybe) import Data.Typeable (Typeable) +import System.Posix.Process (getProcessID) import Config import Parsers @@ -181,10 +182,17 @@ setProperties r c d w srs = do a2 <- internAtom d "_NET_WM_WINDOW_TYPE" False c2 <- internAtom d "ATOM" False v <- internAtom d "_NET_WM_WINDOW_TYPE_DOCK" False + p <- internAtom d "_NET_WM_PID" False + + setTextProperty d w "xmobar" wM_CLASS + setTextProperty d w "xmobar" wM_NAME + changeProperty32 d w a1 c1 propModeReplace $ map fi $ getStrutValues r (position c) (getRootWindowHeight srs) changeProperty32 d w a2 c2 propModeReplace [fromIntegral v] + getProcessID >>= changeProperty32 d w p c1 propModeReplace . return . fromIntegral + getRootWindowHeight :: [Rectangle] -> Int getRootWindowHeight srs = foldr1 max (map getMaxScreenYCoord srs) where -- cgit v1.2.3