Regexp WM_NAME ?

In pentadactyl (a firefox addon) you can write in an external editor instead a textbox, by default it spawns a gvim window and everytime it opens a pentadactyl.txt in tmp folder. Imho that behaviour is way more easier writing on a floating window. Using xprop I found the WM_NAME it's the only variable that doesn't change, so I thought that using it in my myManageHook would do it. $ xprop | grep 'WM_NAME' WM_NAME(STRING) = "pentadactyl.txt (/tmp) - GVIM" myManageHook = (composeAll , concat $ [ , [ className =? "stalonetray" --> doIgnore] -- a lot of output removed -- , [ title =? "pentadactyl.txt (/tmp) - GVIM" --> doFloat] ] I restarted xmonad, reopened the editor and I found that it doesn't work, I tried to check wm_name again, and guess what? WM_NAME(STRING) = "pentadactyl.txt (/tmp) - GVIM1" Obviously the last part "GVIM" changes all the time, so I can't know in advance which is gonna pick. There's some way to regexp the wm_name part? Until now, I couldn't find anything about this topic :( Regards, -- Pablo Olmos de Aguilera Corradini - @PaBLoX http://www.glatelier.org/ http://about.me/pablox/ http://www.linkedin.com/in/pablooda/ Linux User: #456971 - http://counter.li.org/

Lift whatever string-match or regexp function you need to the monad?
For example, it looks like you could match isInfixOf on (/tmp); here's
an existing example
q ~? x = fmap (x `isInfixOf`) q
myManageHook = (composeAll . concat $ --shifting actions
[ [ title =? x --> doCenterFloatToAll | x <- important ]
....
, [ className =? "Skype" <&&> title ~? "Call with " -?>
doSideFloat' CE ]
On Sun, May 13, 2012 at 12:33 PM, Pablo Olmos de Aguilera C.
In pentadactyl (a firefox addon) you can write in an external editor instead a textbox, by default it spawns a gvim window and everytime it opens a pentadactyl.txt in tmp folder. Imho that behaviour is way more easier writing on a floating window.
Using xprop I found the WM_NAME it's the only variable that doesn't change, so I thought that using it in my myManageHook would do it.
$ xprop | grep 'WM_NAME' WM_NAME(STRING) = "pentadactyl.txt (/tmp) - GVIM"
myManageHook = (composeAll , concat $ [ , [ className =? "stalonetray" --> doIgnore] -- a lot of output removed -- , [ title =? "pentadactyl.txt (/tmp) - GVIM" --> doFloat] ]
I restarted xmonad, reopened the editor and I found that it doesn't work, I tried to check wm_name again, and guess what?
WM_NAME(STRING) = "pentadactyl.txt (/tmp) - GVIM1"
Obviously the last part "GVIM" changes all the time, so I can't know in advance which is gonna pick.
There's some way to regexp the wm_name part? Until now, I couldn't find anything about this topic :(
Regards, -- Pablo Olmos de Aguilera Corradini - @PaBLoX http://www.glatelier.org/ http://about.me/pablox/ http://www.linkedin.com/in/pablooda/ Linux User: #456971 - http://counter.li.org/
_______________________________________________ xmonad mailing list xmonad@haskell.org http://www.haskell.org/mailman/listinfo/xmonad
-- gwern http://www.gwern.net

On 13 May 2012 12:37, Gwern Branwen
Lift whatever string-match or regexp function you need to the monad? For example, it looks like you could match isInfixOf on (/tmp); here's an existing example
q ~? x = fmap (x `isInfixOf`) q
myManageHook = (composeAll . concat $ --shifting actions [ [ title =? x --> doCenterFloatToAll | x <- important ] .... , [ className =? "Skype" <&&> title ~? "Call with " -?> doSideFloat' CE ]
Is the previous code right? I'm seeing an only single quote. Overall, I don't understand the example... what it has to do the first line with the last one? I'm sorry, I'm just starting to learn haskell to configure my xmonad.hs.
On Sun, May 13, 2012 at 12:33 PM, Pablo Olmos de Aguilera C.
wrote: In pentadactyl (a firefox addon) you can write in an external editor instead a textbox, by default it spawns a gvim window and everytime it opens a pentadactyl.txt in tmp folder. Imho that behaviour is way more easier writing on a floating window.
Using xprop I found the WM_NAME it's the only variable that doesn't change, so I thought that using it in my myManageHook would do it.
$ xprop | grep 'WM_NAME' WM_NAME(STRING) = "pentadactyl.txt (/tmp) - GVIM"
myManageHook = (composeAll , concat $ [ , [ className =? "stalonetray" --> doIgnore] -- a lot of output removed -- , [ title =? "pentadactyl.txt (/tmp) - GVIM" --> doFloat] ]
I restarted xmonad, reopened the editor and I found that it doesn't work, I tried to check wm_name again, and guess what?
WM_NAME(STRING) = "pentadactyl.txt (/tmp) - GVIM1"
Obviously the last part "GVIM" changes all the time, so I can't know in advance which is gonna pick.
There's some way to regexp the wm_name part? Until now, I couldn't find anything about this topic :(
Regards, -- Pablo Olmos de Aguilera Corradini - @PaBLoX http://www.glatelier.org/ http://about.me/pablox/ http://www.linkedin.com/in/pablooda/ Linux User: #456971 - http://counter.li.org/
_______________________________________________ xmonad mailing list xmonad@haskell.org http://www.haskell.org/mailman/listinfo/xmonad
-- gwern http://www.gwern.net
-- Pablo Olmos de Aguilera Corradini - @PaBLoX http://www.glatelier.org/ http://about.me/pablox/ http://www.linkedin.com/in/pablooda/ Linux User: #456971 - http://counter.li.org/

On Sun, May 13, 2012 at 1:15 PM, Pablo Olmos de Aguilera C. < pablo@glatelier.org> wrote:
On 13 May 2012 12:37, Gwern Branwen
wrote: q ~? x = fmap (x `isInfixOf`) q
myManageHook = (composeAll . concat $ --shifting actions [ [ title =? x --> doCenterFloatToAll | x <- important ] .... , [ className =? "Skype" <&&> title ~? "Call with " -?> doSideFloat' CE ]
Is the previous code right? I'm seeing an only single quote.
It's a backquote, and yes, there are two of them, surrounding "isInfixOf".
Overall, I don't understand the example... what it has to do the first line with the last one?
The first one defined an operator (~?); the second showed how to use it. -- brandon s allbery allbery.b@gmail.com wandering unix systems administrator (available) (412) 475-9364 vm/sms

On 13 May 2012 13:43, Brandon Allbery
On Sun, May 13, 2012 at 1:15 PM, Pablo Olmos de Aguilera C.
wrote: On 13 May 2012 12:37, Gwern Branwen
wrote: q ~? x = fmap (x `isInfixOf`) q
myManageHook = (composeAll . concat $ --shifting actions [ [ title =? x --> doCenterFloatToAll | x <- important ] .... , [ className =? "Skype" <&&> title ~? "Call with " -?> doSideFloat' CE ]
Is the previous code right? I'm seeing an only single quote.
It's a backquote, and yes, there are two of them, surrounding "isInfixOf".
Yep, I can see that... I was asking for the quote after doSideFloat in the last line: ..."Call with " -?> doSideFloat' CE ]
Overall, I don't understand the example... what it has to do the first line with the last one?
The first one defined an operator (~?); the second showed how to use it.
Thanks, the "-?>" I guess it's another operator? I'm still trying to get used to haskell... way different about from what I used too. Regards, -- Pablo Olmos de Aguilera Corradini - @PaBLoX http://www.glatelier.org/ http://about.me/pablox/ http://www.linkedin.com/in/pablooda/ Linux User: #456971 - http://counter.li.org/

On Sun, May 13, 2012 at 4:48 PM, Pablo Olmos de Aguilera C. < pablo@glatelier.org> wrote:
Yep, I can see that... I was asking for the quote after doSideFloat in the last line:
..."Call with " -?> doSideFloat' CE ]
Oh. That's not behaving as a quote; it's behaving as a "prime" (following mathematical conventions). Within an identifier (that is, not as the first character) single quotes are part of the identifier. So you can have names like doSideFloat' a'b'c y''' (that's 3 primes)
The first one defined an operator (~?); the second showed how to use it.
Thanks, the "-?>" I guess it's another operator?
Yes, it's defined in XMonad.Hooks.ManageHelpers. http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Hooks-ManageHelpers.html...
I'm still trying to get used to haskell... way different about from what I used too.
Unless you have previous experience with an ML-family functional language, yes. -- brandon s allbery allbery.b@gmail.com wandering unix systems administrator (available) (412) 475-9364 vm/sms

On 13 May 2012 16:59, Brandon Allbery
On Sun, May 13, 2012 at 4:48 PM, Pablo Olmos de Aguilera C.
wrote: Yep, I can see that... I was asking for the quote after doSideFloat in the last line:
..."Call with " -?> doSideFloat' CE ]
Oh. That's not behaving as a quote; it's behaving as a "prime" (following mathematical conventions). Within an identifier (that is, not as the first character) single quotes are part of the identifier. So you can have names like
doSideFloat' a'b'c y''' (that's 3 primes)
Hahaha, another surprise :P.
The first one defined an operator (~?); the second showed how to use it.
Thanks, the "-?>" I guess it's another operator?
Yes, it's defined in XMonad.Hooks.ManageHelpers.
http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Hooks-ManageHelpers.html...
Thanks! I'm going to read the documentation.
I'm still trying to get used to haskell... way different about from what I used too.
Unless you have previous experience with an ML-family functional language, yes.
Thanks again for your help :). I just found Real World Haskell which until now looks waay more easy to read that 'Gentle introduction to haskell', which by the way of "gentle" has nothing. Can you suggest any other reference to someone that has some background working with web technologies, ruby and some python? Saludos! -- Pablo Olmos de Aguilera Corradini - @PaBLoX http://www.glatelier.org/ http://about.me/pablox/ http://www.linkedin.com/in/pablooda/ Linux User: #456971 - http://counter.li.org/
participants (3)
-
Brandon Allbery
-
Gwern Branwen
-
Pablo Olmos de Aguilera C.