Some problems with dock and thumbnails [COMPLETELY RESOLVED]

I’m currently working on using a dock for program starting, trayer, clock etc. and using thumbnails (the Taviso® method) for minimized applications

  • When executing “All Iconify on”, all programs disappear, but they don’t show up as thumbnails - should I use FvwmEvent, and if so, which syntax should I use with it?

  • I want to center my FvwmButtons-based dock. Although I’ve read a similar post in the forum, I didn’t understand the solution. Can anybody help me with this thing?

  • How to set the direction in which the thumbnails are ordered? At the moment they are ordered from up to down, but I want to make them go from left to right!

  • When maximizing a window, I want it to leave some space above and below the application. I can just get it to leave space above OR below, but never both.

I would be very happy if you could me resolve those things! :stuck_out_tongue:

Try calling “All ” instead. Presumably your thumbnail func has a “+ I Iconify” in it, so everything should be good.

If you mean automatically center it, it’s a bit complicated. You’ll need to use PipeRead and calculate the coordinates. Someone else can probably give better details.

Look at IconBox and IconFill in the man pages.

“EwmhBaseStruts 0 0 50 50” or something along those lines should work.

If you’re using 2.5.X you can do:

Style MyFvwmButtonsAlias CenterPlacement

Your other questions have been answered.

– Thomas Adam

Wow - thanks a lot, everything has worked :smiley: - except the Panel. :confused:

I will see if FVWM writes any error messages … wait a moment.

EDIT: No error messages, I give you the relevant code parts:

Style PanelBar    CenterPlacement

AddToFunc StartFunction
+ I Module FvwmButtons PanelBar


# Panel
*PanelBar: BoxSize smart
*PanelBar: Columns 256
*PanelBar: Rows $[panel_height]
*PanelBar: Frame 0
*PanelBar: Colorset 3
*PanelBar: ActiveColorset 3
*PanelBar: PressColorset 3
#*PanelBar: Geometry 1024x$[panel_height]+0-0
*PanelBar: Padding 0 0
*PanelBar: Pixmap none
*PanelBar: (32x$[panel_height] Icon term.png,      Action FuncFvwmStartApp "$[fvwm_term] -fn 6x14 -sl 1000" terminal.ogg)
*PanelBar: (32x$[panel_height] Icon firefox.png,   Action FuncFvwmStartApp firefox firefox.ogg)
*PanelBar: (32x$[panel_height] Icon sylpheed.png,  Action FuncFvwmStartApp sylpheed sylpheed.ogg)
*PanelBar: (32x$[panel_height] Icon et.png,        Action FuncFvwmStartApp "esddsp32 --mmap et" et.ogg)
*PanelBar: (32x$[panel_height] Icon audacious.png, Action FuncFvwmStartApp audacious audacious.ogg)
*PanelBar: (32x$[panel_height] Icon ooffice.png,   Action FuncFvwmStartApp ooffice2 openoffice.ogg)
*PanelBar: (64x$[panel_height], Swallow "FvwmPager" "FvwmPager 0 0", Action (Mouse 4) FuncFvwmPreviousPage, Action (Mouse 5) FuncFvwmNextPage)
*PanelBar: (64x$[panel_height], Swallow "xdaliclock" `Exec exec xdaliclock -transparent -noseconds -font "-cronyx-fixed-*-*-*-*-12-*-*-*-*-*-*-*"`, Action (Mouse 1) FuncFvwmMinimizeAll)
*PanelBar: (64x$[panel_height], Swallow "xystray" `Exec exec xystray -iconmax 1`)

I use FVWM 2.5.14.

I’ve also tried the code described in this post. It didn’t work too. It just seemed as if the centering function didn’t do anything.

Don’t you have any more advice for me? :frowning:

Sure. Was you expecting it in a timely-on-demand basis? Only, I do
(surprisingly) do other things than just answer questions here. I’m a
volunteer.

The CenterPlacement style option does work – depending on which version
of FVWM you’re using. If you’re using 2.4.x, then see the FVWM main FAQ
for how to centre windows – you need to use PipeRead to do it.

If you’re using 2.5.x (and the version you have isn’t 2.5.15 – the latest
version at the time of writing), I suggest you upgrade to it. Although
this style option has been working in prior versions since then.

