mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-08-13 19:25:52 -07:00
scripts/xmonadpropread: Print current property value at start
It was only printed after the first change.
This commit is contained in:
@@ -37,13 +37,17 @@ main = do
|
|||||||
root <- rootWindow d (defaultScreen d)
|
root <- rootWindow d (defaultScreen d)
|
||||||
selectInput d root propertyChangeMask
|
selectInput d root propertyChangeMask
|
||||||
|
|
||||||
|
let printProp = do
|
||||||
|
mwp <- getWindowProperty8 d xlog root
|
||||||
|
maybe (return ()) (putStrLn . decodeCChar) mwp
|
||||||
|
|
||||||
|
printProp
|
||||||
|
|
||||||
allocaXEvent $ \ep -> forever $ do
|
allocaXEvent $ \ep -> forever $ do
|
||||||
nextEvent d ep
|
nextEvent d ep
|
||||||
e <- getEvent ep
|
e <- getEvent ep
|
||||||
case e of
|
case e of
|
||||||
PropertyEvent { ev_atom = a } | a == xlog -> do
|
PropertyEvent { ev_atom = a } | a == xlog -> printProp
|
||||||
mwp <- getWindowProperty8 d xlog root
|
|
||||||
maybe (return ()) (putStrLn . decodeCChar) mwp
|
|
||||||
_ -> return ()
|
_ -> return ()
|
||||||
|
|
||||||
decodeCChar :: [CChar] -> String
|
decodeCChar :: [CChar] -> String
|
||||||
|
Reference in New Issue
Block a user