...making Linux just a little more fun!

<-- 2c Tips | TAG Index | 1 | 2 | 3 | 4 | Knowledge Base | News Bytes -->

The Answer Gang

By Jim Dennis, Karl-Heinz Herrmann, Breen, Chris, and... (meet the Gang) ... the Editors of Linux Gazette... and You!



(?) Mixing Fvwm with applets

From John Karns

Answered By: Thomas Adam, Heather Stern

Hey, another fvwm user! BAC, Thomas, have you experimented with running windowmaker applets under fvwm? I really like a lot of the applets WM offers, (e.g., wmmount), but can't seem to get it to work inside of the fvwmbutton module.

(!) [Thomas] Yes, I have. If you're running them from within FvwmButtons, that puts a slightly yet subtle slant on how things are done, since you'll have to ensure that a few conditions are set.

(?) That seems a much better way than having small 48x48 pixel windows scattered around the root window. One alternative might be to use the WM docking window (if that's the right term), but I would still prefer the fvwm buttonbar (or whatever it's called). Might there be some other nice(i.e., esthetic) way to gather them?

(!) [Thomas] Because the WMapplets are from another Window Manager, the hints they use are somewhat alien to Fvwm pure. Hence, the freedesktop.org people define EWMH (extended window manager hints). These essentially allow you to run embedded apps like WMapplets, the KDE kicker, etc.
But I cannot be anymore specific than that since you don't say what is happening. I'm not even sure if WM* apps use EWMH.

(?) Thanks for the pointer. I'll browse their site when I get the time. From reading the fvwm docs, I don't really understand the concept of hints, from what you're saying here. My understanding was that they are window properties containers (of sorts) which pertain to such minor things as border shadowing.

(!) [Thomas] Kind of. EWMH hints are an unofficial extension of ICCCM 2.0 which the freedesktop.org team have developed. Essentially, this implies the use of KDE and GNOME, and allows for their own 'embedded' features to be used with Fvwm if needed, since Fvwm is EWMH-compliant.
But what are EWMHs? They simply allow the interaction between window managers, applications and the utilities that form part of a desktop environment. This was originally written to replace Gnomehints. And as such it has been implemented in GNOME >=2 and KDE >=2
AFAIK, WM* apps are not. Indeed, you can check this for yourself. If you want to know whether an application uses EWMHs then do:
[n6tadam@station n6tadam]$ xprop | grep _NET_WM_STRUT
_NET_WM_STRUT(CARDINAL) = 0, 0, 0, 2
Here, the numbers indicate the screen space that the application in question is using. Thus, you can "filter" out that area of the screen so that an application window doesn't obscure it when maximising it. To achieve that, one can use:
EWMHBaseStructs 0 0 0 2
In their ~/.fvwm2rc file. Why am I telling you this? I don't know really, but it is just useful, since it can also be applied to FvwmButtons.
To go back to your original question though, "hints" are just that -- properties of windows that can be configured or acted upon in some way.
Indeed, You can use a combination of things. It really depends on how you want them gathered. You can define an IconBox for icons minimised, with will place them in a region of the screen.

(?) Also, since I installed SuSE 9 on this laptop (fvwm2 ver 2.5.7), the buttonbar no longer works with swallowed apps. Have you run into any of that? I still haven't visited the

Lately I read the fvwm stuff from issue #3 and discovered a few things that had escaped me, and a few I'd forgotten about, like the ability to drag windows between VD's via the pager.

(!) [Thomas] FvwmPager can do more than you probablu realise. As you say, you can drag windows to other VD's and pages without even seeing the window directly.

(?) Also, from what I could gather by reading the fvwm man pages, it seemed to me that they state that buttons in the buttonbar are pretty limited in functionality, (e.g., toggled state like coolmail). I hope I'm simply misunderstanding the issue, and that it is possible to put a fairly complex applet like wmmount inside of the buttonbar.