It would also be nice to see the exact commands you’re using in your
.fvwm2rc file.

– Thomas Adam

Sorry - I didn’t want to sound offending. It’s just the thing that you answered to some other threads in the mean time and you had forgotten about this problem. I’m very grateful for your taking time to answer my question(s)!

Well, just yesterday FVWM 2.5.15 appeared in Gentoo Portage and I installed it today. Unfortunately, the CenterPlacement option still doesn’t work, but I have to say thanks to the developers because now my 6th mouse button is supported a bit better!

Here is my .fvwm2rc - note that I’ve written “Panel centering attempt <----------------” to the lines where I had modified my config to achieve a centered panel:

SetEnv fvwm_home $[HOME]/.fvwm
SetEnv fvwm_icon $[fvwm_home]/icons
SetEnv fvwm_scrpt $[fvwm_home]/scripts
SetEnv fvwm_audio $[fvwm_home]/audio

SetEnv fvwm_img $[HOME]/media/images
SetEnv fvwm_wallpapers $[fvwm_img]/wallpaper
SetEnv fvwm_thumbnails $[fvwm_home]/.thumbnails

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

SetEnv fvwm_webbrowser /usr/bin/firefox
SetEnv fvwm_term /usr/bin/aterm
SetEnv fvwm_mail /usr/bin/sylpheed
SetEnv fvwm_audio_player /usr/bin/audacious
SetEnv fvwm_video_player /usr/bin/mplayer
SetEnv fvwm_silent_player /usr/bin/ogg123


SetEnv panel_height 32
SetEnv icon_width 128
SetEnv icon_height 64

EwmhBaseStruts 0 0 $[icon_height] $[panel_height]


EdgeResistance 250 10
EdgeScroll 100 100
ClickTime 750

DesktopSize 2x2



CleanupColorsets
# BottomPanel
Colorset 0 fg white, bg grey,fgsh #444444,sh #000066,hi blue
# Menu
Colorset 1 fg white , bg grey,fgsh black,sh #666666,hi #bbbbff, Transparent buffer, tint #bbbbff 50
# Active menuitem
Colorset 2 fg yellow, bg grey,fgsh #444444,sh #666666,hi #bbbbff, Transparent buffer, tint #bbbbff 50
# PanelBar, Icontitle
Colorset 3 RootTransparent,fg white ,fgsh black, bg grey,fgsh #444444,sh #000066 ,hi blue
# Title bar + buttons - inactive
Colorset 4 NoShape, RootTransparent Buffer, Tint #f6f6f6 20,bg #909090
# Title bar - active
Colorset 5 NoShape, RootTransparent Buffer, Tint #bbbbff 50,bg #909090


MenuStyle * MenuColorset 1, ActiveColorSet 2
MenuStyle * Font "StringEncoding=UTF-8:xft:Utopia:size=10"
ColormapFocus FollowsMouse


# Styles
Style *	          Font "xft:Utopia:size=10"
Style *	          IconFont "xft:New Century Schoolbook:size=14"
Style *           HilightFore black, HilightBack palevioletred
Style *           BorderWidth 5, HandleWidth 5
Style *           DecorateTransient, NoPPosition
Style *           ClickToFocus
Style *           ResizeOpaque
Style *           NoIcon
Style *           IconBox -30x240-1-1, IconFill top left

# Styles for various Fvwm modules:
Style Fvwm*       NoTitle, Sticky, WindowListSkip, CirculateSkip, CirculateSkipIcon, !Borders, !Iconifiable


# Panel centering attempt <--------------------------------------------
Style PanelBar    CenterPlacement

# Styles for other programs
Style audacious   NoTitle, !Borders
Style Blender     NoTitle, !Borders
Style gkrellm     NoTitle, !Borders, WindowListSkip


Colorset 12 fg white, bg black, fgsh black, RootTransparent
Style * IconTitle, IconTitleColorset 12, HilightIconTitleColorset 12, IconTitleRelief 0
Style * IconFont "xft:Aquafont:size=11minspacing=True", IndexedIconName, IconBackgroundPadding 2,
Style * IconBackgroundRelief 0, IconBackGroundColorset 12


