announce: XMonad.Util.WindowProperties

Just pushed new module: XMonad.Util.WindowProperties. This module allows to specify window properties, such as title, classname or resource, and to check them. In contrast to ManageHook properties, these are instances of Show and Read, so they can be used in layout definitions etc. It was a part of IM layout before, and now I hope it will help Braden with his PlainConfig. -- Roman I. Cheplyaka (aka Feuerbach @ IRC)

On 2008.03.18 20:54:32 +0200, Roman Cheplyaka
Just pushed new module: XMonad.Util.WindowProperties.
This module allows to specify window properties, such as title, classname or resource, and to check them. In contrast to ManageHook properties, these are instances of Show and Read, so they can be used in layout definitions etc.
It was a part of IM layout before, and now I hope it will help Braden with his PlainConfig.
-- Roman I. Cheplyaka (aka Feuerbach @ IRC)
Is this module intended to also eventually include setters of window properties? (I only see getters.) -- gwern enigma main Warfare DREC Intiso cards kilderkin Crypto Waihopai Oscor

* gwern0@gmail.com
On 2008.03.18 20:54:32 +0200, Roman Cheplyaka
scribbled 1.4K characters: Just pushed new module: XMonad.Util.WindowProperties.
This module allows to specify window properties, such as title, classname or resource, and to check them. In contrast to ManageHook properties, these are instances of Show and Read, so they can be used in layout definitions etc.
It was a part of IM layout before, and now I hope it will help Braden with his PlainConfig.
-- Roman I. Cheplyaka (aka Feuerbach @ IRC)
Is this module intended to also eventually include setters of window properties? (I only see getters.)
It isn't. Actually, I hear such idea for the first time. How do you see it? -- Roman I. Cheplyaka (aka Feuerbach @ IRC)

On 2008.03.19 22:31:02 +0200, Roman Cheplyaka
* gwern0@gmail.com
[2008-03-19 16:26:07-0400] On 2008.03.18 20:54:32 +0200, Roman Cheplyaka
scribbled 1.4K characters: Just pushed new module: XMonad.Util.WindowProperties.
This module allows to specify window properties, such as title, classname or resource, and to check them. In contrast to ManageHook properties, these are instances of Show and Read, so they can be used in layout definitions etc.
It was a part of IM layout before, and now I hope it will help Braden with his PlainConfig.
-- Roman I. Cheplyaka (aka Feuerbach @ IRC)
Is this module intended to also eventually include setters of window properties? (I only see getters.)
It isn't. Actually, I hear such idea for the first time. How do you see it?
-- Roman I. Cheplyaka (aka Feuerbach @ IRC)
Well, I was musing that there could be situations in which rewriting window properties on the fly could be useful. For example, you've seen my runOrRaise stuff? It doesn't work if, say, Emacs is inside a terminal. To solve this you would hypothetically write 'bind m "setWindowClass 'Emacs'"' (if you follow my pseudo-code). And who knows what other stuff you could do. For example, if you're allowed to create new window properties on a window, you could implement a per app copy-paste system! -- gwern 52 GSS SHA DDPS Amn SSCI warfare Exon Pesec High

On 19/03/2008, gwern0@gmail.com
On 2008.03.19 22:31:02 +0200, Roman Cheplyaka
scribbled 1.8K characters: * gwern0@gmail.com
[2008-03-19 16:26:07-0400] On 2008.03.18 20:54:32 +0200, Roman Cheplyaka
scribbled 1.4K characters: Just pushed new module: XMonad.Util.WindowProperties.
This module allows to specify window properties, such as title, classname or resource, and to check them. In contrast to ManageHook properties, these are instances of Show and Read, so they can be used in layout definitions etc.
It was a part of IM layout before, and now I hope it will help Braden with his PlainConfig.
-- Roman I. Cheplyaka (aka Feuerbach @ IRC)
Is this module intended to also eventually include setters of window properties? (I only see getters.)
It isn't. Actually, I hear such idea for the first time. How do you see it?
-- Roman I. Cheplyaka (aka Feuerbach @ IRC)
Well, I was musing that there could be situations in which rewriting window properties on the fly could be useful. For example, you've seen my runOrRaise stuff? It doesn't work if, say, Emacs is inside a terminal. To solve this you would hypothetically write 'bind m "setWindowClass 'Emacs'"' (if you follow my pseudo-code). And who knows what other stuff you could do. For example, if you're allowed to create new window properties on a window, you could implement a per app copy-paste system!
But not all hints are settable -- for instance, whilst a WM_TITLE hint is, there is no guarantee that it is to remain valid during the application's lifetime (i.e., the application can rewrite it at any time - *cough* firefox). Then there are those hints such as WM_CLASS which are only settable before the window is mapped (i.e., in the WithDrawn state). Using xprop under the hood should allow you to realise this in part. But compliance with the ICCCM here is paramount. -- Thomas Adam

