Re: FVWM: Is it possible to resize automatically icons in AddToMenu?

2015-12-20 Thread Michelle Konzack
What about making your own menu definition file?

Take the original /etc/menu/fvwm file, copy it to a
new name like /etc/menu/fvwm-selfmade and modify it?

This is what I have done for my Debian packages like

tdfvwm-menu
tdfvwm-sidebars
tdfvwm-icons
...

Since I have a dispute with my ISP about my  DOS  attacked  servers,  my
sites are currently offline.

I will try to get another ISP next year (I am currently jobless and have
no money to setup a new server which cost 40€/month) and  the  you  will
find again

http://www.debian.tamay-dogan.net/

and especialy

http://devel.debian.tamay-dogan.net/

where you will find all of my developments and debian packages.

Greetings
Michelle

-- 
Michelle KonzackITSystems
GNU/Linux Developer 0033-6-61925193



Re: FVWM: Is it possible to resize automatically icons in AddToMenu?

2015-12-18 Thread Oleksandr Gavenko
On 2015-12-18, Thomas Funk wrote:

> Oleksandr Gavenko wrote:
>> On 2015-12-12, Dan Espen wrote:
> [snip]
>>> You should try fvwm-menu-desktop if you haven't done so already.
>>> Use the size= parameter to control the icon sizes.
>> 
>>   $ fvwm-menu-desktop | grep size || echo fail
>>   fail
>> 
>>   $ fvwm-menu-desktop --version
>>   2.6.5
>> 
>> Too old or Debian maintainer broke script?
> [snip]
>
> Dan refers in his statement to the new fvwm-menu-desktop located in the
> CVS version of FVWM.
>
> If you want to use it, you need from CVS:
> - fvwm-menu-desktop (new Python based xdg menu generator)
> => copy it to /usr/bin/
> - fvwm-menu-desktop-config.fpl (configuration GUI)
> => copy it to /usr/share/fvwm/
> - fvwm-menu-desktop.1 (new man page)
> => copy it to /usr/share/man/man1/
>
Ok, I send bug report to Debian package maintainer to update package with
newer version!

> Or you could download it from here (if you won't follow the CVS 
> instructions from the FVWM web page):
> https://github.com/Fvwm-Nightshade/Fvwm-Nightshade/blob/release-0.6/bin/fvwm-menu-desktop2
> https://github.com/Fvwm-Nightshade/Fvwm-Nightshade/blob/release-0.6/fvwm/fvwm-menu-desktop2-config.fpl
> https://github.com/Fvwm-Nightshade/Fvwm-Nightshade/blob/release-0.6/man/fvwm-menu-desktop2.1.gz
>
I check sources as suggested by Dan Espen in followup.

> Add this to your config:
>
> # Dynamic menu realized with DynamicPopupAction
> AddToMenu MenuRoot DynamicPopupAction FuncMenuRoot
>
> DestroyFunc FuncMenuRoot
> AddToFunc   FuncMenuRoot
> + I DestroyMenu MenuRoot
> + I AddToMenu MenuRoot DynamicPopupAction MenuRoot
> + I AddToMenu MenuRoot "$[gt.Root Menu]" Title
> + I Popup FvwmMenu
> + I AddToMenu MenuRoot "" Nop
>
> # Remark: FuncMenuRoot exchanges your current root menu. Add your other
> # entries after the Nop line.
>
> #---
> # Dynamic FvwmMenu sub menu for XDG menus
> # realized with DynamicPopupAction
> #---
> AddToMenu FvwmMenu DynamicPopupAction FuncXdgMenusInRoot
>
> DestroyFunc FuncXdgMenusInRoot
> AddToFunc   FuncXdgMenusInRoot
> + I AddToMenu FvwmMenu DynamicPopupAction FuncXdgMenusInRoot
> + I Test (f $[FVWM_USERDIR]/.menu) Read $[FVWM_USERDIR]/.menu
> + I PipeRead 'fvwm-menu-desktop --insert-in-menu MenuRoot > 
> $[FVWM_USERDIR]/.menu &&  echo "Read $[FVWM_USERDIR]/.menu"'
>
> # Remark: if you're using the scripts from Fvwm-Nightshade don't forget
> # the '2' behind fvwm-menu-desktop ;-)
>
> For more information see the new fvwm-menu-desktop man page.
>
I don't understand some parts of your code (dynamic menu reconstruction, have
no time to deep into manual).