# Alt+F4 closes a window
Key F4 WFST M FuncFvwmClose
# Ctrl+Shift+F4 kills a window
Key F4 WFST CS FuncFvwmDestroy

Key Space R A Menu MenuFvwmRoot Nop

# some simple default mouse bindings:
#   for the root window:
Mouse 2 R       A       Menu MenuFvwmWindowOps Nop
Mouse 3 R       A       Menu MenuFvwmRoot Nop
Mouse 4 R       A       FuncFvwmPreviousPage
Mouse 5 R       A       FuncFvwmNextPage

#   for the title bar buttons:
Mouse 0 1       A       FuncFvwmOpenWindowOps
Mouse 0 2       A       FuncFvwmClose
Mouse 0 4       A       FuncFvwmMaximize
Mouse 0 6       A       FuncFvwmMinimize
Mouse 0 I       A       Iconify

#   for other parts of the window/borders/icons:
Mouse 1 FT      A       FuncFvwmResizeOrRaise
Mouse 1 T       A       FuncFvwmMoveOrRaise
Mouse 3 TSIF    A       RaiseLower

# Currently a bit unsupported ...
Silent Mouse 6 W       A       Move

######################## Initialization Functions ############################
AddToFunc StartFunction
+ I Module FvwmButtons PanelBar
# Panel centering attempt <--------------------------------------------
+ I Wait PanelBar
+ I Next (PanelBar) CentreHorizontally
+ I Exec exec fvwm-root --retain-pixmap $[fvwm_wallpapers]/.current-wallpaper-fvwm
+ I SnapAttraction 5
+ I Exec exec gaim
+ I Exec exec xscreensaver
+ I Exec exec xmodmap -e "pointer = 1 2 3 6 4 5"
+ I Exec exec $[fvwm_silent_player] $[fvwm_audio]/start.ogg

AddToFunc InitFunction
+ I exec xset m 1 1

AddToFunc ExitFunction
+ I Exec exec $[fvwm_silent_player] $[fvwm_audio]/exit.ogg
+ I Exec exec pkill xystray
+ I Exec exec pkill xscreensaver


######################## Menus ###################
DestroyMenu MenuFvwmRoot
AddToMenu MenuFvwmRoot  "Menü"                  Title
+ MissingSubmenuFunction FuncFvwmMenuDirectory
+                       "&A. Applications"      Popup MenuApplications
+                       "&G. Graphics"          Popup MenuGraphics
+                       "&M. Games"             Popup MenuGames
+                       "&U. Multimedia"        Popup MenuMultimedia
+                       ""                      Nop
+                       "&W. Wallpaper"         Popup MenuWallpaper
+                       "&S. Music"             Popup $[HOME]/media/audio
+                       ""                      Nop
+                       "&X. FVWM beenden"      Popup MenuFvwmQuitVerify




DestroyMenu MenuApplications
AddToMenu MenuApplications     "Applications"    Title
+ "Aterm"                 Exec aterm -fn 6x14 -sl 1000
+ "Filesystem Visualizer" Exec fsv
+ "Graveman"              Exec graveman
+ "GTK Theme Switch"      Exec switch2
+ "GVIM"                  Exec gvim
+ "MLDonkey"              Exec mlgui
+ "OpenOffice"            Exec ooffice2
+ "X-Chat"                Exec xchat-2
+ "Xsane"                 Exec xsane
+ "XScreensaver"          Exec xscreensaver-demo
+ "Xterm"                 Exec xterm 
+ "Xxdiff"                Exec xxdiff $[HOME] /mnt/backup/michi

DestroyMenu MenuGraphics
AddToMenu MenuGraphics     "Graphics"    Title
+ "Blender"  Exec blender
+ "Dia"      Exec dia
+ "GIMP"     Exec gimp
+ "Inkscape" Exec inkscape
+ "XFig"     Exec xfig
+ "XSane"    Exec xsane

