a BIG Pager!

I just wrote some code for a full screen pager. How useless is that? How about if if you make it transient, then? How about transient, always on top and bound to a keystroke? How about using thumbnails for the windows as well?

Then you get a popup screen that gives you an overview of all your desks. Click one one and you go there - the pager screen vanishes. Like this:



Cool, huh?

Here’s the code:

[code]#

Stays on top, cause I don’t want screen clutter on top of it

WindowSkipList so I can stop it showing itself and blotting out the rest of

that window

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 MS FuncInvokeBigPager # Alt-Shift-T

DestroyFunc FuncInvokeBigPager
AddToFunc FuncInvokeBigPager

  • I Module FvwmPager -transient FvwmBigPager 0 3
  • I WindowId (FvwmBigPager) Layer 0 10 # way high
    [/code]
    I’ve not done the thumbnail generating code, because I used the one from my old config which is written in perl. I don’t generally use it because most of my windows are transparent aterms and they don’t show up too much on normal size pagers.

Be warned - if you use mini-icons on FvwmWinMan, having icons 1/16th the size of your screen is going to play hell with Alt-TAB.

What you reckon? Is this ridiculously cool, or just ridiculous? I’m in two minds, myself :smiley:

Nick, you seem to be an endless resource of ideas…what’s your secret? :wink:

I’m pretty sure this feature will be showing up in people’s configs in no time…

thumbs up! cool [but useless :wink: ] feature.

this is friggin’ awesome :exclamation:

Nick Fortune, you are nuts!!! But in a good way :laughing:. How fun this is. But like BlackDragon asked? How do you come up with this stuff?

I suppose I ws thinking about a deliberately obfuscated desktop; one that was dificult to use by design, rather than just accidentally. Sort of a GUI analogue of the progamming language brainf*ck. I mean people sometimes accuse me of deliberately obscuring what I do with a keyboard when nothing could be further from the truth. So every now and then I get an urge to show them what it’s like when I try to obscure things.

At the same time I was digging through the FvwmPager man page and I started thinking: How can I take this to the limit? A friend of mine once found a Ring of Invisibility in a D&D game. When you put it on, the ring turned invisible. Not the wearer, just the ring. I thought I could do something similar with the pager. Make it so big it blotted out everything else.

Then I remembered about the transient option, and realised that it could actually be useful. Edward de Bono once pointed out that weird and impossible ideas can be useful because the often provide the inspiration for sensible and useful ideas that you might not have otherwise though of. I think that’s what happened here.

More generally, think about interfaces; look for little used or underused features; think about extremes.

Interfaces, because that is, to my mind, the exciting thing about FVWM. Not the eye candy; eye candy is nice but if all I want is cool-wallpaper-and-icons, well I can do that with anything. I like ceye candy, but what gets me going is the prospect of designing new interfaces, something FVWM is better at than anything else I’ve seen. With FVWM we can design interfaces that have never been seen before, make things work in new ways. And somehow we seem to spend all out effort working out how to mimic interfaces from other systems, things that already exist. I can understand that; my first fvwm project was to replicate the afterstep desktop I had used for years. At the same time though, it’s a little sad that we so seldom seem to set our sights higher.

Little used features: The eye tends to skip over things we don’t understand. To an extent we see what we expect to see, It’s worth looking for things you don’t understand and paying with them to see what they do. Creativity needs inspiration, and learning new things often provides that. Don’t be afraid to combine the new thing with something better understood, but try and explore the limits of the newness all the same

Extremes: think about how to push a command to the limit. What are the boundaries of its usefulness. How could you take it beyond? Look for where the model breaks down, see out the edges of the map, the places marked “Here Be Tygers”. Look at the silly things you could do, the things the designers never intended to be done.

And if you can do all three - explore a new facet of fvwm; push it to the limits of its usefulness; and still keep one eye on the idea of interfaces… you might surprise yourself with the ideas that come to mind.

Hi girls and guys…

That’s an absolutly great new function. Much thanks for this…
But:

I’m sorry that I have to ask, but I would be very thankful if I can get the whole needed code… :wink: i.e. the code for the thumbnails-generation.

I also want to know how to change the number of rows and cols. I see the configuration for rows, but not for cols. I’ve six desktops, three on the top and three below. (FVWMPager configuration would be 3x2)

I only get this, If I’ll only copy and paste your code to my .fvwm2rc, without any thumbnails or backgrounds. Only the icons of the applications will appear:

Okay… I was able to change the rows and cols now. :wink:
But I still have no idea how to change the backgrounds or how to get the thumbnails of the shown applications…?

OK then: on the config this was designed for I set my wallpaper using colorsets and FvwmBacker. This is how I set it up:

[code]SetEnv cset_wall_1 10
SetEnv cset_wall_2 20
SetEnv cset_wall_3 30
SetEnv cset_wall_4 40

Colorset $[cset_wall_1] Pixmap /home/nick/.fvwm.data/walls/cheese.png
Colorset $[cset_wall_2] Pixmap /home/nick/.fvwm.data/walls/thetismoon.png
Colorset $[cset_wall_3] Pixmap /home/nick/.fvwm.data/walls/WMSecksy.png
Colorset $[cset_wall_4] Pixmap /home/nick/.fvwm.data/walls/calvin.png

*FvwmBigPager: Colorset 0 $[cset_wall_0]
*FvwmBigPager: Colorset 1 $[cset_wall_1]
*FvwmBigPager: Colorset 2 $[cset_wall_2]
*FvwmBigPager: Colorset 3 $[cset_wall_3] [/code]

The thumbnails are a bit more complicated. I wrote the thumbnailing function in perl. I had a config written entirely in perl at the time (must get back to that project some day) and I set this up as a callback via FvwmPerl.