But it was enough to craft quick test without destroying running desktop.

So after building fvwm from CVS:

  ./configure --prefix=$PWD/.usr

In order to keep existent script live I put `fvwm-menu-desktop' under different
name:

  ~/.local/bin/fvwm-menu-desktop2

I try:

  $ fvwm-menu-desktop2 --insert-in-menu TestMenuRoot

But now man page state that I need XDG_MENU_PREFIX:

  $ XDG_MENU_PREFIX=gnome- fvwm-menu-desktop2 --insert-in-menu TestMenuRoot

Within FvwmConsole I run:

  DestroyMenu TestMenuRoot
  AddToMenu TestMenuRoot Menu Title
  PipeRead 'XDG_MENU_PREFIX=gnome- fvwm-menu-desktop2 --enable-mini-icon 
--insert-in-menu TestMenuRoot'
  Key F2 A M Menu TestMenuRoot Root c c

and on Alt+F2 I get SUPER FANCY menu.

Only one issue there is. With `--enable-mini-icon' option stript execution
time becomes near 20 sec. Subsequent call takes near 4 sec. While without
icons it works about 1 sec.

So I decide to build menus during `.fvwm' installation instead of using
dynamic build.

During experimentation I run `fvwm-menu-desktop-config.fpl' because it was
suggested by fvwm-menu-desktop when I didn't set XDG_MENU_PREFIX.

FvwmPerl man page say that this by may be placed into $FVWM_USERDIR. But I
decide live without it.

Thanks for support!

> [snip]
>> How is script supposed to manage icon size? It resize them and store under
>> ~/.cache/fvwm dir?
> [snip]
>
> You can set the wanted icon size via configuration GUI or command line.
> Default location for resized icons is ~/.fvwm/icons/
>
That is great! I was at writing my own solution.

-- 
Best regards!




Re: FVWM: Is it possible to resize automatically icons in AddToMenu?

2015-12-18 Thread Oleksandr Gavenko
On 2015-12-18, Dan Espen wrote:

> Not sure a manual install is a good idea.
>
> To download the latest version from CVS:
>
>   cvs -d :pserver:anonym...@cvs.fvwm.org:/home/cvs/fvwm checkout -r 
> branch-2_6 fvwm
>
> To build it:
>
> utils/configure_dev.sh
> /configure
> make
> make install  (as root)
>
I do that with consulting to:

  http://www.fvwm.org/documentation/dev_cvs.php?theme=navigate

but instead:

  $ ./configure --prefix=$PWD/.usr

and extract $PWD/.usr/bin/fvwm-menu-desktop for my needs.

I filed a bug:

  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=808292
Replace fvwm-menu-desktop with upstream version (they rewrite from Perl to 
Python XDG library).

so hope some times I didn't do any manual actions to get fvwm-menu-desktop.

> You'll probably find you need a few -devel packages.

During ./configure I get:

  With GTK+ required for FvwmGtk? no: Failed to detect GTK, see config.log

That is not required by my willing but I think I have all build prerequisites.

I think that corresponding config.log lines are:

  configure:13205: $? = 0
  configure:13205: ./conftest
  configure:13205: $? = 0
  configure:13220: result: yes
  configure:13245: checking for unsetenv
  configure:13245: gcc -o conftest -Wall -Wno-implicit-int -g -O2 
