Button only on displays greater than X px

Hi!

I have in my FvwmButton xosview. This config is also on a live-stick. and i want to show xosview only on displays which are higher than 700px. One computer is an Acer one with an display this is only 600px high…

But i have no idea, how to show or show not this Button…

TEST ($[vg.height] >=700) *FvwmButton: ....

doesn’t work…

scientific

Maybe it has to do with the variable ‘vg.height’ that you are using. For example, this command:

Pick Exec exec xmessage '$[desk.width] - $[desk.height]'

gives me the desk width and height.

Cheers!

Edit: I have looked at the ‘Test’ command, and I am not sure your syntax would be a valid test-condition.

That’s the question… How can i do the right test-command?

cheerio!

If I understand the manual correctly, the relational operators are part of the Version conditional and don’t work with arbitrary expressions. However, I may have found a solution that, albeit in a somewhat roundabout way, does what you want.

  • In your X startup script (typically ~/.xinitrc or ~/.xsession), use xrandr to determine the screen height and set an environment variable accordingly (before starting Fvwm of course!):

TRESHOLD=700 RESULT=`xrandr | head -n 1 | sed -e s/,//g | awk '{print $10}'` # Mind the difference between quotes and backquotes! if [ ${RESULT} -ge ${TRESHOLD} ]; then export FOO=yes else export FOO=no fiNote that xrandr is usually part of one’s X11 distribution/package so it’s usually already there and doesn’t need to be installed separately.

  • In your Fvwm configuration file, use EnvMatch to examine the environment variable:

Test (EnvMatch FOO yes) do_something TestRc (NoMatch) do_something_else

Disclaimer: I haven’t actually tested the above, but you probably get the idea. You may need to tweak the RESULT=… line a bit depending on exactly what the output of xrandr looks like on your system.

HTH

Oh thanks!!!

Sounds a good way. I’ll try it in the next few days. And of cource… i will report the result. :slight_smile:

scientific