(!) [Thomas] But of course! One can quite literally do anything with fvwm. Ironically, what lets it down is the sheer volume of all the possible things it can do.
As an example, if you wanted to have wmmount swallowed by FvwmButtons, and then issue a command to it such that clicking on it mounted a device, and then umounted it, you can do something like the following, assuming you have the icon/applet swallowed:
AddToFunc ToggleMount
+ None (Mount, CirculateHit) Exec exec xterm -T Mount -n Mount -e mount $0
+ I Iconify
+ I Next (Mount, CirculateHit) Close
+ I Exec exec umount $0
Then from within FvwmButtons:
*FvwmButtons: (Action ToggleMount)
This might be long-winded, and indeed, the facility of wmmount might even provide this mechanism, but it demonstrates what can be done. I should point out that I haven't tested it, but it ought to work.

(?) As old as it is, from my viewpoint, there are still some aspects to fvwm that other wm's never caught up to. IMO, it's a good compromise between lightweight and the heavier DT environs like KDE and Gnome. However, the cfg process is pretty much manual via edit of .fvwm2rc

(!) [Thomas] And I hope it stays manual. There are some 500+ style options for Fvwm. There is no way one can enumerate this for a GUI. You wouldn't be able to convey the options to the user efficiently.
I did look, and even suggest this at one point, but I have come to the arrangement that it really is not a viable thing to do. There is always the dotfile generator, but this is hideously out of date, and I really do not suggest you use it.
John, if you like, upload your ~/.fvwm2rc file (or send it to me via e-mail) and I will have a look at it and fix it for you. I'll also change the syntax to conform to 2.5.X should there be any discrepencies.

(?) Thanks, I'll probably take you up on the offer. I've spent 3 or 4 hours trying different things, without success.

(!) [Thomas] Then I am more than happy to go through it. I'll even throw in some comments and explanations en route. :)
(!) [Thomas] Well unfortunately John never did reply. But seriously, Fvwm is not as cumbersome as it first seems, and if you really don't like MWM (which has been labelled as butt ugly by a certain man wearing Dark Sunglasses.... :) ) then you can see what can be done with a little effort here:
http://www.fvwm.org/screenshots/desktops
(!) [Heather] Ok, I'm late to the thread, but I concur there are some very cool things you can do with this stuff. For a push in the right direction, I'm including my own configuration, which Thomas helped me with, because a lot of the tricks I was using on my own are from Ye Olden Fvwm 1.0 days, and it needed a nice touch-up.
All of these parts go in a .fvwm directory under my home, which happens to be /home/heather. So you'll find yourself going into these files and changing at least that burned in location... unless your username happens to be heather. The dotfile really has to be a dotfile, and take the .txt extension off, of course.
Now for the warning label. I have great color vision and my monitor is really bright, so my config is very dark. If you vision isn't as good as mine, or your monitor isn't as vibrant, consider replacing the darker blue with the rgb.txt named color NavyBlue or MidnightBlie. They just weren't Navy or Midnight enough for me :)
I use a simple starfield background. I actually cooked this one up years ago, back when I still lived fulltime on (gasp!) Windows95. There was this great poster I liked, and I kind of took a look at it then did a starfield of my after the manner of it, except of course mine didn't have any things flying around in front of it like theirs did, and mine tiled in a friendly fashion, and for the sake of memory, didn't have that beautiful range of gradient color. Feel free to go get your own bit of darkness from an astronomy site, if you prefer.

See attached heather.stars16a.xpm

Everything is based around the .fvwm2rc file. In older flavors of fvwm that was expected in your homedir, but now it's expecetd in ~/.fvwm directory instead, to support you having a batch of extra parts.
The sneakiest thing in this is the trick to make the button which invokes sticky status, change appearance permanently for a stuck window, and change back if it's unstuck. My thanks to Thomas for showing me the events interface.

See attached heather.dot.fvwm2rc.txt

