names in auto generated menus

2014-01-03 Thread Dominique Michel
Hi all and happy new year!

In FVWM-Crystal, the media menu use auto generated menus for the
playlist and to play individual files.
1) it is a preference dialog where the users can tell Crystal where
their audio and video files are, and write them into a file.
2) from that file, a script generate the menu call into another file.
It use fvwm-directory.
At that time, mine look like this:

DestroyFunc FuncFvwmMenuMovieDirectory
AddToFunc FuncFvwmMenuMovieDirectory
+ I PipeRead 'case \'$0\' in \
 "/home/alian/Vídeos"*) myexec="fvwm-crystal.mplayer-wrapper file
dom";;
"/media/Toshiba_External_USB_3.0_20130324040598-1/Backup/Vidéos"*)
myexec="fvwm-crystal.mplayer-wrapper file dom";;  "/home/dom/Vídeos"*)
myexec="fvwm-crystal.mplayer-wrapper file dom";;
"/home/dom/Descargas"*) myexec="fvwm-crystal.mplayer-wrapper file
dom";;"/media/cdrom"*) myexec="fvwm-crystal.mplayer-wrapper file
dom";;  \ esac; \ fvwm-menu-directory --icon-title
"22x22/categories/directory.png"  \ --func="FuncFvwmMenuMovieDirectory"
\ --exec-file "^${myexec}" --dir \'$0\''

DestroyMenu /Music/LoadMovie
AddToMenu /Music/LoadMovie
+ MissingSubmenuFunction FuncFvwmMenuMovieDirectory
 + '%22x22/categories/video_movies_view.png%$[gt.Browse Medias]'
Popup /home/alian/Vídeos 
 + '%22x22/categories/video_movies_view.png%$[gt.Browse Medias]'
Popup /media/Toshiba_External_USB_3.0_20130324040598-1/Backup/Vidéos 
 + '%22x22/categories/video_movies_view.png%$[gt.Browse Medias]'
Popup /home/dom/Vídeos 
 + '%22x22/categories/video_movies_view.png%$[gt.Browse Medias]'
Popup /home/dom/Descargas 
 + '%22x22/categories/video_movies_view.png%$[gt.Browse DVD]'
Popup /media/cdrom 

4) that file is read by fvwm

As it is here, it work fine. As soon I add things like
--exec-title "^fvwm-crystal.play-movies" or icons into the Piperead
like in Taviso function, fvwm get confused and it fail to open some of
the directories in the Descargas folder and to show the files into them.

It seam like file and directory names with characters like {} or ()
into their names confuse very easily fvwm. At the beginning, I was
thinking it was fvwm-menu-directory that get confused by them, but
after running the same command into a console, it appear the menu
generated by it is correct in any cases. So the issue is in fvwm itself.

I know such characters must be avoided into file names, but they are
broadly used on the internet.

Dominique



Re: names in auto generated menus

2014-01-03 Thread Dominique Michel
Le Fri, 3 Jan 2014 15:07:52 +0100,
Dominique Michel  a écrit :

> Hi all and happy new year!
> 
> In FVWM-Crystal, the media menu use auto generated menus for the
> playlist and to play individual files.
> 1) it is a preference dialog where the users can tell Crystal where
> their audio and video files are, and write them into a file.
> 2) from that file, a script generate the menu call into another file.
> It use fvwm-directory.
> At that time, mine look like this:
> 
> DestroyFunc FuncFvwmMenuMovieDirectory
> AddToFunc FuncFvwmMenuMovieDirectory
> + I PipeRead 'case \'$0\' in \
>  "/home/alian/Vídeos"*) myexec="fvwm-crystal.mplayer-wrapper file
> dom";;
> "/media/Toshiba_External_USB_3.0_20130324040598-1/Backup/Vidéos"*)
> myexec="fvwm-crystal.mplayer-wrapper file dom";;  "/home/dom/Vídeos"*)
> myexec="fvwm-crystal.mplayer-wrapper file dom";;
> "/home/dom/Descargas"*) myexec="fvwm-crystal.mplayer-wrapper file
> dom";;"/media/cdrom"*) myexec="fvwm-crystal.mplayer-wrapper file
> dom";;  \ esac; \ fvwm-menu-directory --icon-title
> "22x22/categories/directory.png"  \
> --func="FuncFvwmMenuMovieDirectory" \ --exec-file "^${myexec}" --dir
> \'$0\''
> 
> DestroyMenu /Music/LoadMovie
> AddToMenu /Music/LoadMovie
> + MissingSubmenuFunction FuncFvwmMenuMovieDirectory
>  + '%22x22/categories/video_movies_view.png%$[gt.Browse Medias]'
> Popup /home/alian/Vídeos 
>  + '%22x22/categories/video_movies_view.png%$[gt.Browse Medias]'
> Popup /media/Toshiba_External_USB_3.0_20130324040598-1/Backup/Vidéos 
>  + '%22x22/categories/video_movies_view.png%$[gt.Browse Medias]'
> Popup /home/dom/Vídeos 
>  + '%22x22/categories/video_movies_view.png%$[gt.Browse Medias]'
> Popup /home/dom/Descargas 
>  + '%22x22/categories/video_movies_view.png%$[gt.Browse DVD]'
> Popup /media/cdrom 
> 
> 4) that file is read by fvwm
> 
> As it is here, it work fine. As soon I add things like
> --exec-title "^fvwm-crystal.play-movies" or icons into the Piperead
> like in Taviso function, fvwm get confused and it fail to open some of
> the directories in the Descargas folder and to show the files into
> them.
> 
> It seam like file and directory names with characters like {} or ()
> into their names confuse very easily fvwm. At the beginning, I was
> thinking it was fvwm-menu-directory that get confused by them, but
> after running the same command into a console, it appear the menu
> generated by it is correct in any cases. So the issue is in fvwm
> itself.