-I/usr/include/freetype2conftest.c  -lfontconfig -lfreetype  >&5
  configure:13245: $? = 0
  configure:13245: result: yes
  configure:13307: checking for gtk-config
  configure:13338: result: no
  configure:13347: checking for GTK - version >= 1.1.0
  configure:13469: result: no
  configure:13587: checking for imlib-config
  configure:13618: result: no
  configure:13627: checking for GDK IMLIB - version >= 1.8.0
  configure:13711: result: no

If you have no time don't investigate this issue, I just wonder.

-- 
Best regards!




Re: FVWM: Is it possible to resize automatically icons in AddToMenu?

2015-12-17 Thread Thomas Funk
Oleksandr Gavenko wrote:
> On 2015-12-12, Dan Espen wrote:
[snip]
>> You should try fvwm-menu-desktop if you haven't done so already.
>> Use the size= parameter to control the icon sizes.
> 
>   $ fvwm-menu-desktop | grep size || echo fail
>   fail
> 
>   $ fvwm-menu-desktop --version
>   2.6.5
> 
> Too old or Debian maintainer broke script?
[snip]

Dan refers in his statement to the new fvwm-menu-desktop located in the
CVS version of FVWM.

If you want to use it, you need from CVS:
- fvwm-menu-desktop (new Python based xdg menu generator)
=> copy it to /usr/bin/
- fvwm-menu-desktop-config.fpl (configuration GUI)
=> copy it to /usr/share/fvwm/
- fvwm-menu-desktop.1 (new man page)
=> copy it to /usr/share/man/man1/

Or you could download it from here (if you won't follow the CVS 
instructions from the FVWM web page):
https://github.com/Fvwm-Nightshade/Fvwm-Nightshade/blob/release-0.6/bin/fvwm-menu-desktop2
https://github.com/Fvwm-Nightshade/Fvwm-Nightshade/blob/release-0.6/fvwm/fvwm-menu-desktop2-config.fpl
https://github.com/Fvwm-Nightshade/Fvwm-Nightshade/blob/release-0.6/man/fvwm-menu-desktop2.1.gz

Add this to your config:

# Dynamic menu realized with DynamicPopupAction
AddToMenu MenuRoot DynamicPopupAction FuncMenuRoot

DestroyFunc FuncMenuRoot
AddToFunc   FuncMenuRoot
+ I DestroyMenu MenuRoot
+ I AddToMenu MenuRoot DynamicPopupAction MenuRoot
+ I AddToMenu MenuRoot "$[gt.Root Menu]" Title
+ I Popup FvwmMenu
+ I AddToMenu MenuRoot "" Nop

# Remark: FuncMenuRoot exchanges your current root menu. Add your other
# entries after the Nop line.

#---
# Dynamic FvwmMenu sub menu for XDG menus
# realized with DynamicPopupAction
#---
AddToMenu FvwmMenu DynamicPopupAction FuncXdgMenusInRoot

DestroyFunc FuncXdgMenusInRoot
AddToFunc   FuncXdgMenusInRoot
+ I AddToMenu FvwmMenu DynamicPopupAction FuncXdgMenusInRoot
+ I Test (f $[FVWM_USERDIR]/.menu) Read $[FVWM_USERDIR]/.menu
+ I PipeRead 'fvwm-menu-desktop --insert-in-menu MenuRoot > 
$[FVWM_USERDIR]/.menu &&  echo "Read $[FVWM_USERDIR]/.menu"'

# Remark: if you're using the scripts from Fvwm-Nightshade don't forget
# the '2' behind fvwm-menu-desktop ;-)

For more information see the new fvwm-menu-desktop man page.

[snip]
> How is script supposed to manage icon size? It resize them and store under
> ~/.cache/fvwm dir?
[snip]

You can set the wanted icon size via configuration GUI or command line.
Default location for resized icons is ~/.fvwm/icons/

-- Thomas --

-- 
--
"Two things are infinite: the universe and human stupidity; and I'm not sure 
about the the universe."   --   Albert Einstein



