Taskbar with Thumbnails

Hi all,

I’m trying to make a taskbar with FvwmButtons. This taskbar contains a button for a start menu, a list of opened applications with her name and her thumbnails but i can’t display this thumbnails.

My .fvwm2rc :

[code]# BSDManiak’s fvwm2 configuration file

Directorys

SetEnv fvwm_composite “nice -n 0 xcompmgr -cCfF -r 10 -l 1 -t 1”
SetEnv fvwm_home $[HOME]/.fvwm
SetEnv fvwm_menu $[fvwm_home]/menu
SetEnv fvwm_icons $[fvwm_home]/icons
SetEnv fvwm_scripts $[fvwm_home]/scripts
SetEnv fvwm_wallpapers $[fvwm_home]/wallpapers
SetEnv localbase /usr/local
SetEnv bindir $[localbase]/bin

ImagePath $[fvwm_icons]:$[fvwm_icons];.png:+

Programs

SetEnv fvwm_webbrowser $[bindir]/konqueror
SetEnv fvwm_term $[bindir]/xterm
SetEnv fvwm_mail $[bindir]/kmail
SetEnv fvwm_media_player $[bindir]/rhythmbox
SetEnv fvwm_video_player $[bindir]/mplayer

Colorset

Colorset 3 RootTransparent fg white, bg average,
Tint black 60
Colorset 4 fg #4f4f3f, bg Translucent Black 60, hi White, sh White
Colorset 5 fg White, bg Black
Colorset 6 fg White, Translucent Black 60, hi White, sh White

Virtual Desktops

DesktopSize 3x3
EdgeScroll 100 100
EdgeResistance 500
EdgeThickness 1

Mouse And Focus

MoveThreshold 3
Style * SloppyFocus, MouseFocusClickRaises

Functions For Init, Start, Exit & Restart

DestroyFunc StartFunction
AddToFunc StartFunction

  • I Module FvwmButtons TaskBar
  • I Module FvwmEvent

DestroyFunc InitFunction
AddToFunc InitFunction

  • I Exec exec fvwm-root -r $[fvwm_wallpapers]/background.xpm
  • I Exec exec $[fvwm_composite]

DestroyFunc ExitFunction
AddToFunc ExitFunction

  • I Exec exec rm -rf /tmp/fvwm

DestroyFunc RestartFunction
AddToFunc RestartFunction

  • I Nop

Functions For Windows Bindings

DestroyFunc FvwmDeleteOrDestroy
AddToFunc FvwmDeleteOrDestroy

  • H Nop
  • M Nop
  • C Delete
  • D Destroy

DestroyFunc FvwmIconifyOrShade
AddToFunc FvwmIconifyOrShade

  • C Iconify
  • D WindowShade

DestroyFunc FvwmMaximize
AddToFunc FvwmMaximize

  • H Nop
  • M Nop
  • C Maximize $0 $1

Thumbnails Functions

DestroyFunc Thumbnail
AddToFunc Thumbnail

  • I ThisWindow PipeRead
    “mkdir -p /tmp/fvwm; xwd -silent -id $[w.id] | convert -scale 80
    -quality 0 xwd:- png:/tmp/fvwm/icon.tmp.$[w.id].png &&
    echo *TaskBar: (11x1, Frame 0, Icon /tmp/fvwm/icon.tmp.$[w.id].png)”

DestroyFunc DeThumbnail
AddToFunc DeThumbnail

  • I ThisWindow PipeRead “rm -f /tmp/fvwm/icon.tmp.$[w.id].png”

DestroyModuleConfig FvwmEvent: *
*FvwmEvent: raise_window Thumbnail
*FvwmEvent: add_window “Schedule 250 Thumbnail”
*FvwmEvent: focus_change Thumbnail
*FvwmEvent: deiconify “Schedule 500 Thumbnail”
*FvwmEvent: dewindowshade “Schedule 500 Thumbnail”
*FvwmEvent: destroy_window DeThumbnail

Menus & Windows Bindings

AddToMenu RootMenu “Root Menu” Title

  •                   "XTerm"         Exec exec xterm
    
  •                   ""              Nop
    
  •                   "Refresh Screen"   Refresh
    
  •                   "Recapture Screen" Recapture
    
  •                   ""              Nop
    
  •                   "Exit Fvwm"     Quit
    
  •                   "Restart Fvwm"      Restart
    

Mouse 1 R A WindowList Root c c NoDeskSort
Mouse 3 R A Menu RootMenu
Mouse 1 2 A FvwmDeleteOrDestroy
Mouse 1 4 A FvwmMaximize 100 84
Mouse 1 6 A FvwmIconifyOrShade

Menus Style

MenuStyle “" MenuColorset 6
MenuStyle "
” ActiveColorset 4
MenuStyle “" BorderWidth 0
MenuStyle "
” Font “xft:Sans:size=13:antialias=True”
MenuStyle “" PopupDelayed, PopupDelay 300, PopdownImmediately
MenuStyle "
” PopupOffset -5 100, TitleWarpOff
MenuStyle “" SeparatorsLong, TrianglesSolid
MenuStyle "
” PopupAsSubmenu, HoldSubmenus, SubmenusRight
MenuStyle “" ItemFormat “%|%5.5i%1.3l%2.3>%|”
MenuStyle "
” VerticalItemSpacing 1 1, VerticalTitleSpacing 2 2
MenuStyle “" ActiveFore, Hilight3DOff
MenuStyle "
” RoundedCorners

Windows Decors