Here is a version that file with some directory names:

DestroyFunc FuncFvwmMenuMovieDirectory
AddToFunc FuncFvwmMenuMovieDirectory
+ I PipeRead 'case \'$0\' in \
 "/home/alian/Vídeos"*) myexec="fvwm-crystal.mplayer-wrapper file
dom";;
"/media/Toshiba_External_USB_3.0_20130324040598-1/Backup/Vidéos"*)
myexec="fvwm-crystal.mplayer-wrapper file dom";;
"/home/dom/Vídeos"*) myexec="fvwm-crystal.mplayer-wrapper file dom";;
"/home/dom/Descargas"*) myexec="fvwm-crystal.mplayer-wrapper
file dom";;
"/media/cdrom"*) myexec="fvwm-crystal.mplayer-wrapper file dom";;  \
esac; \ 
fvwm-menu-directory --icon-title "22x22/categories/directory.png"  \
--icon-file "22x22/categories/Audio-Video.png" \
--icon-dir "22x22/categories/video_movies_view.png" \
--func="FuncFvwmMenuMovieDirectory" \
--exec-file "^${myexec}" --dir \'$0\' --exec-title
"^fvwm-crystal.play-movies"'

DestroyMenu /Music/LoadMovie
AddToMenu /Music/LoadMovie
+ MissingSubmenuFunction FuncFvwmMenuMovieDirectory
 + '%22x22/categories/video_movies_view.png%$[gt.Browse Medias]'
Popup /home/alian/Vídeos 
 + '%22x22/categories/video_movies_view.png%$[gt.Browse Medias]'
Popup /media/Toshiba_External_USB_3.0_20130324040598-1/Backup/Vidéos 
 + '%22x22/categories/video_movies_view.png%$[gt.Browse Medias]'
Popup /home/dom/Vídeos 
 + '%22x22/categories/video_movies_view.png%$[gt.Browse Medias]'
Popup /home/dom/Descargas 
 + '%22x22/categories/video_movies_view.png%$[gt.Browse DVD]'
Popup /media/cdrom 

> 
> I know such characters must be avoided into file names, but they are
> broadly used on the internet.
> 
> Dominique
> 



Re: names in auto generated menus

2014-01-03 Thread Dan Espen
Dominique Michel  writes:

> Le Fri, 3 Jan 2014 15:07:52 +0100,
> Dominique Michel  a écrit :
>
>> It seam like file and directory names with characters like {} or ()
>> into their names confuse very easily fvwm. At the beginning, I was
>> thinking it was fvwm-menu-directory that get confused by them, but
>> after running the same command into a console, it appear the menu
>> generated by it is correct in any cases. So the issue is in fvwm
>> itself.

Sorry, I've read your post twice and still don't understand.
Please send a single fvwm command that doesn't work as you expect.

For my own music, I run a script that "fixes" the file names.

-- 
Dan Espen



Re: names in auto generated menus

2014-01-03 Thread Dominique Michel
Le Fri, 03 Jan 2014 10:34:24 -0500,
Dan Espen  a écrit :

> Dominique Michel  writes:
> 
> > Le Fri, 3 Jan 2014 15:07:52 +0100,
> > Dominique Michel  a écrit :
> >
> >> It seam like file and directory names with characters like {} or ()
> >> into their names confuse very easily fvwm. At the beginning, I was
> >> thinking it was fvwm-menu-directory that get confused by them, but
> >> after running the same command into a console, it appear the menu
> >> generated by it is correct in any cases. So the issue is in fvwm
> >> itself.
> 
> Sorry, I've read your post twice and still don't understand.
> Please send a single fvwm command that doesn't work as you expect.

A resumed fvwm code that fail is:

