Clean and (can be) green.

Well, Firefox IS my all applications for now :slight_smile: I have just started to use Linux and also Gentoo so I’m still learning. I still have to use Windowz for “serious things” like gaming and using email but I’m slowly trying to make Linux as my primary system. With fresh Gentoo install that is not a very fast thing to accomplish…

But I don’t have the script :wink: You have to update the tar so we can dowload and try it :laughing:

BTW can fvwm identify the screen resolution setting? That way one could easily:

Use/scale the correct background image (like yours have the “hardcoded” bar for dock)
Use/scale the icons correcly
Scale the tumbnails correctly in relation to the screen
etc.

I guess that if any window manager could do it, it had to be fvwm.

Well welcome aboard then! If you get tired of Gentoo’s compile times (heh), I’d highly recommend Archlinux myself. It has i686 optimized binary packages so it’s fast to install programs and programs themselves are fast. :wink:

heh, oops… now it’s in there.

It certainly can and it’s pretty trivial to make those changes just about everywhere. The only problem is that the dock tint effect (where the icons look like they come out of the tinted dock) is actually integrated into the wallpaper. So it’d be tricker to get that to work nicely, plus I haven’t had the motivation to work on it heh. I’m hoping someone will come along and do it for me :slight_smile:

Thanks! Compiling times can really be long with big software but I think I won’t be doing that too often. I like the way I’m able to make Gentoo as simple and small (and fast) as possible. Maybe that is possible also with Archlinux. But thanks for the suggestion.

Actually I didn’t even need it. I made an attempt myself, see below for the code.

I though that with resolution detection one could easily downscale the original wallpaper to correct size. That should’n take too long. And maybe the tinting could be done “on the fly” using some transcluent thingy? (I still know nothing about fvwm :blush: )

But here is the code I was talking about. I also added shadow casting and a few command line options. Now you can control the scaling quality and the shadow direction. I’ll add also antialiasing setting and maybe shadow distance later on. The formatting might be screwed…

You also have to edit fvwm2rc.thumbnails properly. Direction is an integer between 0 and 360. 0 points up. Quality is an integer starting from 1 (lowest quality, fastest rendering). It might be full of bugs. I’ll post the fully featured code later.

[code]
#include <X11/Xlib.h>
#include <Imlib2.h>
#include <stdio.h>
#include <string.h>
#include <math.h>

int main(int argc, char **argv) {
Display *display;
XWindowAttributes windowattr;
Imlib_Image image, shadow_image;
Imlib_Image icon;
int windowid, thumbwidth, thumbheight;
char *imageformat, *imagepath;
char *iconformat, *iconpath;
int scale_quality;
int shadow_direction;
int shadow_x_offset, shadow_y_offset;
int w, h;

    if ( argc != 7 ) {
   		puts("Usage: thumb WindowId ThumbWidth ThumbFile IconFile ScaleQuality ShadowDirection");
   		return 1;
}
    
    sscanf(argv[1], "%x", &windowid);
    sscanf(argv[2], "%d", &thumbwidth);
    imagepath = argv[3];
    imageformat = strrchr(argv[3], '.');
    iconpath = argv[4];
    iconformat = strrchr(argv[4], '.');
    sscanf(argv[5], "%d", &scale_quality);
    sscanf(argv[6], "%d", &shadow_direction);
    if ( (display = XOpenDisplay(NULL)) == NULL ) return 1;
   	
    XGetWindowAttributes(display, windowid, &windowattr);
    
    thumbheight = (int)((float)windowattr.height * (float)thumbwidth / (float)windowattr.width);

    imlib_context_set_anti_alias(1);
    imlib_context_set_display(display);
    imlib_context_set_visual(DefaultVisual(display, DefaultScreen(display)));
    imlib_context_set_colormap(DefaultColormap(display, DefaultScreen(display)));
    imlib_context_set_drawable(windowid);

    if ( scale_quality*thumbwidth < windowattr.width || scale_quality*thumbheight < windowattr.height ) {
            image = imlib_create_scaled_image_from_drawable((Pixmap)0, 0, 0,windowattr.width, windowattr.height, scale_quality*thumbwidth, scale_quality*thumbheight, 1, 1);
            imlib_context_set_image(image);
            image = imlib_create_cropped_scaled_image(0, 0, scale_quality*thumbwidth, scale_quality*thumbheight,thumbwidth, thumbheight);			     				           
     } else {
            image = imlib_create_image_from_drawable((Pixmap)0, 0, 0, windowattr.width, windowattr.height, 1);
            imlib_context_set_image(image);
            image = imlib_create_cropped_scaled_image(0, 0, windowattr.width, windowattr.height,thumbwidth, thumbheight);     
    }

    icon = imlib_load_image(argv[4]);
    imlib_context_set_image(icon);
    w = imlib_image_get_width();
    h = imlib_image_get_height();
    imlib_context_set_image(image);
    imlib_blend_image_onto_image(icon, 0 ,0 , 0, w, h, 0, 0, w, h);

    shadow_image = imlib_create_image(thumbwidth+18, thumbheight+18);
    imlib_context_set_image(shadow_image);
    imlib_image_set_has_alpha(1);
    imlib_context_set_color(0, 0, 0, 170);
    shadow_x_offset = sin (2 * M_PI * ((float)shadow_direction) / 360) * 6 + 9;
    shadow_y_offset = -cos (2 * M_PI * ((float)shadow_direction) / 360) * 6 + 9;
    imlib_image_fill_rectangle(shadow_x_offset, shadow_y_offset, thumbwidth, thumbheight);
    imlib_image_blur(3);

    imlib_blend_image_onto_image(image, 1, 0, 0, thumbwidth, thumbheight, 9, 9, thumbwidth, thumbheight);

    imlib_image_set_format(imageformat + 1);
    imlib_save_image(argv[3]);

    fprintf(stdout, "WindowStyle IconOverride, Icon %s\n", argv[3]);
    return 0;

} [/code]