DestroyDecor WindowsDecors
AddToDecor WindowsDecors

  • TitleStyle LeftJustified Height 32

  • ButtonStyle 2
    ActiveUp (Pixmap $[fvwm_icons]/icon_close_pressed.xpm – Flat)
    ActiveDown (Pixmap $[fvwm_icons]/icon_close_inactive.xpm – Flat)
    Inactive (Pixmap $[fvwm_icons]/icon_close_inactive.xpm – Flat)

  • ButtonStyle 4
    ActiveUp (Pixmap $[fvwm_icons]/icon_maximise_pressed.xpm – Flat)
    ActiveDown (Pixmap $[fvwm_icons]/icon_maximise_inactive.xpm – Flat)
    Inactive (Pixmap $[fvwm_icons]/icon_maximise_inactive.xpm – Flat)

  • ButtonStyle 6
    ActiveUp (Pixmap $[fvwm_icons]/icon_reduce_pressed.xpm – Flat)
    ActiveDown (Pixmap $[fvwm_icons]/icon_reduce_inactive.xpm – Flat)
    Inactive (Pixmap $[fvwm_icons]/icon_reduce_inactive.xpm – Flat)

  • ButtonStyle 2 - Clear

  • ButtonStyle 4 - Clear MwmDecorMin

  • ButtonStyle 6 - Clear MwmDecorMax

  • TitleStyle AllActive MultiPixmap
    Main AdjustedPixmap $[fvwm_icons]/tb_main_active.png

  • TitleStyle AllInactive MultiPixmap
    Main AdjustedPixmap $[fvwm_icons]/tb_main_inactive.png

  • TitleStyle – Flat

  • BorderStyle Simple – NoInset Flat

  • ButtonStyle All – UseTitleStyle

Windows Decors

Style “" UseDecor WindowsDecors
Style "
” Font “xft:sans:bold:size=10:antialias=True”
Style “" BorderWidth 2, HandleWidth 1
Style "
” MWMBorder, FirmBorder
Style “*” RoundedCorners

TaskBar

Style “TaskBar” NoTitle, StaysOnBottom, Sticky, WindowListSkip,
CirculateSkipIcon, CirculateSkip, HandleWidth 0, BorderWidth 0,
NeverFocus, Layer 1

DestroyModuleConfig TaskBar: *
*TaskBar: BoxSize fixed
*TaskBar: Colorset 3
*TaskBar: Columns 100
*TaskBar: Row 900
*TaskBar: Geometry 900x100+62+655
*TaskBar: Frame 0
*TaskBar: Padding 0 0
*TaskBar: (11x1, Frame 0, Icon $[fvwm_menu]/start_button.png,
Action(Mouse 1) Menu RootMenu rectangle \ $widthx$height+83+656 o+50 -100m)
*TaskBar: (5x1, Frame 0, Icon $[fvwm_menu]/separator.png)[/code]

Thanks

Shell basics 101 – USE MORE QUOTES:

echo '*TaskBar: (11x1, Frame 0, Icon /tmp/fvwm/icon.tmp.$[w.id].png)'"

Then it might work. But there’s still a lot wrong with this config, as you’ll see if you read:

viewtopic.php?f=40&t=1505

– Thomas Adam

I have trying this but i search an option for reload my configuration when I had +I Module FvwmButtons TaskBar in my thumbtails function, tt’s Open others taskbar. Have you any idea for making good this ? I have trying refresh 5 option in TaskBar configuration but it’s not work.

Given this is just an FvwmButtons instance (unwiseky alised as TaskBar, as there’s a FvwmTaskBar module anyway), what you can do here is use SendToModule to send a message to the TaskBar to update the icon, hence:

*TaskBar: (11x1, Id "A", Frame 0, Icon /tmp/fvwm/icon.tmp.$[w.id].png)

And then your line in Thumbnail becomes:

echo 'SendToModule TaskBar ChangeButton A Icon /tmp/fvwm/icon.tmp.$[w.id].png'

– Thomas Adam

Thanks i see now one of my thumbs in my taskbar. I’m works now for have it usefull.

I Search the syntaxe for executing a command and take the result in a variable. I have trying this ]DestroyFunc Calc_Marge
AddToFunc Calc_Marge

  • I SetEnv nb_apps=exec /bin/cat $[fvwm_tmp]/apps
  • I SetEnv margin-left=exec /bin/print "%s\n" \($[nb_apps]-1\)*90+176 | exec /bin/bc
    [/code]

But i have this error :

sh: no closing quote

Do you somehow delight in making up your own syntax? As you will see here:

edulinux.homeunix.org/~n6tadam/f … fhobia.txt

You will want to use the shell to expand your statement. Remember, any kind of calculation, albeit arithemtic, expansion, etc., has to be done at the shell. You hence mean:

+ I PipeRead `echo SetEnv nb_apps $(< $[fvwm_tmp]/apps)`
+ I PipeRead `echo SetEnv margin-left $(($[nb_apps]-1*90+176))`

Do you understand now why you were wrong?

Note also – what the hell os $[fvwm_tmp] and why the hell isn’t it just $[FVWM_USERDIR]?

– Thomas Adam

Yes i have undestood thanks for you explain.
$[fvwm_tmp] has been setted by me. I think it’s more cleanly to use another directory for my thumbnails (/tmp/fvwm/) here

Or just use your ImagePath. Again, see:

viewtopic.php?f=40&t=1505

I’ve told you to read this before.

– Thomas Adam

I use fvwm_tmp not only for thumbnails. When i finish my conf i explain this. But you have right i can add fvwm_tmp to ImagePath.