Re: FVWM: Is it possible to resize automatically icons in AddToMenu?

2015-12-17 Thread Dan Espen
Thomas Funk  writes:

> Oleksandr Gavenko wrote:
>> On 2015-12-12, Dan Espen wrote:
> [snip]
>>> You should try fvwm-menu-desktop if you haven't done so already.
>>> Use the size= parameter to control the icon sizes.
>> 
>>   $ fvwm-menu-desktop | grep size || echo fail
>>   fail
>> 
>>   $ fvwm-menu-desktop --version
>>   2.6.5
>> 
>> Too old or Debian maintainer broke script?
> [snip]
>
> Dan refers in his statement to the new fvwm-menu-desktop located in the
> CVS version of FVWM.
>
> If you want to use it, you need from CVS:
> - fvwm-menu-desktop (new Python based xdg menu generator)
> => copy it to /usr/bin/
> - fvwm-menu-desktop-config.fpl (configuration GUI)
> => copy it to /usr/share/fvwm/
> - fvwm-menu-desktop.1 (new man page)
> => copy it to /usr/share/man/man1/

Not sure a manual install is a good idea.

To download the latest version from CVS:

  cvs -d :pserver:anonym...@cvs.fvwm.org:/home/cvs/fvwm checkout -r branch-2_6 
fvwm

To build it:

utils/configure_dev.sh
/configure
make
make install  (as root)

You'll probably find you need a few -devel packages.

> Or you could download it from here (if you won't follow the CVS 
> instructions from the FVWM web page):
> https://github.com/Fvwm-Nightshade/Fvwm-Nightshade/blob/release-0.6/bin/fvwm-menu-desktop2
> https://github.com/Fvwm-Nightshade/Fvwm-Nightshade/blob/release-0.6/fvwm/fvwm-menu-desktop2-config.fpl
> https://github.com/Fvwm-Nightshade/Fvwm-Nightshade/blob/release-0.6/man/fvwm-menu-desktop2.1.gz

Hmm, heard of it but know nothing about the Nightshade project.
I see on their page:

  Works with FVWM  2.6.5 without loosing new Xdg menu  support from FVWM
  CVS version.

Not sure that's a good thing.
I guess it's time I did a new stable release.
I retire this spring, maybe I'll find time then.

> Add this to your config:
>
> # Dynamic menu realized with DynamicPopupAction
> AddToMenu MenuRoot DynamicPopupAction FuncMenuRoot
>
> DestroyFunc FuncMenuRoot
> AddToFunc   FuncMenuRoot
> + I DestroyMenu MenuRoot
> + I AddToMenu MenuRoot DynamicPopupAction MenuRoot
> + I AddToMenu MenuRoot "$[gt.Root Menu]" Title
> + I Popup FvwmMenu
> + I AddToMenu MenuRoot "" Nop
>
> # Remark: FuncMenuRoot exchanges your current root menu. Add your other
> # entries after the Nop line.
>
> #---
> # Dynamic FvwmMenu sub menu for XDG menus
> # realized with DynamicPopupAction
> #---
> AddToMenu FvwmMenu DynamicPopupAction FuncXdgMenusInRoot
>
> DestroyFunc FuncXdgMenusInRoot
> AddToFunc   FuncXdgMenusInRoot
> + I AddToMenu FvwmMenu DynamicPopupAction FuncXdgMenusInRoot
> + I Test (f $[FVWM_USERDIR]/.menu) Read $[FVWM_USERDIR]/.menu
> + I PipeRead 'fvwm-menu-desktop --insert-in-menu MenuRoot >
> $[FVWM_USERDIR]/.menu && echo "Read $[FVWM_USERDIR]/.menu"'
>
> # Remark: if you're using the scripts from Fvwm-Nightshade don't forget
> # the '2' behind fvwm-menu-desktop ;-)
>
> For more information see the new fvwm-menu-desktop man page.
>
> [snip]
>> How is script supposed to manage icon size? It resize them and store under
>> ~/.cache/fvwm dir?
> [snip]
>
> You can set the wanted icon size via configuration GUI or command line.
> Default location for resized icons is ~/.fvwm/icons/
>
> -- Thomas --

