summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2011-02-03 21:39:43 +0100
committerJose Antonio Ortega Ruiz <jao@gnu.org>2011-02-03 21:39:43 +0100
commit0175e021022599c507d361d48364b3a4dcc95503 (patch)
treee4e82b660f4441b14360da889643dd5a4a7b1f85
parented50d0cb4b1e46a6fa531e610c0d8025d12a62ae (diff)
downloadxmobar-0175e021022599c507d361d48364b3a4dcc95503.tar.gz
xmobar-0175e021022599c507d361d48364b3a4dcc95503.tar.bz2
More XPROPS for the xmobar exec
-rw-r--r--NEWS3
-rw-r--r--src/Xmobar.hs8
2 files changed, 11 insertions, 0 deletions
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