util/fluxbox-generate_menu (raw)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 |
#!/bin/sh # # generate_menu for Fluxbox # # Copyright (c) 2002 Han Boetes <han@mijncomputer.nl> # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, including without limitation # the rights to use, copy, modify, merge, publish, distribute, sublicense, # and/or sell copies of the Software, and to permit persons to whom the # Software is furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER # DEALINGS IN THE SOFTWARE. # # $Id: fluxbox-generate_menu,v 1.20 2002/12/17 16:42:20 fluxgen Exp $ WHOAMI=`whoami` [ "$WHOAMI" = "root" ] && PATH=/bin:/usr/bin/:/usr/local/bin:/usr/X11R6/bin # Functions display_usage() { cat <<EOF Usage: fluxbox-generate_menu [-kgrB] [-t terminal] [-w url] [-b browser] [-m menu-title] [-p /path] [-n /path] [-q /path] [-o /path] EOF } display_help() { display_usage cat <<EOF Options: -k Insert a kde menu -g Add a gnome menu -B enable backgroundmenu -m Menu-title; default is "Fluxbox" -r Don't remove empty menu-entries; for templates. -o Outputfile; default is ~/.fluxbox/menu -t Favourite terminal -b Favourite browser -w Homepage for console-browsers. Default is fluxbox.org. -h Display this help -a Display the authors of this script Only for packagers: -p Package-datadir; default is /usr/share -n Gnome-datadir; default is Package-datadir -q KDE-datadir; default is Package-datadir EOF } display_authors() { cat <<EOF fluxbox-generate_menu was brought to you by: Henrik Kinnunen: Project leader. Han Boetes: Packaging, debugging and scripts. Jeramy B. Smith: Packaging assistance, gnome and kde menu system. Filippo Pappalardo: Italian locales and -t option. Simon Bowden: Cleanups and compatibility for sun. $WHOAMI: Innocent bystander. EOF } find_it() { file=`which $1 2> /dev/null` if [ -x "$file" ]; then if [ $# -gt 1 ]; then shift $* fi return 0 else return 1 fi } append() { echo " $*" >> ${FILENAME} } append_menu() { echo "$*" >> ${FILENAME} } append_submenu() { # only an empty line in templates [ "${REMOVE}" ] && echo >> ${FILENAME} append_menu "[submenu] ($1)" } append_menu_end() { append_menu "[end]" # only an empty line in templates [ "${REMOVE}" ] && echo >> ${FILENAME} } menu_entry() { append "[exec] (`grep -v GenericName $* | grep Name= | cut -d = -f 2`) \ {`grep -v TryExec $* | grep Exec= | cut -d = -f 2`}" } menu_entry_dircheck() { if [ -d "$*" ]; then menu_entry_dir "$*" fi } menu_entry_dir() { for b in `ls "$*"/*.desktop 2>/dev/null `; do menu_entry "${b}" done } normal_find() { while [ "$1" ]; do find_it $1 append "[exec] ($1) {$1}" shift done } clean_up() { # -e "/^$/d" -e "/^$/d" cat ${FILENAME} | sed -e "/^\[submenu]/{ N /^\[submenu].*\n\[end]/d }" > ${FILENAME}.tmp mv -f ${FILENAME}.tmp ${FILENAME} } # Save options for inclusion in menu options="$@" # Get options. while getopts ":Bkhragb:t:p:w:n:q:o:m:" COMMAND_LINE_ARGUMENT ; do case "${COMMAND_LINE_ARGUMENT}" in B) BACKGROUNDMENUITEM=yes ;; k) KDEMENU=yes ;; g) GNOMEMENU=yes ;; t) MY_TERM=${OPTARG};; b) MY_BROWSER=${OPTARG};; o) FILENAME=${OPTARG} ;; p) PKGDATADIR=${OPTARG} ;; n) GPKGDATADIR=${OPTARG} ;; q) KPKGDATADIR=${OPTARG} ;; m) MENUTITLE=${OPTARG} ;; w) HOMEPAGE=${OPTARG} ;; r) REMOVE=no ;; h) display_help ; exit 0 ;; a) display_authors ; exit 0 ;; *) display_usage ; exit 1 ;; esac done # Set Defaults # menufile name if [ -z "${FILENAME}" ]; then FILENAME=${HOME}/.fluxbox/menu fi # Can we actually create ${FILENAME} touch ${FILENAME} 2> /dev/null if [ $? -ne 0 ] ; then echo "Fatal error: can't create $FILENAME" >&2 exit 1 fi # backup menu if [ -w "${FILENAME}" ]; then if [ -f ${FILENAME}.firstbak ];then cp ${FILENAME} ${FILENAME}.firstbak fi mv ${FILENAME} ${FILENAME}.bak fi # default homepage for console-browsers HOMEPAGE=${HOMEPAGE:=fluxbox.org} #packagedatadir if [ ! -d "${PKGDATADIR}" -o "${PKGDATADIR}" = "" ]; then if [ "`uname`" = "Linux" ];then PKGDATADIR=/usr/share else PKGDATADIR=/usr/local/share fi fi #gnome packagedatadir if [ ! -d "${GPKGDATADIR}" -o "${GPKGDATADIR}" = "" ]; then GPKGDATADIR=${PKGDATADIR} fi #kde packagedatadir if [ ! -d "${KPKGDATADIR}" -o "${KPKGDATADIR}" = "" ]; then KPKGDATADIR=${PKGDATADIR} fi # menutitle if [ -z "${MENUTITLE}" ]; then MENUTITLE="Fluxbox" fi # find the default terminal find_it $MY_TERM if [ $? -ne 0 ];then [ -n "$MY_TERM" ] && echo "Warning: you choose an invalid term." >&2 #The precise order is up for debate. for term in Eterm aterm rxvt wterm xterm konsole gnome-terminal; do if find_it $term; then DEFAULT_TERM=$term break fi done else DEFAULT_TERM=$MY_TERM fi # find the default browser find_it $MY_BROWSER if [ $? -ne 0 ];then [ -n "$MY_BROWSER" ] && echo "Warning: you choose an invalid browser." >&2 #The precise order is up for debate. for browser in opera phoenix mozilla galeon konqueror dillo netscape links w3m lynx; do if find_it $browser; then DEFAULT_BROWSER=$browser break fi done else DEFAULT_BROWSER=$MY_BROWSER fi # a unix system without any terms. that's odd if [ -z "$DEFAULT_TERM" ];then cat <<EOF>&2 Warning: I can't find any terminal-emulators in your PATH. Please fix your PATH or specify your favourite terminal with the -t option EOF fi # menu defaults (if translation forget to set one of them) BACKGROUNDMENU="Backgrounds" BACKGROUNDMENUTITLE="Set the Background" BROWSERMENU="Browsers" CONFIGUREMENU="Configure" EDITORMENU="Editors" EXITITEM="Exit" FBSETTINGSMENU="FB-Settings" GAMESMENU="Games" GNOMEMENUTEXT="Gnome-menus" GRAPHICMENU="Graphics" KDEMENUTEXT="KDE-menus" MISCMENU="Misc" MULTIMEDIAMENU="Multimedia" MUSICMENU="Music" NETMENU="Net" OFFICEMENU="Office" RELOADITEM="Reload config" RESTARTITEM="Restart" SYSTEMSTYLES="System Styles" USERSTYLES="User Styles" STYLEMENUTITLE="Choose a style..." TERMINALMENU="Terminals" WORKSPACEMENU="Workspace List" XUTILSMENU="X-utils" # Check translation case ${LC_ALL} in ru_RU*) #Russian locales #OFFICEMENU="Office" #BACKGROUNDMENU="Backgrounds" #BACKGROUNDMENUTITLE="Set the Background" BROWSERMENU="âÒÁÕÚÅÒÙ" CONFIGUREMENU="îÁÓÔÒÏÊËÁ" EDITORMENU="òÅÄÁËÔÏÒÙ" EXITITEM="÷ÙÊÔÉ" FBSETTINGSMENU="FB-ÎÁÓÔÒÏÊËÉ" GNOMEMENUTEXT="Gnome-ÍÅÎÀ" GRAPHICMENU="çÒÁÆÉËÁ" KDEMENUTEXT="KDE-ÍÅÎÀ" MISCMENU="ðÒÏÞÅÅ" MUSICMENU="ú×ÕË" NETMENU="óÅÔØ" RELOADITEM="ðÅÒÅÎÁÓÔÒÏÉÔØ" RESTARTITEM="ðÅÒÅÚÁÐÕÓÔÉÔØ" SYSTEMSTYLES="óÔÉÌÉ" USERSTYLES="óÔÉÌÉ" STYLEMENUTITLE="÷ÙÂÅÒÉÔÅ ÓÔÉÌØ" TERMINALMENU="ôÅÒÍÉÎÁÌÙ" WORKSPACEMENU="òÁÂÏÞÉÅ ÐÒÏÓÔÒÁÎÓÔ×Á" XUTILSMENU="X-ÕÔÉÌÉÔÙ" ;; de_DE*) # german locales #OFFICEMENU="Bueroprogramme" BROWSERMENU="Internet-Browser" CONFIGUREMENU="Einstellungen" EDITORMENU="Editoren" EXITITEM="Beenden" FBSETTINGSMENU="Fluxbox-Einstellungen" GNOMEMENUTEXT="Gnome-Menues" GRAPHICMENU="Grafik" KDEMENUTEXT="Kde-Menues" MISCMENU="Sonstiges" MUSICMENU="Musik" NETMENU="Netzwerk" RELOADITEM="Konfiguration neu laden" RESTARTITEM="Neustarten" STYLEMENU="Stile" STYLEMENUTITLE="Einen Stil auswaehlen..." TERMINALMENU="Terminals" WORKSPACEMENU="Arbeitsflaechenliste" XUTILSMENU="X-Anwendungen" ;; sv_SE*) #Swedish locales #OFFICEMENU="Office" #BACKGROUNDMENU="Backgrounds" #BACKGROUNDMENUTITLE="Set the Background" BROWSERMENU="Browsers" CONFIGUREMENU="Konfiguration" EDITORMENU="Editorer" EXITITEM="Exit" FBSETTINGSMENU="FB-inställningar" GNOMEMENUTEXT="Gnome-menyer" GRAPHICMENU="Grafik" KDEMENUTEXT="KDE-menyer" MISCMENU="Blandat" MUSICMENU="Musik" NETMENU="Net" RELOADITEM="Ladda om konfig" RESTARTITEM="Starta om" SYSTEMSTYLES="Stiler" USERSTYLES="Stiler" STYLEMENUTITLE="Välj en stil" TERMINALMENU="Terminaler" WORKSPACEMENU="Arbetsytor" XUTILSMENU="X-program" ;; nl_NL*) #Nederlandse locales #OFFICEMENU="Office" #BACKGROUNDMENU="Achtergrond" #BACKGROUNDMENUTITLE="Kies een achtergrond" BROWSERMENU="Browsers" CONFIGUREMENU="Instellingen" EDITORMENU="Editors" EXITITEM="Afsluiten" FBSETTINGSMENU="FB-Instellingen" GNOMEMENUTEXT="Gnome-menu" GRAPHICMENU="Grafisch" KDEMENUTEXT="KDE-menu" MISCMENU="Onregelmatig" MUSICMENU="Muziek" NETMENU="Net" RELOADITEM="Vernieuw instellingen" RESTARTITEM="Restart" SYSTEMSTYLES="Systeem Stylen" USERSTYLES="Gebruikers Stylen" STYLEMENUTITLE="Kies een styl" TERMINALMENU="Terminals" WORKSPACEMENU="Werkveld Lijst" XUTILSMENU="X-utils" ;; fi_FI*) #Finnish locales #OFFICEMENU="Office" #BACKGROUNDMENU="Backgrounds" #BACKGROUNDMENUTITLE="Set the Background" BROWSERMENU="Selaimet" CONFIGUREMENU="Konfigurointi" EDITORMENU="Editorit" EXITITEM="Lopeta" FBSETTINGSMENU="FB:n Asetukset" GNOMEMENUTEXT="Gnomen valikot" GRAPHICMENU="Grafiikka" KDEMENUTEXT="KDE:n valikot" MISCMENU="Sekalaista" MUSICMENU="Musikki" NETMENU="Verkko" RELOADITEM="Päivitä" RESTARTITEM="Käynnistä uudelleen" SYSTEMSTYLES="Tyylit" USERSTYLES="Tyylit" STYLEMENUTITLE="Valitse tyyli" TERMINALMENU="Terminaalit" WORKSPACEMENU="Työaluet" XUTILSMENU="X-Ohjelmat" ;; ja_JP*) #Japanese locales #OFFICEMENU="Office" #BACKGROUNDMENU="Backgrounds" #BACKGROUNDMENUTITLE="Set the Background" BROWSERMENU="¥Ö¥é¥¦¥¶" CONFIGUREMENU="ÀßÄê" EDITORMENU="¥¨¥Ç¥£¥¿" EXITITEM="½ªÎ»" FBSETTINGSMENU="FluxboxÀßÄê" GNOMEMENUTEXT="Gnome¥á¥Ë¥å¡¼" GRAPHICMENU="²èÁü" KDEMENUTEXT="KDE¥á¥Ë¥å¡¼" MISCMENU="¤¤¤í¤¤¤í" MUSICMENU="²»³Ú" NETMENU="¥Í¥Ã¥È¥ï¡¼¥¯" RELOADITEM="ºÆÆɤ߹þ¤ß" RESTARTITEM="ºÆµ¯Æ°" SYSTEMSTYLES="¥¹¥¿¥¤¥ë" USERSTYLES="¥¹¥¿¥¤¥ë" STYLEMENUTITLE="¥¹¥¿¥¤¥ëÁªÂò..." TERMINALMENU="¥¿¡¼¥ß¥Ê¥ë" WORKSPACEMENU="¥ï¡¼¥¯¥¹¥Ú¡¼¥¹" XUTILSMENU="X¥æ¡¼¥Æ¥£¥ê¥Æ¥£" ;; fr_FR*) # french locales #OFFICEMENU="Office" #BACKGROUNDMENU="Backgrounds" #BACKGROUNDMENUTITLE="Set the Background" BROWSERMENU="Navigateurs" CONFIGUREMENU="Configurer" EDITORMENU="Editeurs" EXITITEM="Sortir" FBSETTINGSMENU="FB-Settings" GNOMEMENUTEXT="menus-Gnome" GRAPHICMENU="Graphisme" KDEMENUTEXT="menus-KDE" MISCMENU="Misc" MUSICMENU="Musique" NETMENU="Net" RELOADITEM="Recharger config" RESTARTITEM="Redémarrer" SYSTEMSTYLES="Styles de la Systeme" USERSTYLES="Styles" STYLEMENUTITLE="Choisir un style..." TERMINALMENU="Terminaux" WORKSPACEMENU="Liste des bureaux" XUTILSMENU="X-utils" ;; it_IT*) # italian locales #OFFICEMENU="Office" #BACKGROUNDMENU="Backgrounds" #BACKGROUNDMENUTITLE="Set the Background" BROWSERMENU="Browsers" CONFIGUREMENU="Configurazione" EDITORMENU="Editori" EXITITEM="Esci" FBSETTINGSMENU="Preferenze" GAMESMENU="Giochi" GNOMEMENUTEXT="Gnome" GRAPHICMENU="Grafica" KDEMENUTEXT="KDE" MISCMENU="Varie" MUSICMENU="Musica" NETMENU="Internet" RELOADITEM="Rileggi la configurazione" RESTARTITEM="Riavvia" SYSTEMSTYLES="Stile" USERSTYLES="Stile" STYLEMENUTITLE="Scegli uno stile" TERMINALMENU="Terminali" WORKSPACEMENU="Aree di lavoro" XUTILSMENU="X-utils" ;; *) ;; esac # Start of menu cat << EOF > ${FILENAME} # Generated by fluxbox-genereate_menu # # If you read this it means you want to edit this file manualy, # so here are some usefull tips: # # - The -r option prevents removing of empty menu entries and makes # thing much more readable. # # - To prevent any other app from overwriting your menu # you can change the menu name in .fluxbox/init to: # session.menuFile: /home/you/.fluxbox/my-menu EOF echo "[begin] (${MENUTITLE})" >> ${FILENAME} append "[exec] (${DEFAULT_TERM}) {${DEFAULT_TERM}}" case "$DEFAULT_BROWSER" in links|w3m|lynx) append "[exec] (${DEFAULT_BROWSER}) {${DEFAULT_TERM} -e ${DEFAULT_BROWSER} ${HOMEPAGE}}" ;; mozilla|phoenix|galeon|dillo|netscape) append "[exec] (${DEFAULT_BROWSER}) {${DEFAULT_BROWSER}}" ;; konqueror) append "[exec] (konqueror) {kfmclient openProfile webbrowsing}" ;; opera) append "[exec] (opera) {env QT_XFT=true opera}" ;; esac find_it fbrun append "[exec] (Run) {fbrun}" append_submenu ${TERMINALMENU} normal_find xterm gnome-terminal Eterm konsole aterm rxvt append_menu_end append_submenu ${NETMENU} append_submenu ${BROWSERMENU} normal_find netscape galeon mozilla dillo find_it opera append "[exec] (opera) {env QT_XFT=true opera}" find_it konqueror append "[exec] (konqueror) {kfmclient openProfile webbrowsing}" find_it links append "[exec] (links) {${DEFAULT_TERM} -e links ${HOMEPAGE}}" find_it w3m append "[exec] (w3m) {${DEFAULT_TERM} -e w3m ${HOMEPAGE}}" find_it lynx append "[exec] (lynx) {${DEFAULT_TERM} -e lynx ${HOMEPAGE}}" append_menu_end append_submenu IM normal_find gaim kopete gnomemeeting find_it licq append "[exec] (licq) {env QT_XFT=true licq}" append_menu_end append_submenu Mail normal_find sylpheed kmail evolution find_it mutt append "[exec] (mutt) {${DEFAULT_TERM} -e mutt}" append_menu_end append_submenu IRC normal_find xchat find_it irssi append "[exec] (irssi) {${DEFAULT_TERM} -e irssi}" find_it BitchX append "[exec] (BitchX) {${DEFAULT_TERM} -e BitchX -N}" [ $? -ne 0 ] && \ find_it bitchx append "[exec] (BitchX) {${DEFAULT_TERM} -e bitchx -N}" find_it ircii append "[exec] (ircii) {${DEFAULT_TERM} -e ircii -s}" append_menu_end normal_find gftp pan append_menu_end append_submenu ${EDITORMENU} normal_find nedit gvim xemacs emacs gedit xedit kword kwrite kate append_menu_end append_submenu ${MULTIMEDIAMENU} append_submenu ${GRAPHICMENU} normal_find gimp xv gqview xpaint kpaint kiconedit xscreensaver-demo find_it gears append "[exec] (Mesa gears) {gears}" find_it morph3d append "[exec] (Mesa morph) {morph3d}" find_it reflect append "[exec] (Mesa reflect) {reflect}" append_menu_end append_submenu ${MUSICMENU} normal_find xmms gqmpeg xmixer gmix kmix grecord \ kmidi xplaycd soundtracker grip easytag find_it cplay append "[exec] (cplay) {${DEFAULT_TERM} -e cplay}" append_menu_end append_submenu ${MISCMENU} normal_find xine aviplay gtv gmplayer xmovie xcdroast xgdb ddd realplay find_it dvdrip append "[exec] (dvdrip) {nohup dvdrip}" append_menu_end append_submenu ${XUTILSMENU} normal_find xfontsel xman xload xfigxbiff editres viewres xclock append_menu_end append_menu_end append_submenu ${OFFICEMENU} normal_find xclock xcalc kcalc find_it gcalc append "[exec] (gcalc) {gcalc}" [ $? -ne 0 ] && \ find_it gnome-calculator append "[exec] (gcalc) {gnome-calculator}" find_it ooffice append "[exec] (Open Office) {ooffice}" find_it soffice append "[exec] (Star Office) {soffice}" normal_find abiword kword wordperfect katoob acroread xpdf append_menu_end append_submenu ${GAMESMENU} normal_find bzflag gnibbles gnobots2 tuxpuck gataxx glines \ gnect mahjongg gnomine gnome-stones gnometris gnotravex \ gnotski iagno knights same-gnome xboard freecell pysol \ gtali tuxracer xpenguins xsnow xeyes xpenguins \ quake2 quake3 append_menu_end # gnome menu if [ -d ${GPKGDATADIR}/gnome/apps -a "${GNOMEMENU}" ]; then append_submenu ${GNOMEMENUTEXT} for a in `ls ${GPKGDATADIR}/gnome/apps/` ; do if [ -d ${GPKGDATADIR}/gnome/apps/"${a}" ] ; then append_submenu "${a}" menu_entry_dir "${GPKGDATADIR}/gnome/apps/${a}" menu_entry_dircheck "/etc/X11/applnk/${a}" append_menu_end fi done append_menu_end fi # kde submenu if [ -d ${KPKGDATADIR}/applnk/ -a "${KDEMENU}" ]; then append_submenu ${KDEMENUTEXT} for a in `ls ${KPKGDATADIR}/applnk/` ; do if [ -d ${KPKGDATADIR}/applnk/"${a}" ]; then append_submenu "${a}" for x in ${KPKGDATADIR}/applnk/"${a}"/*; do if [ -d ${KPKGDATADIR}/applnk/"${a}"/"${x}" ]; then append_submenu "${x}" menu_entry_dir ${KPKGDATADIR}/applnk/"${a}"/"${x}" append_menu_end fi done menu_entry_dir ${KPKGDATADIR}/applnk/"${a}" append_menu_end fi done menu_entry_dir ${KPKGDATADIR}/applnk/ append_menu_end fi # append_submenu ${FBSETTINGSMENU} append_submenu Fluxbox-menu append "[config] (${CONFIGUREMENU})" append_menu "[submenu] (${SYSTEMSTYLES}) {${STYLEMENUTITLE}}" append "[stylesdir] (${PKGDATADIR}/fluxbox/styles)" append_menu_end append_menu "[submenu] (${USERSTYLES}) {${STYLEMENUTITLE}}" append "[stylesdir] (~/.fluxbox/styles)" append_menu_end if [ "$BACKGROUNDMENUITEM" = "yes" ];then append_menu "[submenu] (${BACKGROUNDMENU}) {${BACKGROUNDMENUTITLE}}" for i in ~/.fluxbox/backgrounds/* ; do append "[exec] (`basename "$i"`) {bsetbg -f $i }" done append_menu_end fi append "[workspaces] (${WORKSPACEMENU})" append_submenu Tools find_it fluxconf append "[exec] (FluxConf) {fluxconf}" find_it fluxkeys append "[exec] (FluxKeys) {fluxkeys}" find_it fluxmenu append "[exec] (FluxMenu) {fluxmenu}" # if gxmessage exitst use it; else use xmessage find_it gxmessage append \ "[exec] (Windowname) {xprop|grep WM_CLASS|cut -d \\\" -f 2|gxmessage -file - -center}" [ $? -ne 0 ] && \ find_it xmessage append \ "[exec] (Windowname) {xprop|grep WM_CLASS|cut -d \\\" -f 2|xmessage -file - -center}" find_it fbrun append "[exec] (Run) {fbrun}" find_it fluxbox-generate_menu append "[exec] (Regen menu) {fluxbox-generate_menu $options}" append_menu_end append "[reconfig] (${RELOADITEM})" append "[restart] (${RESTARTITEM})" append "[exit] (${EXITITEM})" append_menu_end append_menu_end # this function removes empty menu items. It can not yet remove nested # empty submenus :\ if [ ! "${REMOVE}" ];then clean_up fi echo "Menu succesfully generated." |