Thanks.

-- 
Dan Espen



Re: FVWM: Is it possible to resize automatically icons in AddToMenu?

2015-12-11 Thread Dan Espen
Oleksandr Gavenko  writes:

> Look to syntax %...%  in:
>
>   DestroyMenu MenuMyDev
>   AddToMenu   MenuMyDev "My Dev Menu" Title
>   + %iceweasel.png% Exec exec firefox -no-remote -P devel
>
> ImagePath control colon search path for icons and I have broad definition to
> gather different sources (as many as possible):
>
>   m4_define(`m4_IMGPATH', `$[FVWM_USERDIR]/images')m4_dnl
>   m4_define(`m4_ICONPATH', `$[FVWM_USERDIR]/icons')m4_dnl
>
>   ImagePath m4_ICONPATH:m4_IMGPATH:+
>
>   ImagePath +:/usr/share/icons/gnome/16x16/places
>   ImagePath +:/usr/share/icons/gnome/32x32/apps
>   ImagePath +:/usr/share/icons/gnome-colors-common/32x32/apps
>   ImagePath +:/usr/share/icons/locolor/32x32/apps
>   # ImagePath +:/usr/share/icons/hicolor/16x16/apps
>   ImagePath +:/usr/share/icons/hicolor/22x22/apps
>   ImagePath +:/usr/share/icons/hicolor/24x24/apps
>   ImagePath +:/usr/share/icons/hicolor/32x32/apps
>   ImagePath +:/usr/share/icons/hicolor/48x48/apps
>   # ImagePath +:/usr/share/icons/hicolor/64x64/apps
>   # This paths contain large icons for some apps, they make menus look ugly...
>   # ImagePath +:/usr/share/app-install/icons/
>   # ImagePath +:/usr/share/pixmaps

I don't see the logic of adding all the different icon sizes to your
image path.  They all have the same names, so only the first size you
mention is going to be found.

> Some paths commented because they provide too big images. Fvwm uses exact
> size of image when it displays icon. Some of them occupy half of screen!
>
> Are there any syntax:
>
>  (1) to set maximum allowed icon size for displaying (and ignore large image)?
>  (2) to specify how resize image (scale down any that bigger then ...)?

No.  You wouldn't want your icon resized each time it's displayed.
Better to pick the size you want at startup time like
fvwm-menu-desktop does.

> I can't control which icon is supplied by package in Debian repository. That
> is true for:
>
>   /usr/share/app-install/icons/
>   /usr/share/pixmaps/
>
> Most package doesn't respect /usr/share/icons/hicolor/24x24/apps like
> directories and place icons in above paths.
>
> Auto-generated /etc/X11/fvwm/menudefs.hook uses full path to icon so I can't
> select desired size by ImagePath.
>
> Some 3rd-party packages I install in /opt hierarchy and usually they also have
> single BIG icon.
>
> I like to see (2) option e.g. something like:
>
>   + %iceweasel.png%32% Exec exec firefox -no-remote -P devel
>
> but (1) option also take a lot of images from /usr/share/pixmaps like
> directories.
>
> Another option is to preprocess /etc/X11/fvwm/menudefs.hook and place resized
> images into predefined path.
>
> Or carefully craft processing of /etc/xdg/menus/*.menu. I use xdg.Menu and
> xdg.DesktopEntry Python classes to build menus myself.
>
> If Fvwm hold menu images into memory (without loading on demand) - present of
> (2) option looks natural for me.

You've lost me.
menudefs.hook looks to me like some kind of menu generator.
You should try fvwm-menu-desktop if you haven't done so already.
Use the size= parameter to control the icon sizes.

-- 
Dan Espen