Skip to content

Commit

Permalink
fvwm-menu-desktop more improvements
Browse files Browse the repository at this point in the history
 * Added --dynamic option.
 * Added --regen-cmd to control the Regenerate menu item.
 * Made titles default and added --without-titles
 * Added --all-menus to generate all menus and not try to
   find the best one.
 * Updated man page to reflect the changes.
 * Updated News file about changes.
  • Loading branch information
somiaj authored and domivogt committed Dec 28, 2016
1 parent 0d5b7be commit e3db895
Show file tree
Hide file tree
Showing 6 changed files with 440 additions and 199 deletions.
9 changes: 9 additions & 0 deletions NEWS
Expand Up @@ -20,6 +20,15 @@ Changes in stable release 2.6.7 (UNRELEASED)
- FvwmButtons learned a new option "Colorset" to its
ChangeButton command.

* fvwm-menu-desktop updated:

- Renamed default menu to XDGMenu and changed the name
of the FvwmForm to FvwmForm-XDGMenu-Config
- fvwm-menu-desktop will now load defaults from the
FvwmForm-XDGMenu-Config data file.
- Improved dynamic menus.
- Added new options: --regen-cmd, --dynamic, and more.

* Bug fixes:

- A bug introduced in 2.6.6 could cause applications with
Expand Down
81 changes: 60 additions & 21 deletions bin/fvwm-menu-desktop-config.fpl
Expand Up @@ -70,9 +70,9 @@ if (scalar keys %all_menus != 0) {
";
my $m_count = 0;
foreach my $count (sort(keys %{$all_menus{$key}})) {
my @menu = @{$all_menus{$key}{$count}};
my $newstring = $menu[0] . ' ' x eval($max_length-length($menu[0]));
$fvwmform_commands .= "*${modname}: Choice $menu[1] $menu[1] $menu[2] \"$newstring\"
my $menu = $all_menus{$key}{$count};
my $newstring = $menu->[0] . ' ' x eval($max_length-length($menu->[0]));
$fvwmform_commands .= "*${modname}: Choice $menu->[1] $menu->[1] $menu->[2] \"$newstring\"
";
$m_count++;
if ($m_count == 4) {
Expand Down Expand Up @@ -137,14 +137,6 @@ $fvwmform_commands .= "
*${modname}: Text \"\$[gt.Used Icon theme: ]\"
*${modname}: Input Theme 20 \"\"

*${modname}: Line left
*${modname}: Text \"\$[gt.Top Menu Name: ]\"
*${modname}: Input Title 20 \"\"

*${modname}: Text \"\$[gt. ]\"
*${modname}: Text \"\$[gt.Install-Prefix: ]\"
*${modname}: Input Installprefix 20 \"\"

*${modname}: Line left
*${modname}: Text \"\$[gt.Directory Icon: ]\"
*${modname}: Input DirIcon 20 \"gnome-fs-directory\"
Expand All @@ -153,14 +145,22 @@ $fvwmform_commands .= "
*${modname}: Text \"\$[gt.Application Icon: ]\"
*${modname}: Input AppIcon 20 \"gnome-applications\"

*${modname}: Line left
*${modname}: Text \"\$[gt.Top Menu Name: ]\"
*${modname}: Input Title 20 \"XDGMenu\"

*${modname}: Text \"\$[gt. ]\"
*${modname}: Text \"\$[gt.Insert Menu Into: ]\"
*${modname}: Input InsertInto 20 \"\"

*${modname}: Line left
*${modname}: Text \"\$[gt.Icon directory: ]\"
*${modname}: Input IconDir 30 \"~/.fvwm/icons\"
*${modname}: Text \"\$[gt. (Directory for converted icons)]\"

*${modname}: Line left
*${modname}: Text \"\$[gt.Output path: ]\"
*${modname}: Input Path 30 \"\$FVWM_USERDIR/.menu\"
*${modname}: Input Path 30 \"\$FVWM_USERDIR/.XDGMenu\"
*${modname}: Text \"\$[gt. (Full path to store output)]\"

*${modname}: Line left
Expand All @@ -169,7 +169,7 @@ $fvwmform_commands .= "

*${modname}: Line
*${modname}: Line expand
*${modname}: Button continue \"\$[gt.Generate Menus]\"
*${modname}: Button continue \"\$[gt.Save Menu]\"
*${modname}: Command PipeRead 'fvwm-menu-desktop \\
\$(IconsOn\?--enable-mini-icons )\\
\$(Size\?-s \$(Size) )\\
Expand All @@ -182,22 +182,22 @@ $fvwmform_commands .= "
\$(IconDir\?--mini-icon-dir \$(IconDir) )\\
\$(DirIcon\?--dir-icon \$(DirIcon) )\\
\$(AppIcon\?--app-icon \$(AppIcon) )\\
\$(InsertInto\?--insert-in-menu \$(InsertInto) )\\
\$(Title\?--title \$(Title) )\\
\$(Installprefix\?--install-prefix \$(Installprefix) )\\
\$(Theme\?--theme \$(Theme) )\\
--set-menus \"\\
";

foreach my $key (keys %all_menus) {
foreach my $file (keys %{$all_menus{$key}}) {
my @menu = @{$all_menus{$key}{$file}};
$fvwmform_commands .= "\$($menu[1]\?$key$menu[0].menu )\\\n";
my $menu = $all_menus{$key}{$file};
$fvwmform_commands .= "\$($menu->[1]\?$key$menu->[0].menu )\\\n";
}
}

$fvwmform_commands .= "\" \$(Path\? > \$(Path)) 2>> ~/.xsession-errors && echo \"Read \$(Path\? \$(Path))\"'

*${modname}: Button continue \"\$[gt.Save Settings]\"
*${modname}: Button continue \"\$[gt.Save and Regenerate]\"

# Before saving the data, remove any previously saved data:
*${modname}: Command DestroyModuleConfig ${modname}Default: *
Expand All @@ -207,8 +207,8 @@ $fvwmform_commands .= "\" \$(Path\? > \$(Path)) 2>> ~/.xsession-errors && echo

foreach my $key (keys %all_menus) {
foreach my $count (keys %{$all_menus{$key}}) {
my @menu = @{$all_menus{$key}{$count}};
$fvwmform_commands .= " '*${modname}Default: $menu[1] \$($menu[1]\?on) ' ; /bin/echo \\
my $menu = $all_menus{$key}{$count};
$fvwmform_commands .= " '*${modname}Default: $menu->[1] \$($menu->[1]\?on) ' ; /bin/echo \\
";
}
}
Expand All @@ -230,12 +230,51 @@ $fvwmform_commands .= ") > \$FVWM_USERDIR/.${modname}

*${modname}: Command !(/bin/echo \\
'*${modname}Default: Title \$(Title) ' ; /bin/echo \\
'*${modname}Default: Installprefix \$(Installprefix) '; /bin/echo \\
'*${modname}Default: InsertInto \$(InsertInto) ' ; /bin/echo \\
'*${modname}Default: Path \$(Path) ' ; /bin/echo \\
'*${modname}Default: IconDir \$(IconDir) ' ; /bin/echo \\
'*${modname}Default: DirIcon \$(DirIcon) ' ; /bin/echo \\
'*${modname}Default: AppIcon \$(AppIcon) ' \\
) >> \$FVWM_USERDIR/.${modname}

*${modname}: Command PipeRead 'fvwm-menu-desktop'

*${modname}: Button continue \"\$[gt.Save]\"

# Before saving the data, remove any previously saved data:
*${modname}: Command DestroyModuleConfig ${modname}Default: *
*${modname}: Command !( /bin/echo \\
\"# This file last created by ${modname} on: `/bin/date`.\"; /bin/echo \\
";

foreach my $key (keys %all_menus) {
foreach my $count (keys %{$all_menus{$key}}) {
my $menu = $all_menus{$key}{$count};
$fvwmform_commands .= " '*${modname}Default: $menu->[1] \$($menu->[1]\?on) ' ; /bin/echo \\
";
}
}

$fvwmform_commands .= ") > \$FVWM_USERDIR/.${modname}

*${modname}: Command !(/bin/echo \\
'*${modname}Default: IncludeConfig\$(IncludeConfig\?on) ' ; /bin/echo \\
'*${modname}Default: IncludeRegen \$(IncludeRegen\?on) ' ; /bin/echo \\
'*${modname}Default: IncludeBoth \$(IncludeBoth\?on) ' ; /bin/echo \\
'*${modname}Default: IncludeNone \$(IncludeNone\?on) ' ; /bin/echo \\
'*${modname}Default: IconsOn \$(IconsOn\?on) ' ; /bin/echo \\
'*${modname}Default: IconsOff \$(IconsOff\?on) ' ; /bin/echo \\
'*${modname}Default: Size \$(Size) ' ; /bin/echo \\
'*${modname}Default: TitlesOn \$(TitlesOn\?on) ' ; /bin/echo \\
'*${modname}Default: TitlesOff \$(TitlesOff\?on) ' ; /bin/echo \\
'*${modname}Default: Theme \$(Theme) ' \\
) >> \$FVWM_USERDIR/.${modname}

*${modname}: Command !(/bin/echo \\
'*${modname}Default: Title \$(Title) ' ; /bin/echo \\
'*${modname}Default: InsertInto \$(InsertInto) ' ; /bin/echo \\
'*${modname}Default: Path \$(Path) ' ; /bin/echo \\
'*${modname}Default: IconDir \$(IconDir) ' ; /bin/echo \\
'*${modname}Default: DirIcon \$(DirIcon) ' ; /bin/echo \\
'*${modname}Default: AppIcon \$(AppIcon) ' \\
) >> \$FVWM_USERDIR/.${modname}
Expand All @@ -244,7 +283,7 @@ $fvwmform_commands .= ") > \$FVWM_USERDIR/.${modname}
*${modname}: Command Nop
*${modname}: Button continue \"\$[gt.Help]\"
*${modname}: Command Module FvwmForm FvwmForm-XDGMenuHelp
*${modname}: Button quit \"\$[gt.Quit]\"
*${modname}: Button quit \"\$[gt.Close]\"
*${modname}: Command Nop

# Tell ${modname} to read vars from .${modname}Default file:
Expand Down

0 comments on commit e3db895

Please sign in to comment.