How to force swallowed app/module to top of FvwmButton area

Basic FVWM questions can be asked here.
User avatar
just_jed
Kitten
Kitten
Posts: 8
Joined: Sun Jan 28, 2018 9:31 pm
Location: DM79MO

How to force swallowed app/module to top of FvwmButton area

Postby just_jed » Mon Jan 29, 2018 3:08 am

I use FvwmButtons to implement a taskbar. In two cases, the swallowed program or module is placed in the center of the button area, and I would like to force it's location to either the top or bottom.

In the first case,

Code: Select all

*FvwmButtons: (2x19 Swallow FvwmIconMan FvwmIconMan)

FvwmIconMan displays in the center, vertically, of that area, and as it grows, it exands in both directions, so that it always stays centered. I would like for it to display at the top, i.e. directly below the button above it, and grow downward. Looking at the man pages, I don't see anything to influence this -- perhaps I'm missing it. I'm thinking something that would function similarly to the 'gravity' specification of stalonetray. The ManagerGeometry option of FvwmIconMan doesn't seem operative here, at least in terms of placement within the button area.

The second case is almost the same, except it involves swallowing stalonetray, which doesn't grow. But it still displays in the center of its button area, rather than directly below the button above it. I'd like for it to end up either at the top or bottom of it's button area.

FWIW, here's the whole 'sidebar' config I'm using:

Code: Select all

DeskTopSize 1x4
*FvwmPagerBack #8f877f
*FvwmPagerFore black
*FvwmPagerHilight #8f917f
*FvwmPagerGeometry 55x165
*FvwmPagerLabel 0 robinson

*FvwmIconMan: numManagers   1
*FvwmIconMan: Resolution      desk
*FvwmIconMan: background       #cfc3b8
*FvwmIconMan: foreground      black
*FvwmIconMan: usewinlist      true
*FvwmIconMan: drawicons      true
*FvwmIconMan: shape         true
*FvwmIconMan: followfocus      true
*FvwmIconMan: sort         name
*FvwmIconMan: plainbutton      up black #bdbbaa
*FvwmIconMan: focusbutton      up black #a3a693
*FvwmIconMan: selectbutton      up black #e8dbce
*FvwmIconMan: iconbutton      up black #cfc3b8
*FvwmIconMan: buttongeometry    72x0
*FvwmIconMan: managergeometry   1x0
*FvwmIconMan: dontshow          FvwmButtons
*FvwmIconMan: format                "%c"
*FvwmIconMan*action             Mouse 0 a, sendcommand iconify
*FvwmIconMan*action             Mouse 2 n, sendcommand delete

###################### button-bar ################################

*FvwmButtons: Fore Black
*FvwmButtons: Back #cfc3b8
*FvwmButtons: Font xft:DejaVu Sans:Medium:Book:size=9
*FvwmButtons: Geometry 72x$[vp.height]-0+0
*FvwmButtons: Columns 2
*FvwmButtons: Frame 1

*FvwmButtons: (2x1 Title xterm \
  Action Exec konsole \
)
#*FvwmButtons: (2x1 Title sylpheed \
#  Action Exec sylpheed \
#)

*FvwmButtons: (2x19 Swallow FvwmIconMan FvwmIconMan)
*FvwmButtons: (2x7 Swallow FvwmPager 'FvwmPager 0 0')
*FvwmButtons: (2x5, Frame 0, Swallow (NoClose,UseOld) stalonetray 'exec stalonetray --kludges force_icons_size')
*FvwmButtons: (2x1 Swallow xclock 'exec /usr/bin/xclock -d -brief -bg DarkSlateGray -fg LightGoldenrod -geometry 60x20 -fn -*-clean-*-r-*-*-13-*-*-*-*-*-*-* ')
*FvwmButtons: (icon lock.png, Action Exec xscreensaver-command -lock)
*FvwmButtons: (icon red_x.png, Action Menu Exit-Fvwm)
Last edited by just_jed on Thu Feb 08, 2018 6:46 pm, edited 2 times in total.
Any sufficiently advanced technology is indistinguishable from a yo-yo
-- Enoch root

somiaj
Administrator
Administrator
Posts: 56
Joined: Mon Nov 08, 2004 9:54 pm
Location: Idaho (USA)
Contact:

Re: How to force swallowed app/module to top of FvwmButton area

Postby somiaj » Sun Feb 04, 2018 7:22 pm

There are multiple approaches.

First for something fixed like stalonetray. Make the button the size you want the tray to be, then just use blank buttons for padding. This way you can completely control where it appears in your FvwmButtons layout.

For something that is dynamic like FvwmIconMan, you have two basic approaches. One is make FvwmIconMan a fixed size, and then configure FvwmIconMan to put all the Icons at the top (or right), and let FvwmIconMan figure out how to place things within its button.

The other option is to let FvwmIconMan be variable size, then use the "Top" (or other alignment flags) to position it inside the button. The problem with this approach (over the fixed size FvwmIconMan), is the FvwmIconMan module can grow outside of its button confinement if you have too many windows. For example in the default-config the RightPanel is something like

http://fvwmforums.org/wiki/Panels/RightPanel/

Here you will see an example of the second method, I mentioned. Here is the code that swallows FvwmIconMan in that example

Code: Select all

*RightPanel: (120x515, Top, Swallow FvwmIconMan 'Module FvwmIconMan', Frame 0)


Though as I said, there is a bug with this approach, if one opens up too many windows FvwmIconMan will grow outside its button.
-jaimos

User avatar
just_jed
Kitten
Kitten
Posts: 8
Joined: Sun Jan 28, 2018 9:31 pm
Location: DM79MO

Re: How to force swallowed app/module to top of FvwmButton area

Postby just_jed » Thu Feb 08, 2018 7:24 pm

somiaj wrote:The other option is to ... use the "Top"


Thank you. I figured there was something obvious that I had missed. That is exactly what I needed, and works for both of my cases.

In re. the Wiki sidebar example, I see the approach there, which is to make each "button" the size of a pixel, and then explicitly specify each functional button by a pixel size. I'm pretty sure I pondered this, back in the 90's, and dismissed it as excessively tedious. :) I acknowledge that it does provide high flexibility.

In re. the statement that:
Since Fvwm can’t do math directly ...

I'm sure there are instances where that applies. I use $[vp.height] for the geometry, and FvwmButtons seems entirely capable of computing the height of each button as height divided by number of buttons, and I like that, as it frees me from having to do it. Plus, I can resize my screen and restart, and I don't have to mess with things (particularly important when inside VirtualBox). And, I can move my config to other machines without issues.

I like the SensorDock example. I think I'll have to steal from it. :D
Any sufficiently advanced technology is indistinguishable from a yo-yo
-- Enoch root


Return to “Basic questions”

Who is online

Users browsing this forum: No registered users and 1 guest