I do some seriously strange things with my buttons layout. Seems like every distro I ever looked at has a giant googly pair of Xeyes chasing the cursor around, but I think they need to not be so huge. I do like having a load monitor, but it doesn't look good if it doesn't cover the full height. So some juggling is called for,
The buzzword for making "live" apps like Xeyes and xload stay involved is a swallowed app - it doesn't need to be designed as an applet, it just has to submit safely to having its geometry resized.
I love icons but frankly I can find better things to do with some of my screen estate, so maybe I want a few, but for some common tasks I use smaller icons than others. I like a system load check but not taking too much space, and I really abuse multiple pages, definitely preferring that instead of multiple workspaces (though Fvwm supports those too).
Caveat for those with fancy video cards - you want workspaces (like K desktop favors) or pages (like I do), not bigger virtual screens (controlled in XF86Config-4). Sliding around looking for where the real center of the screen is and wondering where you lost your control corner or iconbox are not the way to spend your workday. My pages have a 2x4 layout, for 8 pages total, and this has generally been plenty for me.

See attached heather.ConfigFvwmButtons.txt

Unless I configure that darn pager explicitly, though, it comes out pasty white. Agggh! My poor vampiric eyeballs. Again, if your color vision likes brighter colors, or you hate purple, pick something brighter from the named colors in rgb.txt. I used here, the "brighter" NavyBlue, because the pages are tiny enough I wanted better contrast. You might want them brighter yet, and make it just plain Blue.
There's a nice app named xcolors that will show all the colors for you, i but you have to launch it with extra window page space already available below ypur active window, because the window is too tall (showing every color takes some space) and it's too stupid to have a scrollbar. There's a gtk app that does a cleaner job of showing the colors but I forget what it's called.

See attached heather.ConfigFvwmPager.txt

The sparkling touch of color on my active window is thanks to me using s few tiny pixmaps instead of MWM-like vector corners. For the inactive window I still use the vectors - they're faster, and they don't look bad (I do wonder if I should do something cuter for sticky, but I've been lazy). I got these from the fvwm95 icons kit, but for sanity and portability, I copied them into .fvwm/icons, a directory.
Sticky means, it will "go" with me. I like that, bad puns in a tiny setting...

See attached icons.mini-go.xpm

Ironically the icon that looks like a box, so is nice for maximize, is named iconify.

See attached icons.mini-iconify.xpm

If it's stuck to the window, it looks vaguely like a 4-color windows icon.

See attached icons.mini-icons.xpm

dot in box for max, dot with no box for iconify.

See attached icons.mini-rball.xpm

X for eXit works for me.

See attached icons.mini-x.xpm

Of course the window controls belong to the window manager, so mentioning that for the menu ocrner...

See attached icons.mini.fvwm.xpm

Last but not least, I have a couple of personal menus. One gives me access to a number of differently colorized Xterms; I use them so much color helps me recall which one's which even when I forget to retitle them.
The other makes it easy to pop up web browsers, since I like to view the world from different angles sometimes. "Netscape" on there is the somewhat ancient Netscape 4.77 -- Netscape 7 and Mozilla don't seem to be good neighbors, they keep stepping on each other's config files. I use NS4 to spot buggy HTML code, because it has just horrid rendering when the code's wrong and it sticks out like a sore thumb. Lynx I just happen to like 'cuz it's speedy.

See attached main-nenu.heather.txt

Did I miss anything? Oh of course. A screen shot It's a bit on the large side, but I told you I had a big monitor. That dark shot of the GIMP is also a goodie of mine, a GTK theme I whipped up for myself which I call DarkGems, because I stole gemlike features from a half dozen E and GTK themes. But this is about Fvwm, not about GTK, so I'll save that for another time.
I also applied a minor hack on fvwm to not stipple my sticky title bars. For most folks I think it'd be more a pain to recompile fvwm just to leave that out, and then want to keep up to date, so I'll leave that out too. It was in icons.c and the borders.c if you feel adventuresome.
Just making your desktop a little more fun ...

This page edited and maintained by the Editors of Linux Gazette
HTML script maintained by Heather Stern of Starshine Technical Services, http://www.starshine.org/


Each TAG thread Copyright © its authors, 2004

Published in issue 104 of Linux Gazette July 2004

<-- 2c Tips | TAG Index | 1 | 2 | 3 | 4 | Knowledge Base | News Bytes -->
Tux