On Wed, Mar 19, 2008 at 05:47:59PM -0400, gwern0@gmail.com wrote:
On 2008.03.19 22:31:02 +0200, Roman Cheplyaka
scribbled 1.8K characters: * gwern0@gmail.com
[2008-03-19 16:26:07-0400] On 2008.03.18 20:54:32 +0200, Roman Cheplyaka
scribbled 1.4K characters: Just pushed new module: XMonad.Util.WindowProperties.
This module allows to specify window properties, such as title, classname or resource, and to check them. In contrast to ManageHook properties, these are instances of Show and Read, so they can be used in layout definitions etc.
It was a part of IM layout before, and now I hope it will help Braden with his PlainConfig.
-- Roman I. Cheplyaka (aka Feuerbach @ IRC)
Is this module intended to also eventually include setters of window properties? (I only see getters.)
It isn't. Actually, I hear such idea for the first time. How do you see it?
-- Roman I. Cheplyaka (aka Feuerbach @ IRC)
Well, I was musing that there could be situations in which rewriting window properties on the fly could be useful. For example, you've seen my runOrRaise stuff? It doesn't work if, say, Emacs is inside a terminal. To solve this you would hypothetically write 'bind m "setWindowClass 'Emacs'"' (if you follow my pseudo-code). And who knows what other stuff you could do. For example, if you're allowed to create new window properties on a window, you could implement a per app copy-paste system!
-- gwern 52 GSS SHA DDPS Amn SSCI warfare Exon Pesec High
xmonad shouldn't be altering these properties -- have you seen the flags for urxvt and xterm to set the class and resource name? Cheers, Spencer Janssen

On 2008.03.23 00:15:09 -0400, Spencer Janssen
xmonad shouldn't be altering these properties -- have you seen the flags for urxvt and xterm to set the class and resource name?
Cheers, Spencer Janssen
Why shouldn't it? But I think this objection is kind of missing the point. Sure, maybe I could solve my Emacs example - if my terminal supports those options, and if I can communicate out to it, and if my needs are solely limited to those options. With that sort of logic, why do we allow xmonad.hs to do arbitrary things instead of providing a crippled config language which we can prove all sorts of nice properties about, why do Free licenses allow for any kind of use (instead of, say, forbidding military use), and so on. If one could 'annotate' a window on the fly with arbitrary fields and data, that opens up possibilities that were not there before. My copy-paste suggestion was just a simple suggestion. I am sure XMonaders could come up with other things. I like the idea of setting properties as a way to store per-window data for extensions since it's 'outside' XMonad and so other things could use it, but if anyone knows of any way to do it as an extension in XMonad but which doesn't touch the core's data-structures, I'd be interested to hear it. -- gwern World IWIS Terrorism EO chameleon Bubba r00t Z-150T W3 MOD

On 26/03/2008, gwern0@gmail.com
I like the idea of setting properties as a way to store per-window data for extensions since it's 'outside' XMonad and so other things could use it, but if anyone knows of any way to do it as an extension in XMonad but which doesn't touch the core's data-structures, I'd be interested to hear it.
It depends what you're on about. These xatoms are nothing more than hints for interoperability. Setting some of them is allowed (such as WM_NAME) but settings others (such as WM_CLASS) is not -- and in the case of WM_CLASS is only allowed to happen by the client when it's in the WithDrawn state. You can't arbitrarily make up or assign random bits of data to windows to "tag" them in some way, that's not how it works. Confer with xprop(1) for examples. -- Thomas Adam

On Mar 25, 2008, at 20:08 , gwern0@gmail.com wrote:
On 2008.03.23 00:15:09 -0400, Spencer Janssen
scribbled 1.8K characters: xmonad shouldn't be altering these properties -- have you seen the flags for urxvt and xterm to set the class and resource name?
Cheers, Spencer Janssen
Why shouldn't it?
Almost arbitrary properties, sure. Changing WM_NAME / WM_CLASS / WM_WINDOW_ROLE violates the ICCCM. -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH

On 2008.03.25 20:34:57 -0400, "Brandon S. Allbery KF8NH"
On Mar 25, 2008, at 20:08 , gwern0@gmail.com wrote:
On 2008.03.23 00:15:09 -0400, Spencer Janssen
scribbled 1.8K characters: xmonad shouldn't be altering these properties -- have you seen the flags for urxvt and xterm to set the class and resource name?
Cheers, Spencer Janssen
Why shouldn't it?
Almost arbitrary properties, sure. Changing WM_NAME / WM_CLASS / WM_WINDOW_ROLE violates the ICCCM.
-- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@kf8nh.com
Oh. I misunderstood Spencer then - I thought he was saying XMonad shouldn't be altering any properties, not that there were standards-related reasons XMonad shouldn't be alternating two specific properties. -- gwern Cohiba .tc LEETAC Abdurahmon SUR Manfurov basement CCSC national sweep
participants (5)
-
Brandon S. Allbery KF8NH
-
gwern0@gmail.com
-
Roman Cheplyaka
-
Spencer Janssen
-
Thomas Adam