FVWM: Resizing BarButtons based on display size

Stuart Longland <[email protected]>
Newsgroups gmane.comp.window-managers.fvwm
Message-ID <[email protected]>
Hi all,

This is a bit of a silly question.  I have a FVWM config that's about 10
years old now that I set up to be largely keyboard oriented and maximise
screen real-estate.

For system status and a calendar, I have a BarButtons instance on the
right-hand side of the display which I can call up by hitting Logo, Z.
The problem is every time I've moved to a new machine, I have to edit
the config file to appropriately dimension the panel.

I want the panel to be the full height of the display, minus the height
of the task bar (now, fbpanel; since FVWM have dropped FVWMTaskBar).

Right now I have this:
> DestroyModuleConfig BarButtons: *
> *BarButtons: Fore Black
> *BarButtons: Back #cccccc
> *BarButtons: Font "xft:sans-serif:Bold:pixelsize=10;-*-helvetica-bold-r-*-*-10-*-*-*-*-*-*-*"
> # Geometry - really likes to pick its own size, but giving a position is OK
> # Warning: I've added a size geometry to avoid pbs if the fvwm_icons are
> # not in the image path ! Remove the size in this geometry especially if
> # you add buttons
> #*BarButtons: Geometry 250x568-0+24
> PipeRead "${HOME}/.fvwm/position-barbuttons.sh"

with the script containing this:
> #!/bin/sh
> 
> printf '*BarButtons: Geometry 250x%d-0+24\n' $(( \
> 	$( xdpyinfo | sed -ne \
> 		'/dimensions/ { s/^.*: \+[0-9]\+x\([0-9]\+\) .*$/\1/; p }' ) - 24 ))

This works, but I wonder if there's a more elegant way.  Is it possible
to grab the screen size in the .fvwmrc and do the required arithmetic
for deriving Geometry?

Regards,
-- 
Stuart Longland (aka Redhatter, VK4MSL)

I haven't lost my mind...
  ...it's backed up on a tape somewhere.
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEdxAvshVJ/95eE7g6DH9T9PNZuO8FAlrlKEkACgkQDH9T9PNZ
uO+AQQ/7B2v0q5sQFWIBMNvaO93iViS94Yz1IcbFRJnPaUf/6cCzinOvpqzg8Qo/
ZX28X01eFBUqBGsM4EccN5JQCQFraiUccLLwU4Xm+uKje+XD5KqCeD7rWzhALIjG
Rae05B3LdkCU6f0n7xHrQboDi8Y6yib5QTn+7rhg02xsuyjX8XkAQ4FA6qpsQDZo
mAapPXrP5zXLwrt/SflT7/zffag0ypJZWyfDYi2D4CSKmwxEtj52P8ejy0cG6zIg
Td0+d5mXuM5POPx+VX5kPhDD5NPAD17ZfFHXpJy4bkJ8JNrctI9KdlJW/mLXRdiI
w5te/WM+w3dQmTt7RmiJX5UToBE/0Em7yVUDf8ff6rxDupLl1TQTr+KjO68WtOms
/Pm+vsww5onjb1OSuARD4Wlpf96vAmJQk9GzDXTuNypzAHk7m7pCDbA049rrPQmk
AVXswviXpN/jfxlaYownX8Htew2OAXNsKZjX6O+cvQGq82j5VODdzqLzas5TgDY3
DKykBl9Wsi7ctalpiMY89qA2kWYio3t0VQTCzMCazYw/y2DdMyM8pgz/r5Apin+V
e6sDGt/usLiRJoDt9H34vY5Xt5+bGf9mePZ4R0UUv/yIAadlT/HvumGljh9WXfWZ
5giH/My77ovq84LU9yoUHhrpQcXwLM2IHNaS2MMtRmLx27eKtqc=
=xk0M
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.