Thank you Tycho,

I looked into it, and it seems like, it is useless in my case. Indeed, ev's 
values don't change between a screen plugging and a screen configuration 
(beside the timestamps and sequence ofc).
It's really too bad because I feel like the screen_change hook isn't really 
all that powerful without this information. For exemple if we tell qtile to 
restart on screen_change but have a script that automatically setup the 
monitors when a new one is plugged, then we enter a non-ending cycle of 
qtile restarting...

But yeah, that's life. I guess we'll continue using the pyudev technique 
for now. It's just that I've had a lot of troubles and inconsistency with 
it.
Anyway, thanks for your help!

Cheers,

Bruno (Sweenu)

On Thursday, November 16, 2017 at 6:44:56 PM UTC+1, Tycho Andersen wrote:
>
> Hey Bruny, 
>
> On Wed, Nov 15, 2017 at 11:20:00PM -0800, Bruno Inec wrote: 
> > I have a very hard time finding the use of ev in: 
> > 
> > @libqtile.hook.subscribe.screen_change 
> > def restart_on_randr(qtile, ev): 
> >     qtile.cmd_restart() 
> > 
> > 
> > I'd like to know when it's just a screen plugged or if it is a change in 
> > the configuration through randr. 
> > Is it possbile to do so with the 'ev' argument? 
>
> Probably, but you'd have to do more digging than I have time for at 
> the moment. 'ev' is a ScreenChangeNotifyEvent object, 
>
>         <event name="ScreenChangeNotify" number="0"> 
>                 <field type="CARD8" name="rotation" mask="Rotation" /> 
>                 <field type="TIMESTAMP" name="timestamp" /> 
>                 <field type="TIMESTAMP" name="config_timestamp" /> 
>                 <field type="WINDOW" name="root" /> 
>                 <field type="WINDOW" name="request_window" /> 
>                 <field type="CARD16" name="sizeID" /> 
>                 <field type="CARD16" name="subpixel_order" enum="SubPixel" 
> /> 
>                 <field type="CARD16" name="width" /> 
>                 <field type="CARD16" name="height" /> 
>                 <field type="CARD16" name="mwidth" /> 
>                 <field type="CARD16" name="mheight" /> 
>         </event> 
>
> I guess looking at some properties of the root window combined with 
> the width/height you'll be able to figure this out. 
>
> Cheers, 
>
> Tycho 
>
> > Thank you! 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups "qtile-dev" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an email to [email protected] <javascript:>. 
> > For more options, visit https://groups.google.com/d/optout. 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"qtile-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to