DestroyMenu MenuGames
AddToMenu MenuGames        "Games"    Title
+ "Emulation"           Popup MenuEmulation
+ "Americas Army"       Exec armyops
+ "Battle of Wesnoth"   Exec wesnoth
+ "BZFlag"              Exec bzflag
+ "Celestia"            Exec celestia
+ "Construo"            Exec construo
+ "Dosbox"              Exec dosbox
+ "DROD"                Exec drod
+ "Frozen Bubble"       Exec frozen-bubble
+ "Project Starfighter" Exec starfighter
+ "Rocks'n'Diamonds"    Exec rocksndiamonds
+ "Trackballs"          Exec trckballs

DestroyMenu MenuEmulation
AddToMenu MenuEmulation    "Emulation"    Title
+ "Atari 800"          Exec cd $[HOME]/emulation/atari && atari800
+ "ZSNES"              Exec zsnes

DestroyMenu MenuMultimedia
AddToMenu MenuMultimedia   "Multimedia"    Title
+ "Audacious"      Exec audacious
+ "Audacity"       Exec audacity
+ "GMplayer"       Exec gmplayer
+ "PornView"       Exec pornview
+ "RipperX"        Exec ripperX
+ "Timidity"       Exec timidity -ig
+ "VLC"            Exec vlc

# The window Ops menus exhibit a different HotKey style.
# There are 2 versions of the WindowOps Menu, meant to be bound to different
# things.  Here is the "common" part:
DestroyFunc FuncFvwmWindowCommon
AddToFunc FuncFvwmWindowCommon
+ I AddToMenu $0 "Lösche"		Delete
+ I AddToMenu $0 "Schließe"     Close
+ I AddToMenu $0 "Zerstöre"     Destroy
+ I AddToMenu $0 ""             Nop

# First windowops menu, bound to:
DestroyMenu MenuFvwmWindowOps
AddToMenu MenuFvwmWindowOps     "Fenster"    Title
FuncFvwmWindowCommon MenuFvwmWindowOps


DestroyMenu MenuFvwmQuitVerify
AddToMenu MenuFvwmQuitVerify "$[gt.Really Quit Fvwm?]" Title
+ "&Q. $[gt.Yes, Really Quit]" Quit
+ "&N. $[gt.No, Don't Quit]"   Nop
+ ""                     Nop
+ "&R. $[gt.Restart]"          Restart

######################## Functions ##########################

DestroyFunc FuncFvwmOpenWindowOps
AddToFunc FuncFvwmOpenWindowOps
+ I Exec exec $[fvwm_silent_player] $[fvwm_audio]/windowops.ogg
+ I Menu MenuFvwmWindowOps Close

DestroyFunc FuncFvwmClose
AddToFunc   FuncFvwmClose
+ I Close
+ I Exec exec $[fvwm_silent_player] $[fvwm_audio]/close.ogg

DestroyFunc FuncFvwmDestroy
AddToFunc   FuncFvwmDestroy
+ I Destroy
+ I Exec exec $[fvwm_silent_player] $[fvwm_audio]/destroy.ogg

DestroyFunc FuncFvwmMaximize
AddToFunc FuncFvwmMaximize
+ I Maximize
+ I Exec exec $[fvwm_silent_player] $[fvwm_audio]/maximize.ogg



*FvwmEvent: deiconify FuncFvwmUnMinimize

DestroyFunc FuncFvwmMinimize
AddToFunc FuncFvwmMinimize
+ I Raise
+ I ThisWindow (!Iconic) SetEnv Icon-$[w.id] $[w.iconfile]
+ I ThisWindow (!Shaded, Iconifiable, !Iconic) PipeRead \
    "xwd -silent -id $[w.id] | convert -resize $[icon_width]x$[icon_height] \
    -mattecolor black -quality 0 xwd:- png:$[fvwm_thumbnails]/icon.tmp.$[w.id].png \
    && echo WindowStyle IconOverride, Icon $[fvwm_thumbnails]/icon.tmp.$[w.id].png \
    || echo Nop"
+ I TestRc (Match) Test (f $[w.miniiconfile], f $[fvwm_thumbnails]/icon.tmp.$[w.id].png) PipeRead \
    "composite -geometry +2+4 $[w.miniiconfile] $[fvwm_thumbnails]/icon.tmp.$[w.id].png \
    $[fvwm_thumbnails]/icon.tmp.$[w.id].png; echo Nop"