Edited: x and y offsets were 3 points in wrong direction :slight_smile: Now corrected above. Also changed to use M_PI defined in math.h. Original value had too few digits and some rounding errors occured.

I won’t dwell on this any longer but let me just say that I used to think Gentoo was fast and simple until I tried Arch. But that is just one man’s opinion…

All you really need to know is that fvwm uses $[w.width] and $[w.height] for the screen’s width and height in pixels. I suppose if imlib2 is fast enough, we could simply take a standard wallpaper and resize it and add the tint on every fvwm startup and people wouldn’t even notice. Maybe I’ll give it a shot this weekend, it sucks that I can’t get a higher resolution than 1024x768 on this laptop though…

Very cool, thanks Paapaa! I’ll give it a shot right now.

Very nice, works pretty well. There does seem to be a small bug somewhere though - when I specify 145 as the angle, indeed the shadow goes to the bottom-right but I can also see a faint shadow to the top of the thumbnail still.

This is not only ur opinion, it´s mine too. i can´t see any speed differences between a gentoo stage1 install and my Arch. Bu one BIG difference between this to is installing Arch and installing software in Arch is 100000000000000000000000000000x faster than in gentoo :wink:

I´m using fvwm since some month (my config and screeny) and i´m looking forward to make some Arch-related menus, like “sync-pacman”, “list all updates”, “start/stop deamons”, “list new available packages at AUR” … . Problem IS, i´m not good in programming. I can do simple things in bash. I´m learning python and try to improve “bashing”. So what would u think about this ideads? Are u able to do such things?

legout

[color=red]Edited by theBlackDragon:
→ Please reserve distro wars for TheTavern, tia.[/color]

[quote=“legout”]
Problem IS, i´m not good in programming. I can do simple things in bash. I´m learning python and try to improve “bashing”. So what would u think about this ideads? Are u able to do such things?

legout

[color=red]Edited by theBlackDragon:
–> Please reserve distro wars for TheTavern, tia.[/color]

sorry for continuing this off-topic thing, but you might want to take a look at the configs of gulivert. they include a menu that does this for gentoo.

Johan

Well, if imlib2 can resize windows on the fly it can do it easily at startup with no practical overhead. I’ll also try it as that is really the best way to learn FVWM (or C).

Maybe I should RTFM but I’ll ask you instead :slight_smile:

  1. How do you alter the placement of iconified windows?

  2. And what ways there are to add a small text under/on them telling which program it is?

Hmm, I coudn’t reproduce it. Can you tell the size of the thumbnails you were using (and was it in 1024x768?) Tell me also the size of the original window so I can try it out. I’m now in another town so I can try it again tomorrow or on Monday.

OT, Closing statement: The nice thing is that everyone can choose a Linux distro that fulfills their special needs: ease of use, simplicity, customization, default eye candy, speed, possibility to compile from sources (and edit them), package support, pace of updates or helpful and large community. Linux world is thus always a win-win situation :slight_smile: The same goes to window managers and that is why we are here talking about iconifying windows in FVWM, and not compiling our Gnome packages :slight_smile:

euh, sorry it wasn’t my intention to talk about distro’s.
I don’t even know arch-linux, never used it, never even visited their website. I just wanted to point ‘legout’ to a config that more or less did the same that he wanted to do. so why not use it?

