Easiest Thumnails Ever!

:slight_smile: Mildly insane sounds like the roughly right of mindset for this sort of thing.

I missed these earlier. Yep, you should get the thumbnail icons automatically. Well, almost. This is what this line does:

*FvwmThumbnail: Class Icons, Command "WindowId %w WindowStyle IconOverride, Icon  %i" 

It tells the module: “every time you create a new icon in Class “Icons”, I want you to override the icon for the window it comes from, and replace it with the image file we just generated”

The big pager is a bit trickier. If you generate Big Pager sized miniicons then they’ll be too big for a normal pager (they get clipped) or window list (they don’t get clipped - it’s a pain) or a taskbar (unknown). So what we have to be able to do is set it up so the icons get changed, just before the pager appears.

That’s what this line does in my big pager launch function:

+ I SendToModule FvwmThumbnail Apply BigPager WindowId %w WindowStyle EWMHMiniIconOverride, MiniIcon %i

This says “take all the icons in the “BigPager” class, override their mini icons and replace the icons with the corresponding generated icon files”. (I did include that part in the sample config, didn’t I? I’m getting a sinking feeling about that…)

The only problem with that as it stands is that after big pager is called, you have huge miniicons. This will quickly sort itself out, but best would be to send a second Apply command via sendToModule and FvwmEvent.

I’m going to add an ApplyOn command, I think, so you don’t need the FvwmEvent instance, but I’ve been busy writing the perl modules-from-scratch posts. As well as ripping out boilers and wiring new sockets into our new front room. It’s not much work, so I should get to it before next week
[edit]
I said “window icon” where I meant “mini icon”. Fixed

Nick, do you ever do any work? :wink:

This looks like a great development. I’ll certainly be using it, and I’ll post results here. However, I’ve got the first draught of my final Master’s project due in tomorrow… Damn you, University!

Okay, it works! and it is fast. New problem: How to I tell FvwmThumbnail NOT to thumbnail a window. Nothing I have done seems to work.

Here’s the thing. I have a “run box” type program setup with a hotkey. So everytime I hit it the app comes up. But it pops up and then goes away. I need FvwmThumbnail not to bother this particular program

Is there an option to have the Thumnail stay away from “certain” applications. I tried configuring the Class option

*FvwmThumbnail: Class xlaunch, Command "NoIconOverride"

Thanks

mmm… I’ve been meaning to add a skip list type option for a while. I’ll see if I can get that working tonight.

The Class command doesn’t work because it creates a new class of icons, but the old ones are still there.

Right, that’s the skiplist working

Syntax is

*FvwmThumbnail: SkipList [i]pattern ...[/i]

eg:

*FvwmThumbnail: SkipList FvwmButtons[/i]

Patterns are matched against window name, resource and resource class in that order. If you define skiplist multiple times, each will overwrite the old one.

Module in the usual place. Let me know whether or not it works as you would expect

Well, I am not able to get it working…or I am writing the syntax incorrectly.

This is my config: *FvwmThumbnail: SkipList [i]X-launch[/i] as per your example. I have tried it without the little [i] thinking perhaps it was just BB code that didn’t get translated correctly…I am thinking that is what happened.

I have tried it with every class, resource and icon name and still nothing seems to work. If I have FvwmThumbnail in Mode Manual the app works fine but then I don’t get thumbnails.

Nick, I must thank you for your patience… I am sorry to be a pest.