DestroyFunc FuncFvwmMenuMovieDirectory
AddToFunc FuncFvwmMenuMovieDirectory
+ I PipeRead 'case \"$0\" in \
"/home/alian/Vídeos"*) myexec="fvwm-crystal.mplayer-wrapper file dom";;
\
esac; \ 
test -f \"$0\"/.icontitle.png && mytitle=\"$0\"/.icontitle.png; \ 
test -f \"$0\"/.media.png && mypng=\"$0\"/.media.png; \
fvwm-menu-directory --icon-title
"${mytitle:-22x22/categories/directory.png}"  \
--icon-file "${mypng:-22x22/categories/Audio-Video.png}" \
--func="FuncFvwmMenuMovieDirectory" \
--exec-file "^${myexec}" --dir \"$0\"
--exec-title="^fvwm-crystal.play-movies \"$0\""'

This generate:
DestroyMenu recreate "/home/alian/Vídeos"
AddToMenu "/home/alian/Vídeos"
+ DynamicPopDownAction DestroyMenu "/home/alian/Vídeos"
+ MissingSubmenuFunction FuncFvwmMenuMovieDirectory
+ "%22x22/categories/directory.png%/home/alian/Vídeos" Exec cd
"/home/alian/Vídeos"; fvwm-crystal.play-movies /home/alian/Vídeos
+ "" Nop
+ "Musiques" Popup "/home/alian/Vídeos/Musiques" item +100 c

This is called by:
DestroyMenu /Music/LoadMovie
AddToMenu /Music/LoadMovie
+ MissingSubmenuFunction FuncFvwmMenuMovieDirectory
+ '%22x22/categories/video_movies_view.png%$[gt.Browse Medias]'
  Popup /home/alian/Vídeos 

Popup /Music/LoadMovie

The menu pop up, the 4 subdirs are here, but for the
Paco de Lucia directory, I see only its title and cannot navigate
further into it:  

# ls -R /home/alian/Vídeos/Musiques
/home/alian/Vídeos/Musiques:
Français  Madonna  Paco de Lucia  Santana

/home/alian/Vídeos/Musiques/Français:
Plume Latraverse _ Belle et Bum.avi

/home/alian/Vídeos/Musiques/Madonna:
05 _ Madonna _ Re_Invention Tour _ June 16 2004 _ American Life.avi
Madonna _ American Life _Version 1 _ withdrawn__HQ no logo_.vob
Madonna._.American.Life.vob
Madonna._._American.Life_.MV._Uncensured_.vob

/home/alian/Vídeos/Musiques/Paco de Lucia:
Paco De Lucia _ Concierto De Aranjuez _Spanish Kvcd_ By Waydansar.mpg
Video _ Paco de Lucia _ Rumba.mpg

/home/alian/Vídeos/Musiques/Santana:
Carlos Santana _ Live In Mexico _Concerto Video Sacred Fire.mpg  Carlos
Santana _ Soul Sacrifice _Live in Woodstock_.mpg  
Jeff Beck_ Carlos Santana_ Steve Lukather et Jan Hammer _ Karuizawa
Live.mpg

--
Note the spanish í in Vídeos, and the spaces into "Paco de Lucia".

> 
> For my own music, I run a script that "fixes" the file names.
> 

I do the same, but only for the special characters. It is no point to
have utf-8 file systems and not use them. That's funny, because fvwm
can handle Chinese characters inside this menu, but not a well
known Spanish name like "Paco de Lucia".

Also, with the 2 precedent versions (second mail), one work better but
is not perfect, the only one that work fine is the one without icons and
without exec-title command.

For me this is a bug into fvwm. It took me a very long time, trying
different sorts of quoting, to figure that fvwm-menu-directory seam to
work fine in all cases, and that by removing all the icons and the
exec-title command, it work fine. So, this is not an issue with the
file or directory names.

As a workaround, I done a preference in fvwm-crystal that let the user
to choose if they want or not the icons and the exec-title command.

Dominique



Re: names in auto generated menus

2014-01-03 Thread Dan Espen
Dominique Michel  writes:

> Le Fri, 03 Jan 2014 10:34:24 -0500,
> Dan Espen  a écrit :
>
>> Dominique Michel  writes:
>> 
>> > Le Fri, 3 Jan 2014 15:07:52 +0100,
>> > Dominique Michel  a écrit :
>> >
>> >> It seam like file and directory names with characters like {} or ()
>> >> into their names confuse very easily fvwm. At the beginning, I was
>> >> thinking it was fvwm-menu-directory that get confused by them, but
>> >> after running the same command into a console, it appear the menu
>> >> generated by it is correct in any cases. So the issue is in fvwm
>> >> itself.
>> 
>> Sorry, I've read your post twice and still don't understand.
>> Please send a single fvwm command that doesn't work as you expect.
>
> A resumed fvwm code that fail is:
>
> DestroyFunc FuncFvwmMenuMovieDirectory
> AddToFunc FuncFvwmMenuMovieDirectory
> + I PipeRead 'case \"$0\" in \
> "/home/alian/Vídeos"*) myexec="fvwm-crystal.mplayer-wrapper file dom";;

I rather not install fvwm-crystal.

-- 
Dan Espen