ok, I understand this doesn’t belong in the screenshots and configs-part of the forum, so if you want to delete my posts, I don’t mind. I was just trying to help legout in pointing him to usefull info so he wouldn’t need to write all the scripts himself. I understand arch and gentoo are somhow connected, that’s why I pointed him to gulli’s config. I know these things are distro specific, but I don’t care about what distro somebody is using. everybody uses the one he likes, nothing can change that.
that’s why I said ‘sorry for continuing this off-topic thing’…

good luck, please continue the original thread :wink:

No problem at all, I was just warning people off, getting into a distro war is often all too tempting… :wink:

It was very easy to implement, but you just have to use $[vp.width] and $[vp.height]. Vp = viewport, w = window. Didn’t try tinting yet. The speed is not an issue at startup.

The bug was because Imlib didn’t initialize a newly created image. The alpha channel has to be emptied before drawing the shadow rectangle. Now it works. The code in this thread is not updated though…

Looks very nice, philipp. I don’t know that the green window deco goes so well with your reddish background but I otherwise dig it :slight_smile:

A couple updates… I switched the wm decoration to a theme inspired by the Tyrex theme of xfce. I was getting really tired of the metabox-like theme. See the screenshot below for what the tyrex deco looks like.

I also implemented some functionality that allows your terminal to drop from the top of the screen. Pressing F1 basically unshades the window (which is just off the top of the screen) and pressing it again shades it. It acts like the tilda program except it doesn’t take 13mb of ram. To use it, just be sure to replace the ‘SetEnv TermName urxvt’ line in the config file with whatever terminal you use.

config

Stonecrest your screenshots never cease to amaze me. They are always so simple yet extremly functional and easy on the eye.

I LOVE this config. I think its amazing and I really would like to use it. BUT, Im on a laptop that has a native resolution of 1280x(something…iforgot :slight_smile: )

anyway, this only 1024x768 b0rk is the only thing from keeping me from enjoying this completely. I have messed with it as much as I know how, but im not exactly sure how I can fix it.

I really want this to work because this CONFIG is the reason I switched to FVWM.

Thanks linkunderscore (and voider). I’ll see if I can work on getting the config working for all resolutions later in the week. I think Paapaa has already done some work on this, it’d be great if he could show us what he’s done if he sees this… I think he already got the wallpaper to be automatically resized and have the tint added on each fvwm start. That’s really the only part that is going to cause me a bit of trouble, but I guess I should just read up on imlib2. :stuck_out_tongue:

Anyway, I’ve just added an ActiveDown icon to the window decoration so that you get some visual feedback when you click on the close/max/min buttons. I’m not sure why I didn’t do that to begin with heh.

Awesome…

I can’t wait!!

I don’t know if this has anything to do with the 1024x768 issue, but the MPD player isn’t working for me, nor is the gamestyle terminal. I commented out the terminal code because it would just keep loading and loading during start up.

Also, I am not able to switch between workspaces. It is as if I only have one desktop. NVM I spoke too soon. I can switch between workspaces if i drag a app over to one but the right-click “send-to” doesn’t work.

I think all of these are issues because it is hard wired to 1024x768 but I don’t know. Any insight would be wonderful :slight_smile:

I REALLY love this design, layout, and implementation. You are a God amoung men :slight_smile:

For the MPD controls to work, you need mpc and ncmpc installed (read the README).

Assuming you set your terminal in the config file, I guess your terminal uses something other than the -name flag to specify a name for it. Either find out what the flag is and change it in the config file, or switch to urxvt :wink:

Hmm, you’re right, the ‘Send to’ isn’t working now, weird… I’ll fix it soon. FWIW, you can also use your mouse wheel on the desktop to switch workspaces, although that obviously doesn’t help you move apps back and forth heh.

Hope that helps.

That does help :slight_smile:

I have both mpc and ncmpc installed. Maybe im missing something here? I can’t click on anything down there except for the calendar (which is showing towards the middle of my desktop because its coded for 1024x768 i guess :slight_smile:. I can fix that though.

I can’t wait until this works flawlessly :slight_smile: I am really excited about this. (if you couldn’t tell)

Okay, the Send To thing was pretty dumb… open the fvwm2rc.menus file, go to the very bottom, and change the two “$0” to “$*”. Or you can redownload the config, I just updated it.

Oh, I think I got it :blush: I have ncmpc to open with urxvt, I hardcoded my terminal in by accident. Try replacing urxvt at the bottom of the scripts/mpdSongName file with $[TermName] so that it looks like:

Do {exec $[TermName] -e ncmpc -m}

You might have to change the -e flag for your terminal as well… And you’ll have to restart fvwm.

Then you should be able to click the playlist button (rightmost button) and have ncmpc pop up. Let me know if that doesn’t work…