Ooops! Forgot to mention, this is the error message I get from FvwmThumbnail: Use of uninitialized value in pattern match (m//) at /usr/lib/fvwm/2.5.12/FvwmThumbnail line 574. Use of uninitialized value in pattern match (m//) at /usr/lib/fvwm/2.5.12/FvwmThumbnail line 574. Use of uninitialized value in pattern match (m//) at /usr/lib/fvwm/2.5.12/FvwmThumbnail line 574. Use of uninitialized value in pattern match (m//) at /usr/lib/fvwm/2.5.12/FvwmThumbnail line 574

Well, you’re right about the bbcode. And don’t worry about being a pest. Thank you for helping me test my module :slight_smile:

As for the module, I tried adding

*FvwmThumbnail: SkipList X-Launch
into my test config, and created an xterm with the title X-Launch to test it, It worked just fine.

The “uninitialized value in pattern match” error suggests that the pattern isn’t being set - in which case I’d not expect the skip list match to be evaluated at all/

So: new version. Set this in your configuration:

*FvwmThumbnail: Debug 1
And you should be able to see what’s happening:

[code]### DEBUG: Debug Level set to 1

DEBUG: raw skip list = X-Launch

DEBUG: token = X-Launch

DEBUG: cooked skip list = ^X-Launch$

DEBUG: window name = X-Launch

DEBUG: window resource = aterm

DEBUG: window resource class = XTerm

DEBUG: winlist matched: skipping X-Launch/aterm/XTerm

[/code]
… or not, as the case may be.

If it still itsn’t clear, post the relevant bits of debug chatter and I’ll have another look

sorry I am not very familiar with modules, so where should I put the module file?? thanks

Y

Start fvwm and open a terminal. Then type

mkdir $FVWM_USERDIR/modules

Now add this line to your conifg.

ModulePath +:$[FVWM_USERDIR]/modules:+

Copy the module into Fvwm and restart

Nick it worked! which is odd because I had tried it the same way you had suggested before and it didn’t work for me.

As a side note, these are some debug messages I see. They don’t affect me at all but maybe important to you?

[code]### DEBUG: Debug Level set to 1

DEBUG: raw skip list = X-Launch

DEBUG: token = X-Launch

DEBUG: cooked skip list = ^X-Launch$

DEBUG: window name = X-Launch

DEBUG: Use of uninitialized value in printf at /usr/lib/fvwm/2.5.12/FvwmThum

bnail line 82.
window resource =

DEBUG: Use of uninitialized value in printf at /usr/lib/fvwm/2.5.12/FvwmThum

bnail line 82.
window resource class =

DEBUG: Use of uninitialized value in printf at /usr/lib/fvwm/2.5.12/FvwmThum

bnail line 82.
Use of uninitialized value in printf at /usr/lib/fvwm/2.5.12/FvwmThumbnail line
82.
winlist matched: skipping X-Launch//

DEBUG: window name = xterm

DEBUG: Use of uninitialized value in printf at /usr/lib/fvwm/2.5.12/FvwmThum

bnail line 82.
window resource =

DEBUG: Use of uninitialized value in printf at /usr/lib/fvwm/2.5.12/FvwmThum

bnail line 82.
window resource class =
Use of uninitialized value in pattern match (m//) at /usr/lib/fvwm/2.5.12/FvwmTh
umbnail line 592.
Use of uninitialized value in pattern match (m//) at /usr/lib/fvwm/2.5.12/FvwmTh
umbnail line 592[/code]

Everthing works fine for me.

Thanks! Whew! glad that parts over :laughing:

A bit of a bug in my debug code - it seemed to work ok when I tested it. I fixed it again. That should hold it for the next ten minutes :wink:

Glad it’s working for you, chickpea. :slight_smile:

Fixed debug message version here

Do I detect a little jab in the ribs? :wink:

Well, over ten minutes and it is STILL working

Thanks again for all of your help and for the great Module.

thanks
I put the following code into my .fvwm2rc,
but nothing happens when I do Alt+tab,
instead the default small icons in the window list disappeared …

I got an error message saying that line 316 of FvwmThumb got division by zeror error. $scaler->factor_x( $scaler->to_x / $vp_x );
$scaler->factor_y( $scaler->to_y / $vp_y );

=============================================

new stuff into .fvwm2rc

FvwmThumb stuff from the web

ModulePath ${HOME}/.fvwm:+
DestroyModuleConfig FvwmThumbnail: *

*FvwmThumbnail: Refresh 5
*FvwmThumbnail: Directory ${HOME}/.fvwm/

*FvwmThumbnail: Class Pager, ScaleTo 27x27
*FvwmThumbnail: Class Pager, Command “WindowId %w WindowStyle EWMHMiniIconOverride, MiniIcon %i”

*FvwmThumbnail: Class Icons, Factor 0.2x0.2
*FvwmThumbnail: Class Icons, Command “WindowId %w WindowStyle IconOverride, Icon %i”

*FvwmThumbnail: Class BigPager, Factor 0.166666x0.166666

AddToFunc StartFunction

  • I Module FvwmThumbnail

@chickpea: any jab i the ribs is directed at my own code. Every time I get it working…

@yangyangyyy: a divide by zero error there means Fvwm is reporting the size of your viewport as zero, which isn’t supposed to happen. Do you have anything exotic in your setup, like xinerama? If not it might be a race condition.

My alt-tab windowlist has vanished too. I didn’t imageing it might a related issue. I’ll have a look at that one.

The miniicons should still be there if the module crashed. It will mess with them, since there’s only one set of miniicons to play with between pager, taskbar and window list. There’s nothing I can do about that without patching Fvwm itself.

I’ll have a look at the alt-tab issue sometime today

hi nick: thanks a lot

yeah I guess I am totally lost :frowning: . First, I am not quite clear of what I should expect to see from the FvwmThumbnail module. sorry I may have not spent enough time reading the doc. maybe I should see :
(1) Alt-Tab window list has window snapshots?
(2) minimized icons are snapshots?
(3) or some special function (which I could associate a key with) that projects the snapshots of all windows onto the desktop momentarily and then you can select from them? ( like skippy and expose on Mac)

since I use a very minimal fvwm config without any taskbar or FvwmButtons,
the above are the only places that I could think of.

the division by zero problem is fine now, after I downloaded the latest version on this thread. ( also I found there is a very simple bug in
/usr/share/fvwm/perllib/FVWM/Tracker/WindowList.pm, line 53,
#foreach my $option (@{$self->{options}}) {
foreach (@{$self->{options}}) {
)

ImagePath +:/usr/share/WindowMaker/Icons:$HOME/.fvwm/pics

#---- some stupid function due to gramma of fvwm
DestroyFunc raise-ro-move
AddToFunc raise-or-move

  • C Raise
  • M Move

DestroyFunc max-and-raise
AddToFunc max-and-raise

  • I Maximize
  • I Raise

#save and retrieve current focused window id
DestroyFunc move-and-focus
AddToFunc move-and-focus

  • I PipeRead "echo SetEnv focusnumber$[page.nx]$[page.ny] $[w.id] "
  • I GotoPage $0 $1
  • I PipeRead "echo WindowID $focusnumber$[page.nx]$[page.ny] \(CurrentPage \) Focus "
    #+ I TestRc (0) search-window

DestroyFunc search-window
AddToFunc search-window

  • I ScanForWindow FromPointer East North ( CurrentPage !Iconic ) Focus
  • I TestRc (0) ScanForWindow FromPointer West South ( CurrentPage !Iconic ) Focus

if fails to find window on “right-up” direction, go for the other

quadrant

#changing focus window within same desk

remember the new focus window id

change-focus(direction)

DestroyFunc change-focus
AddToFunc change-focus

  • I Direction $0 (CurrentPage !Iconic Visible !x2x*) Focus

— normal window operations ------

Key M W MC Maximize
Key N W MC Maximize 0 100
Key I A MC Iconify
Key X W MC Close
Key R W MC RaiseLower
Key S W MC Resize
Key V W MC Move

jumping to remote display

Key F10 A A All (x2x*) Focus

while F11 is used for jumping back

Style x2x* Sticky StaysOnBottom

Mouse 0 I A Iconify
Mouse 1 W M raise-or-move

Mouse 0 W CM Echo $[w.id]

#----- move to pages
Key K A MCS move-and-focus +0p -1p
Key J A MCS move-and-focus +0p +1p
Key H A MCS move-and-focus -1p +0p
Key L A MCS move-and-focus +1p +0p

Key Up A MC move-and-focus +0p -1p
Key Down A MC move-and-focus +0p +1p
Key Left A MC move-and-focus -1p +0p
Key Right A MC move-and-focus +1p +0p

Key Up A MCS MoveToPage +0p -1p
Key Down A MCS MoveToPage +0p +1p
Key Left A MCS MoveToPage -1p +0p
Key Right A MCS MoveToPage +1p +0p

EdgeResistance 100 20

#------- app key bindings -----
Key F3 A A Exec xterm
Key F4 A A Exec firefox
Key F9 A A Module FvwmConsole

#---------- Focus
Style * FPGrabFocus, FPClickToFocus, FPReleaseFocus, StickyIcon
Style * MinOverlapPlacement, MinOverlapPlacementPenalties 1 5 0 0 0.05 50
Style Fvwm* MinOverlapPlacementPenalties 0 0 0 0 0 0

Key H A MC change-focus left
Key L A MC change-focus right
Key J A MC change-focus south
Key K A MC change-focus north

Style * HandleWidth 1
Style *term NoTitle
Style firefox NoTitle
Style Acroread NoTitle
Style Gv NoTitle

#----- about Icons -----
Style Firefox-bin Icon “WOAX/Aqua\ Ornament.png”, IconOverride
Style XTerm Icon “petro/The\ Crab.png” , IconOverride
Style GQview Icon “CandyBar/Clipping\ -\ Picture.png”, IconOverride
Style Gtkam Icon “smooth6/iPhoto.png”, IconOverride
Style Fig Icon “petro/The\ Antelope.png”, IconOverride
Style GV Icon “petro/The\ Gazelle.png”, IconOverride
Style AcroRead Icon “TI/File\ Server\ Disconnected.png”,
+IconOverride
Style Fvwm* CirculateSkip, WindowListSkip
Style FvwmPager StaysOnBottom
Style * MiniIcon Terminal.xpm
Style * IconBox 1000x100+1-1
Style Fvwm* Sticky

##------ init ------
#DestroyFunc InitFunction
#AddToFunc InitFunction
#+ I Module FvwmBacker
#+ I Module FvwmPager
#+ I Module FvwmButtons
#+ I Colorset 10 TiledPixmap black.xpm
##+I Colorset 11 Pixmap bar.png
#+ I *FvwmBacker: Command (Desk *, Page * 0) Colorset 10
#+ I Exec xscreensaver
##+I *FvwmBacker: Command (Desk *, Page * 1) Colorset 11
##---- some stupid function due to gramma of fvwm

DestroyFunc StartFunction
AddToFunc StartFunction

  • I Module FvwmBacker
  • I Module FvwmPager
    #+ I Module FvwmButtons yybuttons
  • I Colorset 10 TiledPixmap black.xpm
    #+I Colorset 11 Pixmap bar.png
  • I *FvwmBacker: Command (Desk *, Page * 0) Colorset 10
  • I Exec xscreensaver
    #+I *FvwmBacker: Command (Desk *, Page * 1) Colorset 11
    #---- some stupid function due to gramma of fvwm

#---- close ----
DestroyFunc ExitFunction
AddToFunc ExitFunction

  • I All (xscreensaver) Close

Colorset 1 RootTransparent, fg black, bg black, sh Gray,
hi Yellow, Tint black 0, btTint black 0

#-----------------Module part
DestroyModuleConfig yybuttons: *
*yybuttons: Geometry 60x400+0+200
*yybuttons: Colorset 1
*yybuttons: Rows 10
*yybuttons: Columns 1
*yybuttons: Frame 0
*yybuttons: Font “Shadow=3:xft:Sans:Bold:pixelsize=14:minspace=True:antialias=True”
*yybuttons: ( 1x1, Icon net.png, Action beep, Action(Mouse 1) ‘Exec xterm’ )
*yybuttons: ( 1x1, Icon net.png, Action(Mouse 1) ‘Exec xterm’ )
*yybuttons: ( 1x1, Icon net.png, Action(Mouse 1) ‘Exec xterm’ )
*yybuttons: ( 1x1, Icon net.png, Action(Mouse 1) ‘Exec xterm’ )
*yybuttons: ( 1x1, Icon net.png, Action(Mouse 1) ‘Exec xterm’ )

Style “yybuttons” NoTitle, !Handles, !Borders, Sticky,
WindowListSkip, CirculateSkip, StaysOnBottom, FixedPosition,
FixedSize, !Iconifiable

DestroyMenu FvwmRootMenu
AddToMenu FvwmRootMenu “YYmenu” Title

  • “YYtest %net.png” FvwmRearrange -tile -h -a -mn 3 -incx 0 -incy 0
  • “YYtest2 %net.png” FvwmRearrange -tile
  • “YYtest3 %net.png” FvwmRearrange -tile
  • “YYtest4 %net.png” FvwmRearrange -tile

DestroyFunc yytile
AddToFunc yytile

  • I SetEnv TempWindowCount 0
  • I All (CurrentPage !Sticky !Iconic)
    PipeRead
    “echo SetEnv TempWindowCount $(( $TempWindowCount+1))”
  • I PipeRead
    ‘perl -e ’ @mapping=(1,1,1,2,2,3,3,3,3,3,4,4,4);
    if ( $[TempWindowCount] <=12 ) {
    print "SetEnv nRow ".$mapping[ $[TempWindowCount] ];
    } else {
    print "SetEnv nRow ", (int(sqrt($[TempWindowCount])))
    }’’
    #+ I All (CurrentPage )
    #PipeRead \

"echo SetEnv TempWindowCount $(($TempWindowCount+1)) "

##echo “balh $[TempWindowCount]”

  • I FvwmRearrange -tile -h -mn $[nRow] -a
  • I Echo $[TempWindowCount] “—” $[nRow]

Key F11 A A yytile

FvwmThumb stuff from the web

ModulePath ${HOME}/.fvwm:+
DestroyModuleConfig FvwmThumbnail: *

*FvwmThumbnail: Refresh 5
*FvwmThumbnail: Directory ${HOME}/.fvwm/

*FvwmThumbnail: Class Pager, ScaleTo 27x27
*FvwmThumbnail: Class Pager, Command “WindowId %w WindowStyle EWMHMiniIconOverride, MiniIcon %i”

*FvwmThumbnail: Class Icons, Factor 0.2x0.2
*FvwmThumbnail: Class Icons, Command “WindowId %w WindowStyle IconOverride, Icon %i”

*FvwmThumbnail: Class BigPager, Factor 0.166666x0.166666

AddToFunc StartFunction

  • I Module FvwmThumbnail

Yep, i’d expect that. As I say, my atl-tab has vanished as well, so I need to look at that. If it does display tho’ and if you have it set to use miniicons then yes, you should see snapshots.

Yep.

That too, although it isn’t part of the module per se. What you need is a fullscreen, always on top pager bound to a keypress. This is what I use:

[code]Style FvwmBigPager WindowListSkip, StaysOnTop

adjust for local colorsets and screen size

DestroyModuleConfig FvwmPager: FvwmBigPager
*FvwmBigPager: Geometry 1280x800+0+0
*FvwmBigPager: UseSkipList
*FvwmBigPager: Rows 2
*FvwmBigPager: Colorset 0 $[cset_wall_0]
*FvwmBigPager: Colorset 1 $[cset_wall_1]
*FvwmBigPager: Colorset 2 $[cset_wall_2]
*FvwmBigPager: Colorset 3 $[cset_wall_3]
*FvwmBigPager: Font none
*FvwmBigPager: NoSeparators # turn off the lines separating desks
*FvwmBigPager: MiniIcons

I got it bound to WindowsKey+Shift+T-for-teleport

Key T A 4S FuncInvokeBigPager

DestroyFunc FuncInvokeBigPager
AddToFunc FuncInvokeBigPager

  • I SendToModule FvwmThumbnail Apply BigPager WindowId %w WindowStyle EWMHMiniIconOverride, MiniIcon %i
  • I Module FvwmPager -transient FvwmBigPager 0 3
  • I WindowId (FvwmBigPager) Layer 0 10 # way high

Key T A 4 ThisWindow SendToModule FvwmThumbnail Thumbnail $[w.id]
Key S A 4 SendToModule FvwmThumbnail ScreenShot $[HOME]/screenshot.png
Key W A 4 SendToModule FvwmThumbnail WinShot $[w.id] $[HOME]/winshot.png[/code]

The $[cset_wall_N] env variables are placeholder for pixmap colorsets holding the wallpaper for my four desks. You’ll want to edit the config to relect your desktop aspect ratio and number of desks.

I think I’m going to edit the start of this thread to include this, since I’m not sure the whole thing appears anywhere.

That would explain a few things. Do you want to tell Mikhael, or should I?

Do I take it that you’re not getting thumbnailed icons when you minimise a window? or any error messages?

thanks nick,

right now, I am see none of the 3 functions I thought about.

somehow the default miniicons in Alt-Tab window list come back. (still the original default ones, not snapshots)

first error I see is when I type “Module FvwmThumbnail” in the FvwmConsole, it says
“Unrecognised: SkipList”,
Then immediately after this, it says “division by zero …” , this “division” error only appears the first time I do Alt-tab after loading “Module FvwmThumbnail”

I am also seeing
“DESTROY created new reference to dead object “FVWM:Module” during global destruction” SendToModule FvwmThumbnail ScreenShot $[HOME]/screenshot.png
I guess this is why it never works on my setup???

the BigPager code of yours does give me a large pager, but the icons inside
are just default icons, and the 3 sentences
" ThisWindow SendToModule FvwmThumbnail Thumbnail $[w.id] "
" SendToModule FvwmThumbnail ScreenShot $[HOME]/screenshot.png"
“SendToModule FvwmThumbnail WinShot $[w.id] $[HOME]/winshot.png”
do not seem to take any effect

about the bug in WindowList.pm, you could go ahead and tell the person in question, :slight_smile:

Right. The DESTROY error message gets generated from somewhere in the module event loop (I think) when the module crashes.

I’m not sure just why this is as yet, but the “unrecognised: SkipList” command tells me that you’re still not picking up the latest version of the module for some reason. I’ve just checked, and the version that recognises SkipList is on my server.

I’d better give some thought to version and source control methinks. In the meantime, the up to date module should contain a block like this:

/^SkipList\s+(.*)$/ and do { process_skip_list($1); next; };

Try updating it again and we’ll see if that gets us any further

I downloaded the new code from the top of this page, now the skiplist error is gone, but division by zero is still present, and of course, after that, the “destroyed” error, so I am still not seeing any functions work …

I manually set the $vp_x, $vp_y = 1, then of course the div 0 error is gone,
but I still don’t see any functions taking effect

aha, I get this message:

[FVWM][FlushMessageQueue]: <> Failed to write descriptor to ‘FvwmThumbnail’:

  • select rc=0
  • terminate signal=N
    ------------------maybe this has to do with my added code (arround line 316):
    #############################
    my ($vp_x, $vp_y)=(1,1);
    $vp_x = $win_data->{_tracker}{page_info}{ vp_width } || 1;
    $vp_y = $win_data->{_tracker}{page_info}{ vp_height } || 1;
    #########################################