This is the function:

[code]#

one of my pager cells is 40x25 pixels - I snapped it and counted them in

the Gimp to get this information and need a better way to do it

my screen resolution is 1280x800

so if I scale by a factor of 25/800 I should get an icon that’s

the correct size relative to the pager

sub generate_mini_icon
{
my $win_id = shift; # x window id
#my $scale = 25/800;
my $scale = 1/4;

check for a window id

    unless($win_id) {
            print "### Error - generate_mini_icon: null string passed\n";
            return;
    }
    unless($win_id && $win_id ne "0x0") {
            print "### Error - generate_mini_icon: zero window id\n";
            return;
    }
    print "generate_mini_icon: $win_id\n";

ok declare some variables

    my $pipe = gensym();            # filehandle holder
    my $image = new Image::Magick;  # image object
    printf "WinId = %s\n", $win_id;
    my $outfile = sprintf "$fvwm_data/temp/%s.png", $win_id;

there doesn’t seem to be an Image::Magick equivalent of import,

so we’ll stick with xwd

    my $cmd = sprintf("xwd -silent -id %s |", $win_id);
    print STDERR "# Running: $cmd\n";
    print STDERR "# Output:  $outfile\n";
    print STDERR "win_id = $win_id\n";
    print STDERR "cmd = '$cmd'\n";
    open $pipe, $cmd or die "can't open pipe $!";
    print STDERR "pipe open\n";

read the image from the pipe and then close the pipe

    $image->Read(file=>$pipe);
    print STDERR "image read\n";
    close $pipe;
    print STDERR "pipe closed\n";

now let’s get the size of the image

    my ($cols, $rows) = $image->Get qw(base-columns base-rows);

convert the image

    my $factor = $scale;

    my $rc = $image->Resize( 
            height  => ($rows * $factor),
            width   => ($cols * $factor),
    );      
    print "$rc\n" if $rc;
    
    $rc = $image->Frame(geometry => "1x1");
    print "$rc\n" if $rc;
    
    $rc = $image->Set(
            mattecolor      => "black",
            quality         => 0
    );      
    print "$rc\n" if $rc;
    
    $image->Write(filename=>$outfile);

now to set the mini icon of the window to be the newly generated file

    $cmd =   sprintf        "WindowId %s WindowStyle "
    .                       "EWMHMiniIcon"EWMHMiniIconOverride,Override, "
    .                       "MiniIcon $outfile", $win_id;
    print "$cmd\n";
    FFVWM::cmd "$cmd\n";

}
[/code]
That’s kind of a mishmash, but the basic idea is: use Fvwm to catch a few key events; call an FvwmFunction from FvwmEvent passing the window id back again; call piperead to use xwm to dump the window into image magick; resize the image so it’s scaled to the page size of your pager; and call use the WindowId and WindowStyle to apply EWMHMiniIconOverride override and Miniicon styles.

Or you could check out the discussion on the gentoo forum that started me playing with all this. There are also some thumbnailing threads on the forum somewhere

Great, thanks!

I havn’t tried it yet, but I will.
I’ve the “original” fvwmpager now working with real thumbnails, so I’ll first try to get this big pager working with the same thumbnail function (xwd | convert…). If that won’t work, I’ll try your funktion again. :wink:

hmmm… could it be, that it is impossiblet o have a graphical (with thumbnails) normal pager and the graphical bigpager?

Because I only get the thumbnails for the normal pager in my bigpager and they are lot to small. :wink:

But when I’ll create a new function, which generates the same thumbnails but much bigger with another name, how to say bigpager which thumbnails he should use?

Oops - yeah, that’ll happen :frowning:

The trouble is that they both work by overriding the miniicon for the window. So if it’s scaled one size of pager, it’ll be wrong for another.

one thing you could do, and I’ve not tried this, is to maintian two icon files. then when you call up the big pager you could do something like All (!Iconic, !Shaded) ChangeIconFunc and in the func switch the minicions to use the ones scaled for the big pager.

You’d need to catch the big pager closing as well, and restore normal icon sizes

Okay, for now I’ve the bigpager in the same size as my normal pager. This is good for fast switching between the desktops, when the normal pager is hidden by some windows… :wink:

Perhaps I’ll try this again later with your tipp, thanks for now.

I love this it really helps keep your desktop clear. I have it working but theres 2 problems.
Number 1 is if im on desktop 1 and i open the pager desktop 2 3 4 show the wallpaper but desktop 1 shows a black square. Heres a screenshot so you can see what i mean http://thevoided.net/pager.jpg It doesnt matter if on desktop 1 or 3 it still only shows a black square on the desktop that i opened the pager on. Problem 2 is i can seem to get it to show small screenshots of what ever app is running just the mini icon.

Exactly my problem too…but I posted part of my problem in the FvwmThumbnail thread because I am having issues with both

:bulb: Sounds like you need to set NoDeskHiight in your pager config :bulb:

I had this problem when I first tested the BigPager idea. I don’t know why my current setup works without it.

It’s becuase you are the Supreme Magical Czar of Fvwm :wink:

I thought that was Thomas :slight_smile:

Do I take it that setting NoDeskHilight worked?

Sorry i havent psted back been a long weekend. But yes NoDeskHilight work nicely.

Yes, it worked. And I didn’t realize that role of Czar was already taken. I guess you are the Prince.

I do have another question about your Colorset code:

SetEnv cset_wall_1 10 SetEnv cset_wall_2 20 SetEnv cset_wall_3 30 SetEnv cset_wall_4 40

I understand about the SetEnv but the numbers 10 20 30 40. What are they for?

I ask because I use the same in my BigPager but I have some blue and that shows thru at times and I wondered if I had my colors wrong