summaryrefslogtreecommitdiffhomepage
path: root/src
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 /src
parented50d0cb4b1e46a6fa531e610c0d8025d12a62ae (diff)
downloadxmobar-0175e021022599c507d361d48364b3a4dcc95503.tar.gz
xmobar-0175e021022599c507d361d48364b3a4dcc95503.tar.bz2
More XPROPS for the xmobar exec
Diffstat (limited to 'src')
-rw-r--r--src/Xmobar.hs8
1 files changed, 8 insertions, 0 deletions
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