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-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!