+ I Iconify
+ I Exec exec $[fvwm_silent_player] $[fvwm_audio]/minimize.ogg

DestroyFunc FuncFvwmUnMinimize
AddToFunc FuncFvwmUnMinimize
+ I PipeRead "echo Test \\(i \\$\\[Icon-$[w.id]\\]\\) WindowStyle Icon \\$\\[Icon-$[w.id]\\]"
+ I TestRc (NoMatch) WindowStyle NoIconOverride, Icon
+ I Exec rm -f $[fvwm_thumbnails]/icon.tmp.$[w.id].png
+ I All (Iconic, CurrentPage) PlaceAgain icon
+ I UnsetEnv Icon-$[w.id]


DestroyFunc FuncFvwmMinimizeAll
AddToFunc FuncFvwmMinimizeAll
+ I All FuncFvwmMinimize
+ I Exec exec $[fvwm_silent_player] $[fvwm_audio]/minimizeall.ogg

DestroyFunc FuncFvwmNextPage
AddToFunc   FuncFvwmNextPage
+ I Scroll 100000 0
+ I Exec exec $[fvwm_silent_player] $[fvwm_audio]/pageswitch.ogg

DestroyFunc FuncFvwmPreviousPage
AddToFunc   FuncFvwmPreviousPage
+ I Scroll -100000 0
+ I Exec exec $[fvwm_silent_player] $[fvwm_audio]/pageswitch.ogg



DestroyFunc FuncFvwmMoveOrRaise
AddToFunc FuncFvwmMoveOrRaise
+ I Raise
+ M Move
+ D Lower

DestroyFunc FuncFvwmResizeOrRaise
AddToFunc FuncFvwmResizeOrRaise
+ I Raise
+ M Resize
+ D Lower

# Panel centering attempt <--------------------------------------------
DestroyFunc CentreHorizontally
AddToFunc   CentreHorizontally
+ I PipeRead "echo $2Move $$(((($[vp.width]-$[w.width])/2)))p keep" 

# Panel
*PanelBar: BoxSize smart
*PanelBar: Columns 1024
*PanelBar: Rows $[panel_height]
*PanelBar: Frame 0
*PanelBar: Colorset 3
*PanelBar: ActiveColorset 3
*PanelBar: PressColorset 3
*PanelBar: Geometry 640x$[panel_height]+0-0
*PanelBar: Padding 0 0
*PanelBar: Pixmap none
*PanelBar: (32x$[panel_height] Icon term.png,      Action FuncFvwmStartApp "$[fvwm_term] -fn 6x14 -sl 1000" terminal.ogg)
*PanelBar: (32x$[panel_height] Icon firefox.png,   Action FuncFvwmStartApp firefox firefox.ogg)
*PanelBar: (32x$[panel_height] Icon sylpheed.png,  Action FuncFvwmStartApp sylpheed sylpheed.ogg)
*PanelBar: (32x$[panel_height] Icon et.png,        Action FuncFvwmStartApp "esddsp32 --mmap et" et.ogg)
*PanelBar: (32x$[panel_height] Icon audacious.png, Action FuncFvwmStartApp audacious audacious.ogg)
*PanelBar: (32x$[panel_height] Icon ooffice.png,   Action FuncFvwmStartApp ooffice2 openoffice.ogg)
*PanelBar: (64x$[panel_height], Swallow "FvwmPager" "FvwmPager 0 0", Action (Mouse 4) FuncFvwmPreviousPage, Action (Mouse 5) FuncFvwmNextPage)
*PanelBar: (64x$[panel_height], Swallow "xdaliclock" `Exec exec xdaliclock -transparent -noseconds -font "-cronyx-fixed-*-*-*-*-12-*-*-*-*-*-*-*"`, Action (Mouse 1) FuncFvwmMinimizeAll)
*PanelBar: (64x$[panel_height], Swallow "xystray" `Exec exec xystray -iconmax 1`)


# Pager
DestroyModuleConfig FvwmPager: *
#*FvwmPager: MiniIcons
*FvwmPager: Font "none"
*FvwmPager: Colorset * 3
*FvwmPager: HighlightColorset * 3
# HighlightColorset maybe needs to be fixed? <--------------------



