diff options
author | mathias <mathias> | 2006-04-19 05:15:33 (GMT) |
---|---|---|
committer | mathias <mathias> | 2006-04-19 05:15:33 (GMT) |
commit | 38a96263ade32c7dba9d24d431836220232d6637 (patch) | |
tree | 124d32df0532b26aec40d1488d26d8c0fca0703c /util | |
parent | 4c011a0a12a06ae87e9bdd296ce503131a292d27 (diff) | |
download | fluxbox_lack-38a96263ade32c7dba9d24d431836220232d6637.zip fluxbox_lack-38a96263ade32c7dba9d24d431836220232d6637.tar.bz2 |
no local or globbing in pure bourne
Diffstat (limited to 'util')
-rwxr-xr-x | util/fluxbox-generate_menu.in | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/util/fluxbox-generate_menu.in b/util/fluxbox-generate_menu.in index 6ec6afe..6bf919e 100755 --- a/util/fluxbox-generate_menu.in +++ b/util/fluxbox-generate_menu.in | |||
@@ -223,7 +223,6 @@ convertIcon(){ | |||
223 | 223 | ||
224 | removePath(){ | 224 | removePath(){ |
225 | execname="$1" | 225 | execname="$1" |
226 | local progname | ||
227 | progname="${execname%% *}" | 226 | progname="${execname%% *}" |
228 | # separate program name and its parameters | 227 | # separate program name and its parameters |
229 | if [ "$progname" = "$execname" ]; then | 228 | if [ "$progname" = "$execname" ]; then |
@@ -231,7 +230,6 @@ removePath(){ | |||
231 | # remove path from only program name | 230 | # remove path from only program name |
232 | execname="${progname##*/}" | 231 | execname="${progname##*/}" |
233 | else | 232 | else |
234 | local params | ||
235 | params="${execname#* }" | 233 | params="${execname#* }" |
236 | # remove path from only program name | 234 | # remove path from only program name |
237 | execname="${progname##*/} $params" | 235 | execname="${progname##*/} $params" |
@@ -266,7 +264,6 @@ doSearchLoop(){ | |||
266 | 264 | ||
267 | doSearch(){ | 265 | doSearch(){ |
268 | # remove '(' from '(fluxbox ...) | ...' | 266 | # remove '(' from '(fluxbox ...) | ...' |
269 | local execname temp_icon | ||
270 | execname=`replaceWithinString "$1" "\("` | 267 | execname=`replaceWithinString "$1" "\("` |
271 | temp_icon="$2" | 268 | temp_icon="$2" |
272 | # $dnlamVERBOSE "# Searching for icon $temp_icon for $execname" >> $ICONMAPPING | 269 | # $dnlamVERBOSE "# Searching for icon $temp_icon for $execname" >> $ICONMAPPING |
@@ -296,7 +293,7 @@ searchForIcon(){ | |||
296 | entry_exec="${1%%&*}" | 293 | entry_exec="${1%%&*}" |
297 | entry_icon="$2" | 294 | entry_icon="$2" |
298 | # $dnlamVERBOSE echo "searchForIcon \"$entry_exec\" \"$entry_icon\"" >&2 | 295 | # $dnlamVERBOSE echo "searchForIcon \"$entry_exec\" \"$entry_icon\"" >&2 |
299 | 296 | ||
300 | # get the basename and parameters of entry_exec -- no path | 297 | # get the basename and parameters of entry_exec -- no path |
301 | entry_exec=`removePath "${entry_exec}"` | 298 | entry_exec=`removePath "${entry_exec}"` |
302 | [ -z "$entry_exec" ] && { echo "Exec is NULL $1 with icon $2"; return 1; } | 299 | [ -z "$entry_exec" ] && { echo "Exec is NULL $1 with icon $2"; return 1; } |
@@ -305,7 +302,6 @@ searchForIcon(){ | |||
305 | if [ -n "$entry_icon" ] && [ ! "$entry_exec" = "$entry_icon" ] && [ ! -f "$entry_icon" ]; then | 302 | if [ -n "$entry_icon" ] && [ ! "$entry_exec" = "$entry_icon" ] && [ ! -f "$entry_icon" ]; then |
306 | # to search for icon in other paths, | 303 | # to search for icon in other paths, |
307 | # get basename | 304 | # get basename |
308 | local temp_icon | ||
309 | temp_icon="${entry_icon##*/}" | 305 | temp_icon="${entry_icon##*/}" |
310 | # remove parameters | 306 | # remove parameters |
311 | temp_icon="${temp_icon#* }" | 307 | temp_icon="${temp_icon#* }" |
@@ -318,7 +314,6 @@ searchForIcon(){ | |||
318 | fi | 314 | fi |
319 | 315 | ||
320 | # remove parameters | 316 | # remove parameters |
321 | local execname | ||
322 | execname="${entry_exec%% *}" | 317 | execname="${entry_exec%% *}" |
323 | 318 | ||
324 | # echo "search for icon named $execname.{xpm,png,gif}" | 319 | # echo "search for icon named $execname.{xpm,png,gif}" |
@@ -336,7 +331,6 @@ searchForIcon(){ | |||
336 | fi | 331 | fi |
337 | 332 | ||
338 | # remove path to icon; just get basename | 333 | # remove path to icon; just get basename |
339 | local icon_base | ||
340 | icon_base="${entry_icon##*/}" | 334 | icon_base="${entry_icon##*/}" |
341 | # remove extension | 335 | # remove extension |
342 | icon_base="${icon_base%%.*}" | 336 | icon_base="${icon_base%%.*}" |
@@ -399,7 +393,6 @@ lookupIcon() { | |||
399 | return 1 | 393 | return 1 |
400 | fi | 394 | fi |
401 | 395 | ||
402 | local execname | ||
403 | execname="$1" | 396 | execname="$1" |
404 | shift | 397 | shift |
405 | [ -n "$1" ] && echo "!! Ignoring extra paramters: $*" >&2 | 398 | [ -n "$1" ] && echo "!! Ignoring extra paramters: $*" >&2 |
@@ -428,13 +421,11 @@ lookupIcon() { | |||
428 | append() { | 421 | append() { |
429 | if [ -z "${INSTALL}" ]; then | 422 | if [ -z "${INSTALL}" ]; then |
430 | # $dnlamVERBOSE echo "append: $*" >&2 | 423 | # $dnlamVERBOSE echo "append: $*" >&2 |
431 | local iconString | ||
432 | iconString="`echo $* | grep -o '<.*>'`" | 424 | iconString="`echo $* | grep -o '<.*>'`" |
433 | # echo "iconString=$iconString" >&2 | 425 | # echo "iconString=$iconString" >&2 |
434 | if [ -z "$iconString" ] && [ -z "$NO_ICON" ]; then | 426 | if [ -z "$iconString" ] && [ -z "$NO_ICON" ]; then |
435 | echo -n " $* " >> ${MENUFILENAME} | 427 | echo -n " $* " >> ${MENUFILENAME} |
436 | # get the program name between '{}' from parameters | 428 | # get the program name between '{}' from parameters |
437 | local execname | ||
438 | execname="$*" | 429 | execname="$*" |
439 | execname=${execname#*\{} | 430 | execname=${execname#*\{} |
440 | execname=${execname%%\}*} | 431 | execname=${execname%%\}*} |
@@ -1286,9 +1277,22 @@ while [ $# -gt 0 ]; do | |||
1286 | -g) GNOMEMENU=yes; shift;; | 1277 | -g) GNOMEMENU=yes; shift;; |
1287 | -in) NO_ICON=yes; shift;; | 1278 | -in) NO_ICON=yes; shift;; |
1288 | -is) OTHER_ICONPATHS=" | 1279 | -is) OTHER_ICONPATHS=" |
1289 | /usr{,/local}/share{,/xclass}/{icons,pixmaps} | 1280 | /usr/share/icons, |
1290 | /usr{,/local}/share/icons/mini | 1281 | /usr/share/icons/mini, |
1291 | /usr{,/local}/{,X11R6/}share/icons/{default.kde,hicolor}/16x16/* | 1282 | /usr/share/pixmaps, |
1283 | /usr/local/share/icons, | ||
1284 | /usr/local/share/icons/mini, | ||
1285 | /usr/local/share/pixmaps, | ||
1286 | /usr/share/xclass/icons, | ||
1287 | /usr/share/xclass/pixmaps, | ||
1288 | /usr/local/share/xclass/icons, | ||
1289 | /usr/local/share/xclass/pixmaps, | ||
1290 | /usr/X11R6/share/icons/default/16x16, | ||
1291 | /usr/X11R6/share/icons/kde/16x16, | ||
1292 | /usr/X11R6/share/icons/hicolor/16x16, | ||
1293 | /usr/local/X11R6/share/icons/default/16x16, | ||
1294 | /usr/local/X11R6/share/icons/kde/16x16, | ||
1295 | /usr/local/X11R6/share/icons/hicolor/16x16, | ||
1292 | " | 1296 | " |
1293 | shift;; | 1297 | shift;; |
1294 | -ds) OTHER_DESKTOP_PATHS=" | 1298 | -ds) OTHER_DESKTOP_PATHS=" |