diff options
author | rathnor <rathnor> | 2003-10-20 17:05:14 (GMT) |
---|---|---|
committer | rathnor <rathnor> | 2003-10-20 17:05:14 (GMT) |
commit | ab2d5ca0c79ada652513e25d14430ffb439bd38b (patch) | |
tree | 4b14dd6ba2db63e1d7c8a868c4bba33bb6a874ac /util/fluxbox-generate_menu | |
parent | ecd7c0483412088f64eda8b34d19e0f4b8afc86e (diff) | |
download | fluxbox-ab2d5ca0c79ada652513e25d14430ffb439bd38b.zip fluxbox-ab2d5ca0c79ada652513e25d14430ffb439bd38b.tar.bz2 |
updates from han
Diffstat (limited to 'util/fluxbox-generate_menu')
-rwxr-xr-x | util/fluxbox-generate_menu | 80 |
1 files changed, 50 insertions, 30 deletions
diff --git a/util/fluxbox-generate_menu b/util/fluxbox-generate_menu index 1a5cabd..f9c489c 100755 --- a/util/fluxbox-generate_menu +++ b/util/fluxbox-generate_menu | |||
@@ -22,7 +22,7 @@ | |||
22 | # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 22 | # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
23 | # DEALINGS IN THE SOFTWARE. | 23 | # DEALINGS IN THE SOFTWARE. |
24 | # | 24 | # |
25 | # $Id: fluxbox-generate_menu,v 1.54 2003/10/08 14:18:25 rathnor Exp $ | 25 | # $Id: fluxbox-generate_menu,v 1.55 2003/10/20 17:05:14 rathnor Exp $ |
26 | 26 | ||
27 | # | 27 | # |
28 | # Portability notes: | 28 | # Portability notes: |
@@ -79,7 +79,7 @@ Options: | |||
79 | Only for packagers: | 79 | Only for packagers: |
80 | 80 | ||
81 | -p prefix; default is /usr/local | 81 | -p prefix; default is /usr/local |
82 | -n Gnome-prefix; /opt, /usr and /usr/local autodetected | 82 | -n Gnome-prefix; /opt, /usr, /usr/X11R6 and /usr/local autodetected |
83 | -q KDE-prefix; idem dito | 83 | -q KDE-prefix; idem dito |
84 | 84 | ||
85 | 85 | ||
@@ -111,6 +111,10 @@ case `uname` in | |||
111 | find_it() { | 111 | find_it() { |
112 | which $1 > /dev/null 2>&1 && shift && $* | 112 | which $1 > /dev/null 2>&1 && shift && $* |
113 | } | 113 | } |
114 | |||
115 | find_it_options() { | ||
116 | which $1 > /dev/null 2>&1 | ||
117 | } | ||
114 | ;; | 118 | ;; |
115 | *) | 119 | *) |
116 | find_it() { | 120 | find_it() { |
@@ -125,6 +129,16 @@ case `uname` in | |||
125 | return 1 | 129 | return 1 |
126 | fi | 130 | fi |
127 | } | 131 | } |
132 | |||
133 | find_it_options() { | ||
134 | file=`which $1 2> /dev/null` | ||
135 | if [ -x "$file" ]; then | ||
136 | return 0 | ||
137 | else | ||
138 | return 1 | ||
139 | fi | ||
140 | } | ||
141 | |||
128 | ;; | 142 | ;; |
129 | esac | 143 | esac |
130 | 144 | ||
@@ -226,7 +240,7 @@ GRAPHICMENU='Graphics' | |||
226 | KDEMENUTEXT='KDE-menus' | 240 | KDEMENUTEXT='KDE-menus' |
227 | MISCMENU='Misc' | 241 | MISCMENU='Misc' |
228 | MULTIMEDIAMENU='Multimedia' | 242 | MULTIMEDIAMENU='Multimedia' |
229 | MUSICMENU='Music' | 243 | MUSICMENU='Audio' |
230 | NETMENU='Net' | 244 | NETMENU='Net' |
231 | OFFICEMENU='Office' | 245 | OFFICEMENU='Office' |
232 | RELOADITEM='Reload config' | 246 | RELOADITEM='Reload config' |
@@ -337,11 +351,11 @@ case ${LC_ALL} in | |||
337 | NETMENU='Net' | 351 | NETMENU='Net' |
338 | OFFICEMENU='Office' | 352 | OFFICEMENU='Office' |
339 | RELOADITEM='Vernieuw instellingen' | 353 | RELOADITEM='Vernieuw instellingen' |
340 | RESTARTITEM='Restart' | 354 | RESTARTITEM='Herstart' |
341 | STYLEMENUTITLE='Kies een styl' | 355 | STYLEMENUTITLE='Kies een stijl' |
342 | SYSTEMSTYLES='Systeem Stylen' | 356 | SYSTEMSTYLES='Systeem Stijlen' |
343 | TERMINALMENU='Terminals' | 357 | TERMINALMENU='Terminals' |
344 | USERSTYLES='Gebruikers Stylen' | 358 | USERSTYLES='Gebruikers Stijlen' |
345 | WINDOWMANAGERS='Window Managers' | 359 | WINDOWMANAGERS='Window Managers' |
346 | WORKSPACEMENU='Werkveld menu' | 360 | WORKSPACEMENU='Werkveld menu' |
347 | XUTILSMENU='X-utils' | 361 | XUTILSMENU='X-utils' |
@@ -558,10 +572,12 @@ if [ ! "${INSTALL}" = Yes ]; then | |||
558 | # default you can change it here. Don't forget to remove the # in front | 572 | # default you can change it here. Don't forget to remove the # in front |
559 | # of the line. | 573 | # of the line. |
560 | 574 | ||
561 | # Your favourite terminal | 575 | # Your favourite terminal. Put the command in quotes if you want to use |
562 | # MY_TERM=aterm | 576 | # options. Put a backslash in before odd chars |
577 | # MY_TERM='Eterm --tint \#123456' | ||
578 | # MY_TERM='aterm -tint $(random_color)' | ||
563 | 579 | ||
564 | # Your favourite browser | 580 | # Your favourite browser. You can also specify options. |
565 | # MY_BROWSER=mozilla | 581 | # MY_BROWSER=mozilla |
566 | 582 | ||
567 | # Name of the outputfile | 583 | # Name of the outputfile |
@@ -575,12 +591,15 @@ if [ ! "${INSTALL}" = Yes ]; then | |||
575 | # location with your own menu-entries | 591 | # location with your own menu-entries |
576 | # USERMENU=~/.fluxbox/usermenu | 592 | # USERMENU=~/.fluxbox/usermenu |
577 | 593 | ||
594 | # Options for fbrun | ||
595 | # FBRUNOPTIONS='-font 10x20 -fg grey -bg black -title run' | ||
578 | 596 | ||
579 | # --- PREFIX'es | 597 | # --- PREFIX'es |
580 | # These are prefixes; So if fluxbox is installed in /usr/bin/fluxbox | 598 | # These are prefixes; So if fluxbox is installed in /usr/bin/fluxbox |
581 | # your prefix is: /usr | 599 | # your prefix is: /usr |
582 | # fluxbox-generate already looks in /usr, /usr/local and /opt so there should be no need | 600 | |
583 | # to specify them. | 601 | # fluxbox-generate already looks in /usr/X11R6, /usr, /usr/local and /opt so |
602 | # there should be no need to specify them. | ||
584 | # | 603 | # |
585 | # PREFIX=/usr | 604 | # PREFIX=/usr |
586 | # GNOME_PREFIX=/opt/gnome | 605 | # GNOME_PREFIX=/opt/gnome |
@@ -705,12 +724,13 @@ fi | |||
705 | 724 | ||
706 | # prefix | 725 | # prefix |
707 | PREFIX="${PREFIX:=@PREFIX@}" | 726 | PREFIX="${PREFIX:=@PREFIX@}" |
708 | if [ ! -d "${PREFIX}" -o -z "${PREFIX}" ]; then | 727 | if [ -z "${PREFIX}" -o ! -d "${PREFIX}" ]; then |
709 | PREFIX=/usr/local | 728 | PREFIX=`which fluxbox | sed 's,/bin/fluxbox$,,'` |
710 | fi | 729 | fi |
711 | 730 | ||
731 | |||
712 | # gnome prefix | 732 | # gnome prefix |
713 | for GNOME_PREFIX in "${GNOME_PREFIX}" /usr /opt /usr/local "${PREFIX}"; do | 733 | for GNOME_PREFIX in "${GNOME_PREFIX}" /usr/local /usr/X11R6 /usr /opt "${PREFIX}"; do |
714 | if [ -n "${GNOME_PREFIX}" -a -d "$GNOME_PREFIX/share/gnome" ]; then | 734 | if [ -n "${GNOME_PREFIX}" -a -d "$GNOME_PREFIX/share/gnome" ]; then |
715 | break; | 735 | break; |
716 | fi | 736 | fi |
@@ -718,7 +738,7 @@ done | |||
718 | # Will remain $PREFIX if all else fails | 738 | # Will remain $PREFIX if all else fails |
719 | 739 | ||
720 | # kde prefix | 740 | # kde prefix |
721 | for KDE_PREFIX in "${KDE_PREFIX}" /usr /opt /usr/local "${PREFIX}"; do | 741 | for KDE_PREFIX in "${KDE_PREFIX}" /usr/local /usr/X11R6 /usr /opt "${PREFIX}"; do |
722 | if [ -n "${KDE_PREFIX}" -a -d "$KDE_PREFIX/share/applnk" ]; then | 742 | if [ -n "${KDE_PREFIX}" -a -d "$KDE_PREFIX/share/applnk" ]; then |
723 | break; | 743 | break; |
724 | fi | 744 | fi |
@@ -730,8 +750,7 @@ if [ -z "$BACKGROUND_DIRS" ]; then | |||
730 | fi | 750 | fi |
731 | 751 | ||
732 | # find the default terminal | 752 | # find the default terminal |
733 | 753 | if find_it_options $MY_TERM; then | |
734 | if find_it $MY_TERM; then | ||
735 | DEFAULT_TERM=$MY_TERM | 754 | DEFAULT_TERM=$MY_TERM |
736 | else | 755 | else |
737 | [ -n "$MY_TERM" ] && echo "Warning: you chose an invalid term." >&2 | 756 | [ -n "$MY_TERM" ] && echo "Warning: you chose an invalid term." >&2 |
@@ -744,9 +763,8 @@ else | |||
744 | done | 763 | done |
745 | fi | 764 | fi |
746 | 765 | ||
747 | |||
748 | # find the default browser | 766 | # find the default browser |
749 | if find_it $MY_BROWSER; then | 767 | if find_it_options $MY_BROWSER; then |
750 | DEFAULT_BROWSER=$MY_BROWSER | 768 | DEFAULT_BROWSER=$MY_BROWSER |
751 | else | 769 | else |
752 | [ -n "$MY_BROWSER" ] && echo "Warning: you chose an invalid browser." >&2 | 770 | [ -n "$MY_BROWSER" ] && echo "Warning: you chose an invalid browser." >&2 |
@@ -759,7 +777,6 @@ else | |||
759 | done | 777 | done |
760 | fi | 778 | fi |
761 | 779 | ||
762 | |||
763 | # a unix system without any terms. that's odd | 780 | # a unix system without any terms. that's odd |
764 | if [ -z "$DEFAULT_TERM" ]; then | 781 | if [ -z "$DEFAULT_TERM" ]; then |
765 | cat << EOF >&2 | 782 | cat << EOF >&2 |
@@ -792,19 +809,22 @@ EOF | |||
792 | 809 | ||
793 | echo "[begin] (${MENUTITLE})" >> ${MENUFILENAME} | 810 | echo "[begin] (${MENUTITLE})" >> ${MENUFILENAME} |
794 | 811 | ||
812 | DEFAULT_TERMNAME=`echo $DEFAULT_TERM|awk '{print $1}'` | ||
813 | DEFAULT_TERMNAME=`basename $DEFAULT_TERMNAME` | ||
814 | append "[exec] (${DEFAULT_TERMNAME}) {${DEFAULT_TERM}}" | ||
795 | 815 | ||
796 | append "[exec] (${DEFAULT_TERM}) {${DEFAULT_TERM}}" | 816 | DEFAULT_BROWSERNAME=`echo $DEFAULT_BROWSER|awk '{print $1}'` |
797 | 817 | DEFAULT_BROWSERNAME=`basename $DEFAULT_BROWSERNAME` | |
798 | case "$DEFAULT_BROWSER" in | 818 | case "$DEFAULT_BROWSERNAME" in |
799 | links|w3m|lynx) append "[exec] (${DEFAULT_BROWSER}) {${DEFAULT_TERM} -e ${DEFAULT_BROWSER} ${HOMEPAGE}}" ;; | 819 | links|w3m|lynx) append "[exec] (${DEFAULT_BROWSERNAME}) {${DEFAULT_TERM} -e ${DEFAULT_BROWSER} ${HOMEPAGE}}" ;; |
800 | firebird|mozilla|phoenix|galeon|dillo|netscape) append "[exec] (${DEFAULT_BROWSER}) {${DEFAULT_BROWSER}}" ;; | 820 | firebird|mozilla|phoenix|galeon|dillo|netscape) append "[exec] (${DEFAULT_BROWSERNAME}) {${DEFAULT_BROWSER}}" ;; |
801 | konqueror) append "[exec] (konqueror) {kfmclient openProfile webbrowsing}" ;; | 821 | konqueror) append "[exec] (konqueror) {kfmclient openProfile webbrowsing}" ;; |
802 | opera) append "[exec] (opera) {env QT_XFT=true opera}" ;; | 822 | opera) append "[exec] (opera) {env QT_XFT=true opera}" ;; |
803 | MozillaFirebird) append "[exec] (firebird) {MozillaFirebird}" ;; | 823 | MozillaFirebird) append "[exec] (firebird) {MozillaFirebird}" ;; |
804 | *) append "[exec] (`basename $DEFAULT_BROWSER`) {$DEFAULT_BROWSER}" ;; | 824 | *) append "[exec] ($DEFAULT_BROWSERNAME) {$DEFAULT_BROWSER}" ;; |
805 | esac | 825 | esac |
806 | 826 | ||
807 | find_it fbrun append "[exec] (Run) {fbrun}" | 827 | find_it fbrun append "[exec] (Run) {fbrun $FBRUNOPTIONS}" |
808 | 828 | ||
809 | 829 | ||
810 | append_submenu "${TERMINALMENU}" | 830 | append_submenu "${TERMINALMENU}" |
@@ -881,7 +901,7 @@ append_submenu "${MULTIMEDIAMENU}" | |||
881 | 901 | ||
882 | 902 | ||
883 | append_submenu "${VIDEOMENU}" | 903 | append_submenu "${VIDEOMENU}" |
884 | normal_find xine aviplay gtv gmplayer xmovie xcdroast xgdb ddd realplay xawtv | 904 | normal_find xine aviplay gtv gmplayer xmovie xcdroast xgdb realplay xawtv |
885 | find_it dvdrip append "[exec] (dvdrip) {nohup dvdrip}" | 905 | find_it dvdrip append "[exec] (dvdrip) {nohup dvdrip}" |
886 | append_menu_end | 906 | append_menu_end |
887 | 907 | ||
@@ -999,7 +1019,7 @@ append_submenu "${FBSETTINGSMENU}" | |||
999 | find_it xmessage append \ | 1019 | find_it xmessage append \ |
1000 | "[exec] (Windowname) {xprop WM_CLASS|cut -d \\\" -f 2|xmessage -file - -center}" | 1020 | "[exec] (Windowname) {xprop WM_CLASS|cut -d \\\" -f 2|xmessage -file - -center}" |
1001 | find_it import append "[exec] (screenshot) {import screenshot.png && qiv -W 50 screenshot.png}" | 1021 | find_it import append "[exec] (screenshot) {import screenshot.png && qiv -W 50 screenshot.png}" |
1002 | find_it fbrun append "[exec] (Run) {fbrun}" | 1022 | find_it fbrun append "[exec] (Run) {fbrun $FBRUNOPTIONS}" |
1003 | find_it switch append "[exec] (gtk-theme-switch) {switch}" | 1023 | find_it switch append "[exec] (gtk-theme-switch) {switch}" |
1004 | find_it switch2 append "[exec] (gtk2-theme-switch) {switch2}" | 1024 | find_it switch2 append "[exec] (gtk2-theme-switch) {switch2}" |
1005 | find_it fluxbox-generate_menu append "[exec] (regenerate menu) {fluxbox-generate_menu}" | 1025 | find_it fluxbox-generate_menu append "[exec] (regenerate menu) {fluxbox-generate_menu}" |