# Wallpaper
DestroyMenu MenuWallpaper
AddToMenu   MenuWallpaper foo title
+ DynamicPopupAction Function WallpaperBrowser


DestroyFunc WallpaperBrowser
AddToFunc   WallpaperBrowser
+ I DestroyMenu recreate MenuWallpaper
+ I AddToMenu MenuWallpaper "Wallpaper" title
+ I PipeRead '$[fvwm_scrpt]/wallpaper.sh $[fvwm_wallpapers] $[fvwm_thumbnails]'



# Music browser
DestroyFunc FuncFvwmMenuDirectory
AddToFunc FuncFvwmMenuDirectory   
+ I PipeRead 'fvwm-menu-directory -d '$0' --title '%d' --xterm="$[fvwm_scrpt]/start.sh" --exec-file "audacious"'


# Program starter with audio support ;-)
DestroyFunc FuncFvwmStartApp
AddToFunc   FuncFvwmStartApp
+ I Exec exec $0
+ I Exec exec $[fvwm_silent_player] $[fvwm_audio]/$1
+ "PornView"       Exec pornview 

haha busted :stuck_out_tongue:

(i hope i didn’t break any rules or anything. I just couldn’t resist)

Hehe, what will you think of me now? :blush: :smiley:

This PornView app is an image viewer, but I do not use it to view pornos. It’s just a stupid name … :wink:

hi

Wow, that’s so easy :stuck_out_tongue: , i missed this CenterPlacement :unamused: .

this is what i use ( :blush: ) :

piperead "echo SetEnv posbarre $$(( ($[vp.width]-600) / 2))"

where “600” is the width of my widget.
then, in the config :

*widget: Geometry 3x1+$posbarre+0

This stuff simply doesn’t work here! Can I anyhow diagnose why this is not working?

Supply a minimal config that demonstrates your problem, and we can go from there. But beforehand, is there anything in ~/.xsession-errors?

– Thomas Adam

Okay, I’ve been busy doing other things, now I’m back! :smiling_imp: :wink:

The PipeRead trick as mentioned by ryo-san did the trick for me. But it’s a bit unclean to write the panel length into the PipeRead call. If you know a better solution (CenterPlacement doesn’t work because of reasons I don’t know!), please tell me!

Thanks for your patience, Thomas!

EDIT: Well, it has turned out that I’m very close to the solution … but I haven’t reached it yet. I noticed that the first time I start FVWM, the panel starts at the top left edge of the screen, but when I restart FVWM, from then it always uses the right position.

SetEnv panel_width 192
SetEnv panel_height 32

AddToFunc StartFunction
+ I PipeRead "echo SetEnv panel_offset $$(( ($[vp.width]-$[panel_width]) / 2))" 
+ I Module FvwmButtons Panel


*Panel: Geometry $[panel_width]x$[panel_height]+$[panel_offset]-0

Do you know a way out of this?

I am a only a novice but maybe running a:

+ I Test (Init) Panel

At the beggining of your config would keep it from moving when u restart?

No, this is not what I want. The FIRST time I start it it is at the WRONG position, but after I restart once, it’s always at the RIGHT position.

I think this may be because the panel starts BEFORE the panel offset has been calculated. I think that the stuff in the StartFunction starts parallel and not one after the other, so this may be possible.

So the question is: How do I make it that the panel starts just AFTER the PipeRead call?

Two options. One is to set a Schedule on it:

+ I ... Schedule 500 Module FvwmButtons foo

The other way is to use something like the following:

DestroyFunc StartPanel
AddToFunc   StartPanel
+ I Module FvwmButtons myPanel
+ I Wait myPanel
+ I Next (myPanel) Move ....

AddToFunc StartFunction I StartPanel

– Thomas Adam

Thanks for your tips, Thomas! I’ve tried them both, but unfortunately, none of them worked. However, I have found the solution: I commented out the Geometry section of FvwmButtons and started my panel by calling this:

+ I PipeRead "echo SetEnv panel_offset $$(( ($[vp.width]-$[panel_width]) / 2))" 
+ I Module FvwmButtons Panel -g $[panel_width]x$[panel_height]+$[panel_offset]-0

So I can happily say now, case closed! :smiley: