summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authormarkt <markt>2007-07-07 23:11:04 (GMT)
committermarkt <markt>2007-07-07 23:11:04 (GMT)
commit135019abf97c7adb236c061d46e3906e51c8a145 (patch)
tree2e675ac4d9dfda48301e0b2a40b057448174692e /util
parentb735d405f58ac226e025d6ef4dbd91a0129bb12e (diff)
downloadfluxbox_lack-135019abf97c7adb236c061d46e3906e51c8a145.zip
fluxbox_lack-135019abf97c7adb236c061d46e3906e51c8a145.tar.bz2
fixes for --program-prefix and --program-suffix, plus fixed overwriting init file on reconfigure
Diffstat (limited to 'util')
-rw-r--r--util/Makefile.am2
-rwxr-xr-xutil/fluxbox-generate_menu.in62
-rwxr-xr-xutil/startfluxbox.in9
3 files changed, 39 insertions, 34 deletions
diff --git a/util/Makefile.am b/util/Makefile.am
index 2033608..6c0adf6 100644
--- a/util/Makefile.am
+++ b/util/Makefile.am
@@ -41,6 +41,8 @@ startfluxbox: startfluxbox.in
41 41
42fluxbox-generate_menu: fluxbox-generate_menu.in 42fluxbox-generate_menu: fluxbox-generate_menu.in
43 @regex_cmd@ -e "s,@PREFIX@,$(prefix),g" \ 43 @regex_cmd@ -e "s,@PREFIX@,$(prefix),g" \
44 -e "s,@pkgprefix@,$(PROGRAM_PREFIX:NONE=),g" \
45 -e "s,@pkgsuffix@,$(PROGRAM_SUFFIX:NONE=),g" \
44 $(srcdir)/fluxbox-generate_menu.in \ 46 $(srcdir)/fluxbox-generate_menu.in \
45 > fluxbox-generate_menu 47 > fluxbox-generate_menu
46 -chmod 755 fluxbox-generate_menu 48 -chmod 755 fluxbox-generate_menu
diff --git a/util/fluxbox-generate_menu.in b/util/fluxbox-generate_menu.in
index b98ea2a..1060724 100755
--- a/util/fluxbox-generate_menu.in
+++ b/util/fluxbox-generate_menu.in
@@ -61,7 +61,7 @@ fi
61# Functions 61# Functions
62display_usage() { 62display_usage() {
63 cat << EOF 63 cat << EOF
64Usage: fluxbox-generate_menu [-kgrBh] [-t terminal] [-w url] [-b browser] 64Usage: @pkgprefix@fluxbox-generate_menu@pkgsuffix@ [-kgrBh] [-t terminal] [-w url] [-b browser]
65 [-m menu-title] [-o /path] [-u /path] [-p /path] [-n /path] [-q /path] 65 [-m menu-title] [-o /path] [-u /path] [-p /path] [-n /path] [-q /path]
66 [-d /path ] [-ds] [-i /path] [-is] 66 [-d /path ] [-ds] [-i /path] [-is]
67EOF 67EOF
@@ -89,8 +89,8 @@ Options:
89 -w Homepage for console-browsers. Default is fluxbox.org 89 -w Homepage for console-browsers. Default is fluxbox.org
90 -b Favourite browser 90 -b Favourite browser
91 -m Menu-title; default is "Fluxbox" 91 -m Menu-title; default is "Fluxbox"
92 -o Outputfile; default is ~/.fluxbox/menu 92 -o Outputfile; default is ~/.@pkgprefix@fluxbox@pkgsuffix@/menu
93 -u user sub-menu; default is ~/.fluxbox/usermenu 93 -u user sub-menu; default is ~/.@pkgprefix@fluxbox@pkgsuffix@/usermenu
94 94
95 -h Display this help 95 -h Display this help
96 -a Display the authors of this script 96 -a Display the authors of this script
@@ -103,8 +103,8 @@ Options:
103 103
104 104
105Files: 105Files:
106 ~/.fluxbox/usermenu your own submenu which will be included in the menu 106 ~/.@pkgprefix@fluxbox@pkgsuffix@/usermenu your own submenu which will be included in the menu
107 ~/.fluxbox/menuconfig rc file for fluxbox-generate_menu 107 ~/.@pkgprefix@fluxbox@pkgsuffix@/menuconfig rc file for fluxbox-generate_menu
108 108
109EOF 109EOF
110} 110}
@@ -112,7 +112,7 @@ EOF
112display_authors() { 112display_authors() {
113 cat << EOF 113 cat << EOF
114 114
115fluxbox-generate_menu was brought to you by: 115@pkgprefix@fluxbox-generate_menu@pkgsuffix@ was brought to you by:
116 116
117 Henrik Kinnunen: Project leader. 117 Henrik Kinnunen: Project leader.
118 Han Boetes: Packaging, debugging and scripts. 118 Han Boetes: Packaging, debugging and scripts.
@@ -326,7 +326,7 @@ searchForIcon(){
326 326
327 # convert icon file, if needed 327 # convert icon file, if needed
328 if [ -f "$entry_icon" ] && [ -n "yes$ConvertIfNecessary" ]; then 328 if [ -f "$entry_icon" ] && [ -n "yes$ConvertIfNecessary" ]; then
329 entry_icon=`convertIcon "$entry_icon" "$HOME/.fluxbox/icons"` 329 entry_icon=`convertIcon "$entry_icon" "$USERFLUXDIR/icons"`
330 # $dnlamVERBOSE echo ":::: $entry_icon" >&2 330 # $dnlamVERBOSE echo ":::: $entry_icon" >&2
331 fi 331 fi
332 332
@@ -1201,20 +1201,22 @@ case ${LC_ALL} in
1201esac 1201esac
1202 1202
1203# Set Defaults 1203# Set Defaults
1204MENUFILENAME="${MENUFILENAME:=${HOME}/.fluxbox/menu}" 1204USERFLUXDIR="${HOME}/.@pkgprefix@fluxbox@pkgsuffix@"
1205MENUFILENAME="${MENUFILENAME:=${USERFLUXDIR}/menu}"
1205MENUTITLE="${MENUTITLE:=Fluxbox}" 1206MENUTITLE="${MENUTITLE:=Fluxbox}"
1206HOMEPAGE="${HOMEPAGE:=fluxbox.org}" 1207HOMEPAGE="${HOMEPAGE:=fluxbox.org}"
1207USERMENU="${USERMENU:=${HOME}/.fluxbox/usermenu}" 1208USERMENU="${USERMENU:=${USERFLUXDIR}/usermenu}"
1209MENUCONFIG="${MENUCONFIG:=${USERFLUXDIR}/menuconfig}"
1208 1210
1209# Read the menuconfig file if it exists or else create it. 1211# Read the menuconfig file if it exists or else create it.
1210# But not during install time, use envvar for sun 1212# But not during install time, use envvar for sun
1211if [ ! "${INSTALL}" = Yes ]; then 1213if [ ! "${INSTALL}" = Yes ]; then
1212 if [ -r ${HOME}/.fluxbox/menuconfig ]; then 1214 if [ -r ${MENUCONFIG} ]; then
1213 . ${HOME}/.fluxbox/menuconfig 1215 . ${MENUCONFIG}
1214 else 1216 else
1215 if [ ! "$WHOAMI" = root ]; then # this is only for users. 1217 if [ ! "$WHOAMI" = root ]; then # this is only for users.
1216 if touch ${HOME}/.fluxbox/menuconfig; then 1218 if touch ${MENUCONFIG}; then
1217 cat << EOF > ${HOME}/.fluxbox/menuconfig 1219 cat << EOF > ${MENUCONFIG}
1218# This file is read by fluxbox-generate_menu. If you don't like a 1220# This file is read by fluxbox-generate_menu. If you don't like a
1219# default you can change it here. Don't forget to remove the # in front 1221# default you can change it here. Don't forget to remove the # in front
1220# of the line. 1222# of the line.
@@ -1228,7 +1230,7 @@ if [ ! "${INSTALL}" = Yes ]; then
1228# MY_BROWSER=mozilla 1230# MY_BROWSER=mozilla
1229 1231
1230# Name of the outputfile 1232# Name of the outputfile
1231# MENUFILENAME=${HOME}/.fluxbox/menu 1233# MENUFILENAME=${USERFLUXDIR}/menu
1232 1234
1233# MENUTITLE=\`fluxbox -version|cut -d " " -f-2\` 1235# MENUTITLE=\`fluxbox -version|cut -d " " -f-2\`
1234 1236
@@ -1236,7 +1238,7 @@ if [ ! "${INSTALL}" = Yes ]; then
1236# HOMEPAGE=fluxbox.org 1238# HOMEPAGE=fluxbox.org
1237 1239
1238# location with your own menu-entries 1240# location with your own menu-entries
1239# USERMENU=~/.fluxbox/usermenu 1241# USERMENU=~/.@pkgprefix@fluxbox@pkgsuffix@/usermenu
1240 1242
1241# Put the launcher you would like to use here 1243# Put the launcher you would like to use here
1242# LAUNCHER=fbrun 1244# LAUNCHER=fbrun
@@ -1258,7 +1260,7 @@ if [ ! "${INSTALL}" = Yes ]; then
1258 1260
1259 1261
1260# Sepparate the list of background-dirs with semicolumns ':' 1262# Sepparate the list of background-dirs with semicolumns ':'
1261# BACKGROUND_DIRS="${HOME}/.fluxbox/backgrounds/:@PREFIX@/share/fluxbox/backgrounds/:/usr/share/wallpapers" 1263# BACKGROUND_DIRS="${USERFLUXDIR}/backgrounds/:@PREFIX@/share/fluxbox/backgrounds/:/usr/share/wallpapers"
1262 1264
1263 1265
1264# --- Boolean variables. 1266# --- Boolean variables.
@@ -1279,7 +1281,7 @@ if [ ! "${INSTALL}" = Yes ]; then
1279 1281
1280EOF 1282EOF
1281 else 1283 else
1282 echo "Warning: I couldn't create ${HOME}/.fluxbox/menuconfig" >&2 1284 echo "Warning: I couldn't create ${MENUCONFIG}" >&2
1283 fi 1285 fi
1284 fi 1286 fi
1285 fi 1287 fi
@@ -1440,9 +1442,9 @@ done
1440 1442
1441if [ -z "${INSTALL}" ] && [ -z "${NO_ICON}" ]; then 1443if [ -z "${INSTALL}" ] && [ -z "${NO_ICON}" ]; then
1442 # [ -z "$dnlamVERBOSE" ] && dnlamVERBOSE=": echo" # for debugging 1444 # [ -z "$dnlamVERBOSE" ] && dnlamVERBOSE=": echo" # for debugging
1443 FB_ICONDIR="$HOME/.fluxbox/icons" 1445 FB_ICONDIR="$USERFLUXDIR/icons"
1444 [ -r "$FB_ICONDIR" ] || mkdir "$FB_ICONDIR" 1446 [ -r "$FB_ICONDIR" ] || mkdir "$FB_ICONDIR"
1445 ICONMAPPING="$HOME/.fluxbox/iconmapping" 1447 ICONMAPPING="$USERFLUXDIR/iconmapping"
1446 1448
1447 if [ "$GNOMEMENU" ] ; then 1449 if [ "$GNOMEMENU" ] ; then
1448 OTHER_DESKTOP_PATHS="\"$HOME/.gnome/apps\" \"${GNOME_PREFIX}/share/gnome/apps\" $OTHER_DESKTOP_PATHS" 1450 OTHER_DESKTOP_PATHS="\"$HOME/.gnome/apps\" \"${GNOME_PREFIX}/share/gnome/apps\" $OTHER_DESKTOP_PATHS"
@@ -1483,7 +1485,7 @@ fi
1483 1485
1484# directory for the backgrounds 1486# directory for the backgrounds
1485if [ -z "$BACKGROUND_DIRS" ]; then 1487if [ -z "$BACKGROUND_DIRS" ]; then
1486 BACKGROUND_DIRS="${HOME}/.fluxbox/backgrounds/:${PREFIX}/share/fluxbox/backgrounds/" 1488 BACKGROUND_DIRS="${USERFLUXDIR}/backgrounds/:${PREFIX}/share/fluxbox/backgrounds/"
1487fi 1489fi
1488 1490
1489# find the default terminal 1491# find the default terminal
@@ -1492,7 +1494,7 @@ if find_it_options $MY_TERM; then
1492else 1494else
1493 [ -n "$MY_TERM" ] && echo "Warning: you chose an invalid term." >&2 1495 [ -n "$MY_TERM" ] && echo "Warning: you chose an invalid term." >&2
1494 #The precise order is up for debate. 1496 #The precise order is up for debate.
1495 for term in Eterm urxvt urxvtc aterm rxvt wterm xterm konsole gnome-terminal; do 1497 for term in Eterm urxvt urxvtc aterm mrxvt rxvt wterm konsole gnome-terminal xterm; do
1496 if find_it $term; then 1498 if find_it $term; then
1497 DEFAULT_TERM=$term 1499 DEFAULT_TERM=$term
1498 break 1500 break
@@ -1541,7 +1543,7 @@ cat << EOF > ${MENUFILENAME}
1541# If you read this it means you want to edit this file manually, so here 1543# If you read this it means you want to edit this file manually, so here
1542# are some useful tips: 1544# are some useful tips:
1543# 1545#
1544# - You can add your own menu-entries to ~/.fluxbox/usermenu 1546# - You can add your own menu-entries to ~/.@pkgprefix@fluxbox@pkgsuffix@/usermenu
1545# 1547#
1546# - If you miss apps please let me know and I will add them for the next 1548# - If you miss apps please let me know and I will add them for the next
1547# release. 1549# release.
@@ -1550,8 +1552,8 @@ cat << EOF > ${MENUFILENAME}
1550# makes things much more readable. 1552# makes things much more readable.
1551# 1553#
1552# - To prevent any other app from overwriting your menu 1554# - To prevent any other app from overwriting your menu
1553# you can change the menu name in .fluxbox/init to: 1555# you can change the menu name in .@pkgprefix@fluxbox@pkgsuffix@/init to:
1554# session.menuFile: /home/you/.fluxbox/my-menu 1556# session.menuFile: ${USERFLUXDIR}/my-menu
1555 1557
1556EOF 1558EOF
1557 1559
@@ -1806,7 +1808,7 @@ append_submenu "${FBSETTINGSMENU}"
1806 append_menu_end 1808 append_menu_end
1807 1809
1808 append_menu "[submenu] (${USERSTYLES}) {${STYLEMENUTITLE}}" 1810 append_menu "[submenu] (${USERSTYLES}) {${STYLEMENUTITLE}}"
1809 append "[stylesdir] (~/.fluxbox/styles)" 1811 append "[stylesdir] (~/.@pkgprefix@fluxbox@pkgsuffix@/styles)"
1810 append_menu_end 1812 append_menu_end
1811 1813
1812 # Backgroundmenu 1814 # Backgroundmenu
@@ -1820,7 +1822,7 @@ append_submenu "${FBSETTINGSMENU}"
1820 NUMBER_OF_BACKGROUNDS=`find $BACKGROUND_DIRS -follow -type f 2> /dev/null|wc -l` 1822 NUMBER_OF_BACKGROUNDS=`find $BACKGROUND_DIRS -follow -type f 2> /dev/null|wc -l`
1821 if [ "$NUMBER_OF_BACKGROUNDS" -gt 0 ]; then 1823 if [ "$NUMBER_OF_BACKGROUNDS" -gt 0 ]; then
1822 append_menu "[submenu] (${BACKGROUNDMENU}) {${BACKGROUNDMENUTITLE}}" 1824 append_menu "[submenu] (${BACKGROUNDMENU}) {${BACKGROUNDMENUTITLE}}"
1823 append "[exec] (${RANDOMBACKGROUND}) {fbsetbg -r ${HOME}/.fluxbox/backgrounds}" 1825 append "[exec] (${RANDOMBACKGROUND}) {fbsetbg -r ${USERFLUXDIR}/backgrounds}"
1824 if [ "$NUMBER_OF_BACKGROUNDS" -gt 30 ]; then 1826 if [ "$NUMBER_OF_BACKGROUNDS" -gt 30 ]; then
1825 menucounter=1 ; counter=1 1827 menucounter=1 ; counter=1
1826 append_menu "[submenu] (${BACKGROUNDMENU} $menucounter) {${BACKGROUNDMENUTITLE}}" 1828 append_menu "[submenu] (${BACKGROUNDMENU} $menucounter) {${BACKGROUNDMENUTITLE}}"
@@ -1862,7 +1864,7 @@ append_submenu "${FBSETTINGSMENU}"
1862 find_it ${LAUNCHER} append "[exec] (${RUNCOMMAND}) {${LAUNCHER} $FBRUNOPTIONS}" 1864 find_it ${LAUNCHER} append "[exec] (${RUNCOMMAND}) {${LAUNCHER} $FBRUNOPTIONS}"
1863 find_it switch append "[exec] (gtk-theme-switch) {switch}" 1865 find_it switch append "[exec] (gtk-theme-switch) {switch}"
1864 find_it switch2 append "[exec] (gtk2-theme-switch) {switch2}" 1866 find_it switch2 append "[exec] (gtk2-theme-switch) {switch2}"
1865 find_it fluxbox-generate_menu append "[exec] (${REGENERATEMENU}) {fluxbox-generate_menu ${BACKUPOPTIONS}}" 1867 find_it $0 append "[exec] (${REGENERATEMENU}) {$0 ${BACKUPOPTIONS}}"
1866 append_menu_end 1868 append_menu_end
1867 1869
1868 append_submenu "${WINDOWMANAGERS}" 1870 append_submenu "${WINDOWMANAGERS}"
@@ -1908,13 +1910,13 @@ mv -f menu.tmp $MENUFILENAME
1908 1910
1909if [ -z "$INSTALL" ]; then 1911if [ -z "$INSTALL" ]; then
1910 if [ -z "$CHECKINIT" ]; then 1912 if [ -z "$CHECKINIT" ]; then
1911 INITMENUFILENAME=`awk '/menuFile/ {print $2}' $HOME/.fluxbox/init` 1913 INITMENUFILENAME=`awk '/menuFile/ {print $2}' $USERFLUXDIR/init`
1912 INITMENUFILENAME=`replaceWithinString "$INITMENUFILENAME" "~" "$HOME"` 1914 INITMENUFILENAME=`replaceWithinString "$INITMENUFILENAME" "~" "$HOME"`
1913 if [ ! "$INITMENUFILENAME" = "$MENUFILENAME" ]; then 1915 if [ ! "$INITMENUFILENAME" = "$MENUFILENAME" ]; then
1914 echo "Note: In $HOME/.fluxbox/init, your \"session.menuFile\" does not point to $MENUFILENAME but to $INITMENUFILENAME" >&2 1916 echo "Note: In $USERFLUXDIR/init, your \"session.menuFile\" does not point to $MENUFILENAME but to $INITMENUFILENAME" >&2
1915 fi 1917 fi
1916 fi 1918 fi
1917 echo "Menu successfully generated: $MENUFILENAME" 1919 echo "Menu successfully generated: $MENUFILENAME"
1918 #echo " Make sure \"session.menuFile: $MENUFILENAME\" is in $HOME/.fluxbox/init." 1920 #echo " Make sure \"session.menuFile: $MENUFILENAME\" is in $HOME/.fluxbox/init."
1919 echo 'Use fluxbox-generate_menu -h to read about all the latest features.' 1921 echo 'Use @pkgprefix@fluxbox-generate_menu@pkgsuffix@ -h to read about all the latest features.'
1920fi 1922fi
diff --git a/util/startfluxbox.in b/util/startfluxbox.in
index 8575555..fee1203 100755
--- a/util/startfluxbox.in
+++ b/util/startfluxbox.in
@@ -2,7 +2,8 @@
2# $Id$ 2# $Id$
3 3
4command="`basename \"$0\"`" 4command="`basename \"$0\"`"
5startup="$HOME/.fluxbox/startup" 5fluxdir="$HOME/.@pkgprefix@fluxbox@pkgsuffix@"
6startup="$fluxdir/startup"
6 7
7while [ $# -gt 0 ]; do 8while [ $# -gt 0 ]; do
8 case "$1" in 9 case "$1" in
@@ -28,8 +29,8 @@ if [ -x "$startup" ]; then
28elif [ -r "$startup" ]; then 29elif [ -r "$startup" ]; then
29 exec sh "$startup" 30 exec sh "$startup"
30else 31else
31 if [ ! -d "$HOME/.fluxbox" ]; then 32 if [ ! -d $fluxdir ]; then
32 mkdir -p "$HOME/.fluxbox/backgrounds" "$HOME/.fluxbox/styles" "$HOME/.fluxbox/pixmaps" 33 mkdir -p "$fluxdir/backgrounds" "$fluxdir/styles" "$fluxdir/pixmaps"
33 fi 34 fi
34 if [ ! -r "$startup" ]; then 35 if [ ! -r "$startup" ]; then
35 ( cat << EOF 36 ( cat << EOF
@@ -81,7 +82,7 @@ else
81 82
82exec @pkgbindir@/@pkgprefix@fluxbox@pkgsuffix@ 83exec @pkgbindir@/@pkgprefix@fluxbox@pkgsuffix@
83# or if you want to keep a log: 84# or if you want to keep a log:
84# exec @pkgbindir@/@pkgprefix@fluxbox@pkgsuffix@ -log "$HOME/.fluxbox/log" 85# exec @pkgbindir@/@pkgprefix@fluxbox@pkgsuffix@ -log "$fluxdir/log"
85EOF 86EOF
86 ) > "$startup" 87 ) > "$startup"
87 fi 88 fi