Skip to content

Commit ef65337

Browse files
committed
Minor tweaks before release.
1 parent e4b1559 commit ef65337

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

fbmenugen

+14-14
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
# Name: fbmenugen
2323
# License: GPLv3
2424
# Created on: 01 August 2010
25-
# Latest edit on: 21 January 2020
25+
# Latest edit on: 31 January 2020
2626
# https://github.com/trizen/fbmenugen
2727

2828
use 5.014;
@@ -101,7 +101,7 @@ my $config_help = <<"HELP";
101101
],
102102
103103
|| ICON SETTINGS
104-
| use_gtk3 : Use the Gtk3 library for resolving the icon-paths. (default: 0)
104+
| use_gtk3 : Use the Gtk3 library for resolving the icon paths. (default: 0)
105105
| gtk_rc_filename : Absolute path to the GTK configuration file.
106106
| missing_icon : Use this icon for missing icons (default: gtk-missing-image)
107107
| icon_size : Preferred size for icons. (default: 32)
@@ -136,6 +136,7 @@ if (@ARGV) {
136136
}
137137
elsif ($arg eq '-d') {
138138
$db_clean = 1;
139+
print STDERR "[*] Regenerating the cache DB...\n";
139140
unlink $cache_db;
140141
}
141142
elsif ($arg eq '-u') {
@@ -146,14 +147,14 @@ if (@ARGV) {
146147
exit 0;
147148
}
148149
elsif ($arg eq '-o') {
149-
$menu_file = shift(@ARGV) // die "$0: option `-o' requires an argument!\n";
150+
$menu_file = shift(@ARGV) // die "$0: option '-o' requires an argument!\n";
150151
}
151152
elsif ($arg eq '-S') {
152-
$schema_file = shift(@ARGV) // die "$0: option `-S' requires an argument!\n";
153+
$schema_file = shift(@ARGV) // die "$0: option '-S' requires an argument!\n";
153154
}
154155
elsif ($arg eq '-C') {
155156
$reload_config = 1;
156-
$config_file = shift(@ARGV) // die "$0: options `-C' requires an argument!\n";
157+
$config_file = shift(@ARGV) // die "$0: options '-C' requires an argument!\n";
157158
}
158159
elsif ($arg eq '-h') {
159160
usage();
@@ -213,19 +214,18 @@ my %CONFIG = (
213214
#>>>
214215
},
215216

216-
menu_title => 'Fluxbox',
217-
terminal => 'xterm',
218-
editor => 'geany',
217+
menu_title => 'Fluxbox',
218+
terminal => 'xterm',
219+
editor => 'geany',
220+
missing_icon => 'gtk-missing-image',
221+
gtk_rc_filename => "$home_dir/.gtkrc-2.0",
219222

220223
icon_size => 32,
221224
force_icon_size => 0,
222225
generic_fallback => 0,
223226
locale_support => 1,
224227
use_gtk3 => 0,
225228

226-
missing_icon => 'gtk-missing-image',
227-
gtk_rc_filename => "$home_dir/.gtkrc-2.0",
228-
229229
VERSION => $version,
230230
);
231231

@@ -247,7 +247,7 @@ if (not -e $schema_file) {
247247
if (-e (my $etc_schema_file = "/etc/xdg/$pkgname/schema.pl")) {
248248
require File::Copy;
249249
File::Copy::copy($etc_schema_file, $schema_file)
250-
or die "$0: can't copy file `$etc_schema_file' to `$schema_file': $!\n";
250+
or warn "$0: can't copy file `$etc_schema_file' to `$schema_file': $!\n";
251251
}
252252
else {
253253
die "$0: schema file `$schema_file' does not exists!\n";
@@ -405,7 +405,7 @@ if ($with_icons) {
405405
sub prepare_item {
406406
my $command = shift() =~ s/\}/\\}/gr;
407407
my $name = shift() =~ s/\)/\\)/gr;
408-
my $icon = shift();
408+
my $icon = shift() || $CONFIG{missing_icon};
409409

410410
$with_icons
411411
? <<"ITEM_WITH_ICON"
@@ -596,7 +596,7 @@ if ($create_menu) {
596596
}
597597
}
598598
else {
599-
print STDERR "[!] To generate a new menu, use `-g` or `-i` options.\n";
599+
print STDERR "[!] To generate a new menu, please specify option `-g`.\n";
600600
}
601601

602602
dump_configuration() if $update_config;

0 commit comments

Comments
 (0)