I’m trying to make a dinamic way for defining a set of launcher icons in Desktop like this (from FVWM FAQ):
# FvwmButtons icon launcher:
DestroyFunc Launcher
AddToFunc Launcher
+ I DestroyModuleConfig $0Launch: *
+ I *$0Launch: Geometry 64x68
+ I *$0Launch: Columns 1
+ I *$0Launch: Rows 4
+ I *$0Launch: Frame 0
+ I *$0Launch: (1x3+0+0, Icon $1, Action (Mouse 1) `Exec $2`)
+ I *$0Launch: Pixmap none
+ I *$0Launch: (1x1+0+3, Font 9x15, Fore White, Back DarkBlue, \
Title $0, Action (Mouse 1) `Exec $2`)
+ I Style $0Launch HandleWidth 0, NoTitle
+ I Module FvwmButtons $3 $0Launch
What I want is to use the allready defined icons for each app instead of manually specifying one. I think that shouldn’t be difficult.
What is maybe more complicated is to guess the command for launching the application.
I’ll try to explain exactly what I want:
In a popup menu from an iconified window, I’ll put a “Send to Launcher” option wich should invoque something like:
Launcher RXVT xterm.xpm "xterm" "-g +0+0"
I guess if it’s possible not to specify the icon (“xterm.xpm”) and use the same icon used for the iconic window.
Also it should be really great to guess the command used for launching the application, I mean, “xterm”, but I think this is quite harder.
Any Ideas?
Assuming you’ve set a style for it then:
Launcher FC2 $[w.iconfile] "xterm -bg black" "-g +0+400"
ozrocpablogc:
Also it should be really great to guess the command used for launching the application, I mean, “xterm”, but I think this is quite harder.
It is – you could write a wrapper around xlsclients:
xlsclients -l | sed -ne "/Window $[w.id]/,/Window .*/p"
Which then parses the line from ‘Command:’, or you could see xprop(1), etc. It’s still very hit-and-miss though. As in:
xlsclients -la | sed -ne "/Window $[w/id]/,/Window .*/{s/Command://p}"
– Thomas Adam
Doesn’t seem to work.
I have a style line like this:
Style *term* MiniIcon icons/icons/32x32/apps/xterm.png, Icon icons/64x64/apps/xterm.png
this function:
# FvwmButtons icon launcher:
DestroyFunc Launcher
AddToFunc Launcher
+ I DestroyModuleConfig $0Launch: *
+ I *$0Launch: Geometry 70x70
+ I *$0Launch: (1x1+0+0, Icon $1, Colorset 3, Action (Mouse 1) `Exec $2`)
+ I *$0Launch: Pixmap none
+ I *$0Launch: (1x1+0+3, Font $[ThemeFont], Colorset 31, \
Title $0, Action (Mouse 1) `Exec $2`)
+ I Style $0Launch HandleWidth 0, NoTitle
+ I Module FvwmButtons $3 $0Launch
And there’s an entry in a menu associated to icons like this:
+ "Dock This" Launcher xterm $[w.iconfile] xterm "-g +0+140"
(Specified xterm for title and command just for testing purposes)
I tried this on an xterm iconified window and I have an empty button with xterm as name, which launches an xterm when clicking but without any icon at all. Can’t guess where’s the problem.
ozrocpablogc:
Doesn’t seem to work.
It does when you call it from a valid context. You’re calling it outside of a window context. You want to use this in you menu:
AddToMenu whatever SomeLabel ThisWindow Launcher name ....
See also:
viewtopic.php?f=40&t=1712
– Thomas Adam
Yes!
Thank you very much, that thread was really clarifying, I think I’ve definetly understood many things.
You’re my hero.
Thanks again.