sargon/trayer-srg

Switching monitors and --edge right

mklinik opened this issue · 6 comments

I'm using trayer like this:
trayer --edge top --align right --SetPartialStrut true --height 14 --widthtype request --alpha 200 --transparent true
I use xrandr to switch between monitors with a different resolution, a laptop screen and a desktop monitor. When switching monitors, trayer stays at the position where it was on the other monitor before. Only when an icon appears or disappears does trayer update its position to the new screen edge.

Is it possible to update trayer's position immediately when switching monitors?

Thanks!

Yeah, AFAIK there are events which notify about changes. But we are not listing to them.
The observed behavior results from the fact that we read the screen values on every update, I think.
Maybe I will be able to have a look into this in the end of the week, but no promises.

jfly commented

I've been working around this by running the following python script every time I run xrandr:

> python2 -c 'import gtk; gtk.StatusIcon()'

It would be great to have trayer listen to the relevant events itself.

Maybe 6c670cf fixes this problem.

Yes it works. When I switch between laptop and desktop monitor now, trayer stays at the right edge of the screen. Awesome, thanks!

Fine. I am going to bump the version soon, so this fix moves into the distro packages.

jfly commented

I can confirm that this works for me now. Thanks!