22
22
# Name: fbmenugen
23
23
# License: GPLv3
24
24
# Created on: 01 August 2010
25
- # Latest edit on: 21 January 2020
25
+ # Latest edit on: 31 January 2020
26
26
# https://github.com/trizen/fbmenugen
27
27
28
28
use 5.014;
@@ -101,7 +101,7 @@ my $config_help = <<"HELP";
101
101
],
102
102
103
103
|| 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)
105
105
| gtk_rc_filename : Absolute path to the GTK configuration file.
106
106
| missing_icon : Use this icon for missing icons (default: gtk-missing-image)
107
107
| icon_size : Preferred size for icons. (default: 32)
@@ -136,6 +136,7 @@ if (@ARGV) {
136
136
}
137
137
elsif ($arg eq ' -d' ) {
138
138
$db_clean = 1;
139
+ print STDERR " [*] Regenerating the cache DB...\n " ;
139
140
unlink $cache_db ;
140
141
}
141
142
elsif ($arg eq ' -u' ) {
@@ -146,14 +147,14 @@ if (@ARGV) {
146
147
exit 0;
147
148
}
148
149
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 " ;
150
151
}
151
152
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 " ;
153
154
}
154
155
elsif ($arg eq ' -C' ) {
155
156
$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 " ;
157
158
}
158
159
elsif ($arg eq ' -h' ) {
159
160
usage();
@@ -213,19 +214,18 @@ my %CONFIG = (
213
214
# >>>
214
215
},
215
216
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" ,
219
222
220
223
icon_size => 32,
221
224
force_icon_size => 0,
222
225
generic_fallback => 0,
223
226
locale_support => 1,
224
227
use_gtk3 => 0,
225
228
226
- missing_icon => ' gtk-missing-image' ,
227
- gtk_rc_filename => " $home_dir /.gtkrc-2.0" ,
228
-
229
229
VERSION => $version ,
230
230
);
231
231
@@ -247,7 +247,7 @@ if (not -e $schema_file) {
247
247
if (-e (my $etc_schema_file = " /etc/xdg/$pkgname /schema.pl" )) {
248
248
require File::Copy;
249
249
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 " ;
251
251
}
252
252
else {
253
253
die " $0 : schema file `$schema_file ' does not exists!\n " ;
@@ -405,7 +405,7 @@ if ($with_icons) {
405
405
sub prepare_item {
406
406
my $command = shift () =~ s /\} / \\ }/ gr ;
407
407
my $name = shift () =~ s /\) / \\ )/ gr ;
408
- my $icon = shift ();
408
+ my $icon = shift () || $CONFIG { missing_icon } ;
409
409
410
410
$with_icons
411
411
? <<"ITEM_WITH_ICON"
@@ -596,7 +596,7 @@ if ($create_menu) {
596
596
}
597
597
}
598
598
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 " ;
600
600
}
601
601
602
602
dump_configuration() if $update_config ;
0 commit comments