fixes for --program-prefix and --program-suffix, plus fixed overwriting init file on reconfigure

This commit is contained in:
markt 2007-07-07 23:11:04 +00:00
parent b735d405f5
commit 135019abf9
14 changed files with 90 additions and 63 deletions

View file

@ -1,6 +1,10 @@
(Format: Year/Month/Day) (Format: Year/Month/Day)
Changes for 1.0.0: Changes for 1.0.0:
*07/07/07: *07/07/07:
* Don't overwrite changes to init file on reconfigure (Mark)
Workspace.cc fluxbox.cc/hh
* Make things work a little better with configure script's --program-prefix
and --program-suffix options (Mark)
* Allow negative numbers in :Workspace <int> command, which counts backwards * Allow negative numbers in :Workspace <int> command, which counts backwards
from the last one (Mark) from the last one (Mark)
* Right clicking on a submenu didn't revert focus to its parent (Mark) * Right clicking on a submenu didn't revert focus to its parent (Mark)

View file

@ -1,5 +1,8 @@
# data/Makefile.am for Fluxbox - an X11 Window manager # data/Makefile.am for Fluxbox - an X11 Window manager
PROGRAM_PREFIX=@program_prefix@
PROGRAM_SUFFIX=@program_suffix@
DEFAULT_MENU = @DEFAULT_MENU@ DEFAULT_MENU = @DEFAULT_MENU@
DEFAULT_STYLE = @DEFAULT_STYLE@ DEFAULT_STYLE = @DEFAULT_STYLE@
DEFAULT_KEYS = @DEFAULT_KEYS@ DEFAULT_KEYS = @DEFAULT_KEYS@
@ -26,6 +29,8 @@ distclean-local:
rm -f *\~ rm -f *\~
init: init.in init: init.in
@regex_cmd@ -e "s,@pkgdatadir@,$(pkgdatadir),g" \ @regex_cmd@ -e "s,@pkgdatadir@,$(pkgdatadir),g" \
-e "s,@pkgprefix@,$(PROGRAM_PREFIX:NONE=),g" \
-e "s,@pkgsuffix@,$(PROGRAM_SUFFIX:NONE=),g" \
-e "s,@default_style@,$(DEFAULT_STYLE),g" $(srcdir)/init.in > init -e "s,@default_style@,$(DEFAULT_STYLE),g" $(srcdir)/init.in > init
menu: ../util/fluxbox-generate_menu menu: ../util/fluxbox-generate_menu

View file

@ -3,8 +3,6 @@ session.screen0.slit.direction: Vertical
session.screen0.slit.onTop: False session.screen0.slit.onTop: False
session.screen0.slit.autoHide: False session.screen0.slit.autoHide: False
session.screen0.tab.placement: Top session.screen0.tab.placement: Top
session.screen0.tab.alignment: Left
session.screen0.tab.rotatevertical: True
session.screen0.toolbar.onTop: False session.screen0.toolbar.onTop: False
session.screen0.toolbar.autoHide: False session.screen0.toolbar.autoHide: False
session.screen0.toolbar.placement: BottomCenter session.screen0.toolbar.placement: BottomCenter
@ -25,10 +23,10 @@ session.screen0.tab.height: 16
session.screen0.showwindowposition: true session.screen0.showwindowposition: true
session.opaqueMove: False session.opaqueMove: False
session.autoRaiseDelay: 250 session.autoRaiseDelay: 250
session.menuFile: ~/.fluxbox/menu session.menuFile: ~/.@pkgprefix@fluxbox@pkgsuffix@/menu
session.cacheLife: 5 session.cacheLife: 5
session.styleFile: @default_style@ session.styleFile: @default_style@
session.keyFile: ~/.fluxbox/keys session.keyFile: ~/.@pkgprefix@fluxbox@pkgsuffix@/keys
session.colorsPerChannel: 4 session.colorsPerChannel: 4
session.doubleClickInterval: 250 session.doubleClickInterval: 250
session.cacheMax: 200 session.cacheMax: 200

View file

@ -28,6 +28,8 @@ DEFAULT_MENU=@DEFAULT_MENU@
DEFAULT_STYLE=$(pkgdatadir)/styles/Clean DEFAULT_STYLE=$(pkgdatadir)/styles/Clean
DEFAULT_KEYSFILE=@DEFAULT_KEYS@ DEFAULT_KEYSFILE=@DEFAULT_KEYS@
DEFAULT_INITFILE=@DEFAULT_INIT@ DEFAULT_INITFILE=@DEFAULT_INIT@
PROGRAM_PREFIX=@program_prefix@
PROGRAM_SUFFIX=@program_suffix@
AM_CPPFLAGS=-I$(srcdir)/FbTk AM_CPPFLAGS=-I$(srcdir)/FbTk
@ -37,14 +39,25 @@ CONFIG_CLEAN_FILES = defaults.hh
defaults.hh: Makefile defaults.hh: Makefile
@( \ @( \
echo '// This file is generated from Makefile. Do not edit!'; \ echo '// This file is generated from Makefile. Do not edit!'; \
echo '#include <string>'; \
echo ''; \
echo '#define DEFAULTMENU "$(DEFAULT_MENU)"'; \ echo '#define DEFAULTMENU "$(DEFAULT_MENU)"'; \
echo '#define DEFAULTSTYLE "$(DEFAULT_STYLE)"'; \ echo '#define DEFAULTSTYLE "$(DEFAULT_STYLE)"'; \
echo '#define DEFAULTKEYSFILE "$(DEFAULT_KEYSFILE)"'; \ echo '#define DEFAULTKEYSFILE "$(DEFAULT_KEYSFILE)"'; \
echo '#define DEFAULT_INITFILE "$(DEFAULT_INITFILE)"'; \ echo '#define DEFAULT_INITFILE "$(DEFAULT_INITFILE)"'; \
echo '#define PROGRAM_PREFIX "$(PROGRAM_PREFIX:NONE=)"'; \
echo '#define PROGRAM_SUFFIX "$(PROGRAM_SUFFIX:NONE=)"'; \
echo 'std::string realProgramName(std::string name);'; \
echo 'const char* svnversion(void);' ) > defaults.hh echo 'const char* svnversion(void);' ) > defaults.hh
defaults.cc: force defaults.cc: force
@( \ @( \
echo '#include "defaults.hh"'; \
echo ''; \
echo 'std::string realProgramName(std::string name) {'; \
echo ' return PROGRAM_PREFIX + name + PROGRAM_SUFFIX;'; \
echo '}'; \
echo ''; \
echo 'const char* svnversion(void) {'; \ echo 'const char* svnversion(void) {'; \
echo ' return "'`(svnversion . | sed "s/[^0-9].*//") 2> /dev/null`'";';\ echo ' return "'`(svnversion . | sed "s/[^0-9].*//") 2> /dev/null`'";';\
echo '}' ) > defaults_tmp.cc echo '}' ) > defaults_tmp.cc

View file

@ -24,6 +24,7 @@
#include "MenuCreator.hh" #include "MenuCreator.hh"
#include "defaults.hh"
#include "Screen.hh" #include "Screen.hh"
#include "CommandParser.hh" #include "CommandParser.hh"
#include "fluxbox.hh" #include "fluxbox.hh"
@ -349,7 +350,7 @@ static void translateMenuItem(Parser &parse, ParseItem &pitem, FbTk::StringConve
else if (str_key == "wallpapers" || str_key == "wallpapermenu" || else if (str_key == "wallpapers" || str_key == "wallpapermenu" ||
str_key == "rootcommands") { str_key == "rootcommands") {
createRootCmdMenu(menu, str_label, str_label, createRootCmdMenu(menu, str_label, str_label,
str_cmd == "" ? "fbsetbg" : str_cmd); str_cmd == "" ? realProgramName("fbsetbg") : str_cmd);
} // end of wallpapers } // end of wallpapers
else if (str_key == "workspaces") { else if (str_key == "workspaces") {
BScreen *screen = Fluxbox::instance()->findScreen(screen_number); BScreen *screen = Fluxbox::instance()->findScreen(screen_number);

View file

@ -23,6 +23,7 @@
#include "RootCmdMenuItem.hh" #include "RootCmdMenuItem.hh"
#include "defaults.hh"
#include "FbCommands.hh" #include "FbCommands.hh"
#include "fluxbox.hh" #include "fluxbox.hh"
@ -34,8 +35,9 @@ RootCmdMenuItem::RootCmdMenuItem(const FbTk::FbString &label,
FbTk::MenuItem(label), FbTk::MenuItem(label),
m_filename(filename) { m_filename(filename) {
std::string prog = cmd.empty() ? realProgramName("fbsetbg") : cmd;
FbTk::RefCount<FbTk::Command> FbTk::RefCount<FbTk::Command>
setwp_cmd(new FbCommands::ExecuteCmd(cmd + " \"" + m_filename + "\"")); setwp_cmd(new FbCommands::ExecuteCmd(prog + " \"" + m_filename + "\""));
setCommand(setwp_cmd); setCommand(setwp_cmd);
setToggleItem(true); setToggleItem(true);
} }

View file

@ -31,7 +31,7 @@ class RootCmdMenuItem: public FbTk::MenuItem {
public: public:
RootCmdMenuItem(const FbTk::FbString &label, RootCmdMenuItem(const FbTk::FbString &label,
const std::string &filename, const std::string &filename,
const std::string &cmd = "fbsetbg"); const std::string &cmd = "");
bool isSelected() const; bool isSelected() const;
private: private:
const std::string m_filename; const std::string m_filename;

View file

@ -23,6 +23,7 @@
#include "RootTheme.hh" #include "RootTheme.hh"
#include "defaults.hh"
#include "FbRootWindow.hh" #include "FbRootWindow.hh"
#include "FbCommands.hh" #include "FbCommands.hh"
#include "Screen.hh" #include "Screen.hh"
@ -212,7 +213,8 @@ void RootTheme::reconfigTheme() {
options = "-A "; options = "-A ";
// compose wallpaper application "fbsetbg" with argumetns // compose wallpaper application "fbsetbg" with argumetns
std::string commandargs = "fbsetbg " + options + filename; std::string commandargs = realProgramName("fbsetbg") + " " + options +
filename;
// call command with options // call command with options
FbCommands::ExecuteCmd exec(commandargs, screenNum()); FbCommands::ExecuteCmd exec(commandargs, screenNum());
@ -220,7 +222,8 @@ void RootTheme::reconfigTheme() {
} else if (FbTk::FileUtil::isDirectory(filename.c_str()) && } else if (FbTk::FileUtil::isDirectory(filename.c_str()) &&
strstr(m_background->options().c_str(), "random") != 0) { strstr(m_background->options().c_str(), "random") != 0) {
std::string commandargs = "fbsetbg -R " + filename; std::string commandargs = realProgramName("fbsetbg") + " -R " +
filename;
FbCommands::ExecuteCmd exec(commandargs, screenNum()); FbCommands::ExecuteCmd exec(commandargs, screenNum());
exec.execute(); exec.execute();
} else { } else {
@ -251,7 +254,7 @@ void RootTheme::reconfigTheme() {
options += "-gradient '" + m_background->options() + "'"; options += "-gradient '" + m_background->options() + "'";
} }
std::string commandargs = "fbsetroot " + options; std::string commandargs = realProgramName("fbsetroot") + " " + options;
FbCommands::ExecuteCmd exec(commandargs, screenNum()); FbCommands::ExecuteCmd exec(commandargs, screenNum());
exec.execute(); exec.execute();

View file

@ -371,6 +371,8 @@ void Workspace::update(FbTk::Subject *subj) {
void Workspace::setName(const string &name) { void Workspace::setName(const string &name) {
if (!name.empty() && name != "") { if (!name.empty() && name != "") {
if (name == m_name)
return;
m_name = name; m_name = name;
} else { //if name == 0 then set default name from nls } else { //if name == 0 then set default name from nls
_FB_USES_NLS; _FB_USES_NLS;

View file

@ -202,12 +202,12 @@ Fluxbox::Fluxbox(int argc, char **argv, const char *dpy_name, const char *rcfile
m_rc_double_click_interval(m_resourcemanager, 250, "session.doubleClickInterval", "Session.DoubleClickInterval"), m_rc_double_click_interval(m_resourcemanager, 250, "session.doubleClickInterval", "Session.DoubleClickInterval"),
m_rc_tabs_padding(m_resourcemanager, 0, "session.tabPadding", "Session.TabPadding"), m_rc_tabs_padding(m_resourcemanager, 0, "session.tabPadding", "Session.TabPadding"),
m_rc_stylefile(m_resourcemanager, DEFAULTSTYLE, "session.styleFile", "Session.StyleFile"), m_rc_stylefile(m_resourcemanager, DEFAULTSTYLE, "session.styleFile", "Session.StyleFile"),
m_rc_styleoverlayfile(m_resourcemanager, "~/.fluxbox/overlay", "session.styleOverlay", "Session.StyleOverlay"), m_rc_styleoverlayfile(m_resourcemanager, "~/." + realProgramName("fluxbox") + "/overlay", "session.styleOverlay", "Session.StyleOverlay"),
m_rc_menufile(m_resourcemanager, DEFAULTMENU, "session.menuFile", "Session.MenuFile"), m_rc_menufile(m_resourcemanager, DEFAULTMENU, "session.menuFile", "Session.MenuFile"),
m_rc_keyfile(m_resourcemanager, DEFAULTKEYSFILE, "session.keyFile", "Session.KeyFile"), m_rc_keyfile(m_resourcemanager, DEFAULTKEYSFILE, "session.keyFile", "Session.KeyFile"),
m_rc_slitlistfile(m_resourcemanager, "~/.fluxbox/slitlist", "session.slitlistFile", "Session.SlitlistFile"), m_rc_slitlistfile(m_resourcemanager, "~/." + realProgramName("fluxbox") + "/slitlist", "session.slitlistFile", "Session.SlitlistFile"),
m_rc_groupfile(m_resourcemanager, "~/.fluxbox/groups", "session.groupFile", "Session.GroupFile"), m_rc_groupfile(m_resourcemanager, "~/." + realProgramName("fluxbox") + "/groups", "session.groupFile", "Session.GroupFile"),
m_rc_appsfile(m_resourcemanager, "~/.fluxbox/apps", "session.appsFile", "Session.AppsFile"), m_rc_appsfile(m_resourcemanager, "~/." + realProgramName("fluxbox") + "/apps", "session.appsFile", "Session.AppsFile"),
m_rc_tabs_attach_area(m_resourcemanager, ATTACH_AREA_WINDOW, "session.tabsAttachArea", "Session.TabsAttachArea"), m_rc_tabs_attach_area(m_resourcemanager, ATTACH_AREA_WINDOW, "session.tabsAttachArea", "Session.TabsAttachArea"),
m_rc_cache_life(m_resourcemanager, 5, "session.cacheLife", "Session.CacheLife"), m_rc_cache_life(m_resourcemanager, 5, "session.cacheLife", "Session.CacheLife"),
m_rc_cache_max(m_resourcemanager, 200, "session.cacheMax", "Session.CacheMax"), m_rc_cache_max(m_resourcemanager, 200, "session.cacheMax", "Session.CacheMax"),
@ -227,7 +227,7 @@ Fluxbox::Fluxbox(int argc, char **argv, const char *dpy_name, const char *rcfile
m_shutdown(false), m_shutdown(false),
m_server_grabs(0), m_server_grabs(0),
m_randr_event_type(0), m_randr_event_type(0),
m_RC_PATH("fluxbox"), m_RC_PATH(realProgramName("fluxbox")),
m_RC_INIT_FILE("init") { m_RC_INIT_FILE("init") {
_FB_USES_NLS; _FB_USES_NLS;
@ -588,7 +588,7 @@ void Fluxbox::setupConfigFiles() {
bool create_init = false, create_keys = false, create_menu = false; bool create_init = false, create_keys = false, create_menu = false;
string dirname = getenv("HOME") + string("/.") + string(m_RC_PATH) + "/"; string dirname = getenv("HOME") + string("/.") + m_RC_PATH + "/";
string init_file, keys_file, menu_file, slitlist_file; string init_file, keys_file, menu_file, slitlist_file;
init_file = dirname + m_RC_INIT_FILE; init_file = dirname + m_RC_INIT_FILE;
keys_file = dirname + "keys"; keys_file = dirname + "keys";
@ -645,8 +645,8 @@ void Fluxbox::setupConfigFiles() {
if (*config_version < CONFIG_VERSION) { if (*config_version < CONFIG_VERSION) {
// configs are out of date, so run fluxbox-update_configs // configs are out of date, so run fluxbox-update_configs
string commandargs = "fluxbox-update_configs -rc "; string commandargs = realProgramName("fluxbox-update_configs");
commandargs += init_file; commandargs += " -rc " + init_file;
#ifdef HAVE_GETPID #ifdef HAVE_GETPID
// add the fluxbox pid so fbuc can have us reload rc if necessary // add the fluxbox pid so fbuc can have us reload rc if necessary
@ -1084,7 +1084,7 @@ void Fluxbox::handleSignal(int signum) {
load_rc(); load_rc();
break; break;
case SIGUSR2: case SIGUSR2:
reload_rc(); reconfigure();
break; break;
case SIGSEGV: case SIGSEGV:
abort(); abort();
@ -1559,13 +1559,8 @@ void Fluxbox::load_rc(BScreen &screen) {
} }
} }
void Fluxbox::reload_rc() {
load_rc();
reconfigure();
}
void Fluxbox::reconfigure() { void Fluxbox::reconfigure() {
load_rc();
m_reconfigure_wait = true; m_reconfigure_wait = true;
m_reconfig_timer.start(); m_reconfig_timer.start();
} }

View file

@ -216,7 +216,6 @@ private:
std::string getRcFilename(); std::string getRcFilename();
void load_rc(); void load_rc();
void reload_rc();
void real_rereadMenu(); void real_rereadMenu();
void real_reconfigure(); void real_reconfigure();
@ -305,7 +304,7 @@ private:
int m_randr_event_type; ///< the type number of randr event int m_randr_event_type; ///< the type number of randr event
int m_shape_eventbase; ///< event base for shape events int m_shape_eventbase; ///< event base for shape events
bool m_have_shape; ///< if shape is supported by server bool m_have_shape; ///< if shape is supported by server
const char *m_RC_PATH; std::string m_RC_PATH;
const char *m_RC_INIT_FILE; const char *m_RC_INIT_FILE;
Atom m_kwm1_dockwindow, m_kwm2_dockwindow; Atom m_kwm1_dockwindow, m_kwm2_dockwindow;

View file

@ -41,6 +41,8 @@ startfluxbox: startfluxbox.in
fluxbox-generate_menu: fluxbox-generate_menu.in fluxbox-generate_menu: fluxbox-generate_menu.in
@regex_cmd@ -e "s,@PREFIX@,$(prefix),g" \ @regex_cmd@ -e "s,@PREFIX@,$(prefix),g" \
-e "s,@pkgprefix@,$(PROGRAM_PREFIX:NONE=),g" \
-e "s,@pkgsuffix@,$(PROGRAM_SUFFIX:NONE=),g" \
$(srcdir)/fluxbox-generate_menu.in \ $(srcdir)/fluxbox-generate_menu.in \
> fluxbox-generate_menu > fluxbox-generate_menu
-chmod 755 fluxbox-generate_menu -chmod 755 fluxbox-generate_menu

View file

@ -61,7 +61,7 @@ fi
# Functions # Functions
display_usage() { display_usage() {
cat << EOF cat << EOF
Usage: fluxbox-generate_menu [-kgrBh] [-t terminal] [-w url] [-b browser] Usage: @pkgprefix@fluxbox-generate_menu@pkgsuffix@ [-kgrBh] [-t terminal] [-w url] [-b browser]
[-m menu-title] [-o /path] [-u /path] [-p /path] [-n /path] [-q /path] [-m menu-title] [-o /path] [-u /path] [-p /path] [-n /path] [-q /path]
[-d /path ] [-ds] [-i /path] [-is] [-d /path ] [-ds] [-i /path] [-is]
EOF EOF
@ -89,8 +89,8 @@ Options:
-w Homepage for console-browsers. Default is fluxbox.org -w Homepage for console-browsers. Default is fluxbox.org
-b Favourite browser -b Favourite browser
-m Menu-title; default is "Fluxbox" -m Menu-title; default is "Fluxbox"
-o Outputfile; default is ~/.fluxbox/menu -o Outputfile; default is ~/.@pkgprefix@fluxbox@pkgsuffix@/menu
-u user sub-menu; default is ~/.fluxbox/usermenu -u user sub-menu; default is ~/.@pkgprefix@fluxbox@pkgsuffix@/usermenu
-h Display this help -h Display this help
-a Display the authors of this script -a Display the authors of this script
@ -103,8 +103,8 @@ Options:
Files: Files:
~/.fluxbox/usermenu your own submenu which will be included in the menu ~/.@pkgprefix@fluxbox@pkgsuffix@/usermenu your own submenu which will be included in the menu
~/.fluxbox/menuconfig rc file for fluxbox-generate_menu ~/.@pkgprefix@fluxbox@pkgsuffix@/menuconfig rc file for fluxbox-generate_menu
EOF EOF
} }
@ -112,7 +112,7 @@ EOF
display_authors() { display_authors() {
cat << EOF cat << EOF
fluxbox-generate_menu was brought to you by: @pkgprefix@fluxbox-generate_menu@pkgsuffix@ was brought to you by:
Henrik Kinnunen: Project leader. Henrik Kinnunen: Project leader.
Han Boetes: Packaging, debugging and scripts. Han Boetes: Packaging, debugging and scripts.
@ -326,7 +326,7 @@ searchForIcon(){
# convert icon file, if needed # convert icon file, if needed
if [ -f "$entry_icon" ] && [ -n "yes$ConvertIfNecessary" ]; then if [ -f "$entry_icon" ] && [ -n "yes$ConvertIfNecessary" ]; then
entry_icon=`convertIcon "$entry_icon" "$HOME/.fluxbox/icons"` entry_icon=`convertIcon "$entry_icon" "$USERFLUXDIR/icons"`
# $dnlamVERBOSE echo ":::: $entry_icon" >&2 # $dnlamVERBOSE echo ":::: $entry_icon" >&2
fi fi
@ -1201,20 +1201,22 @@ case ${LC_ALL} in
esac esac
# Set Defaults # Set Defaults
MENUFILENAME="${MENUFILENAME:=${HOME}/.fluxbox/menu}" USERFLUXDIR="${HOME}/.@pkgprefix@fluxbox@pkgsuffix@"
MENUFILENAME="${MENUFILENAME:=${USERFLUXDIR}/menu}"
MENUTITLE="${MENUTITLE:=Fluxbox}" MENUTITLE="${MENUTITLE:=Fluxbox}"
HOMEPAGE="${HOMEPAGE:=fluxbox.org}" HOMEPAGE="${HOMEPAGE:=fluxbox.org}"
USERMENU="${USERMENU:=${HOME}/.fluxbox/usermenu}" USERMENU="${USERMENU:=${USERFLUXDIR}/usermenu}"
MENUCONFIG="${MENUCONFIG:=${USERFLUXDIR}/menuconfig}"
# Read the menuconfig file if it exists or else create it. # Read the menuconfig file if it exists or else create it.
# But not during install time, use envvar for sun # But not during install time, use envvar for sun
if [ ! "${INSTALL}" = Yes ]; then if [ ! "${INSTALL}" = Yes ]; then
if [ -r ${HOME}/.fluxbox/menuconfig ]; then if [ -r ${MENUCONFIG} ]; then
. ${HOME}/.fluxbox/menuconfig . ${MENUCONFIG}
else else
if [ ! "$WHOAMI" = root ]; then # this is only for users. if [ ! "$WHOAMI" = root ]; then # this is only for users.
if touch ${HOME}/.fluxbox/menuconfig; then if touch ${MENUCONFIG}; then
cat << EOF > ${HOME}/.fluxbox/menuconfig cat << EOF > ${MENUCONFIG}
# This file is read by fluxbox-generate_menu. If you don't like a # This file is read by fluxbox-generate_menu. If you don't like a
# default you can change it here. Don't forget to remove the # in front # default you can change it here. Don't forget to remove the # in front
# of the line. # of the line.
@ -1228,7 +1230,7 @@ if [ ! "${INSTALL}" = Yes ]; then
# MY_BROWSER=mozilla # MY_BROWSER=mozilla
# Name of the outputfile # Name of the outputfile
# MENUFILENAME=${HOME}/.fluxbox/menu # MENUFILENAME=${USERFLUXDIR}/menu
# MENUTITLE=\`fluxbox -version|cut -d " " -f-2\` # MENUTITLE=\`fluxbox -version|cut -d " " -f-2\`
@ -1236,7 +1238,7 @@ if [ ! "${INSTALL}" = Yes ]; then
# HOMEPAGE=fluxbox.org # HOMEPAGE=fluxbox.org
# location with your own menu-entries # location with your own menu-entries
# USERMENU=~/.fluxbox/usermenu # USERMENU=~/.@pkgprefix@fluxbox@pkgsuffix@/usermenu
# Put the launcher you would like to use here # Put the launcher you would like to use here
# LAUNCHER=fbrun # LAUNCHER=fbrun
@ -1258,7 +1260,7 @@ if [ ! "${INSTALL}" = Yes ]; then
# Sepparate the list of background-dirs with semicolumns ':' # Sepparate the list of background-dirs with semicolumns ':'
# BACKGROUND_DIRS="${HOME}/.fluxbox/backgrounds/:@PREFIX@/share/fluxbox/backgrounds/:/usr/share/wallpapers" # BACKGROUND_DIRS="${USERFLUXDIR}/backgrounds/:@PREFIX@/share/fluxbox/backgrounds/:/usr/share/wallpapers"
# --- Boolean variables. # --- Boolean variables.
@ -1279,7 +1281,7 @@ if [ ! "${INSTALL}" = Yes ]; then
EOF EOF
else else
echo "Warning: I couldn't create ${HOME}/.fluxbox/menuconfig" >&2 echo "Warning: I couldn't create ${MENUCONFIG}" >&2
fi fi
fi fi
fi fi
@ -1440,9 +1442,9 @@ done
if [ -z "${INSTALL}" ] && [ -z "${NO_ICON}" ]; then if [ -z "${INSTALL}" ] && [ -z "${NO_ICON}" ]; then
# [ -z "$dnlamVERBOSE" ] && dnlamVERBOSE=": echo" # for debugging # [ -z "$dnlamVERBOSE" ] && dnlamVERBOSE=": echo" # for debugging
FB_ICONDIR="$HOME/.fluxbox/icons" FB_ICONDIR="$USERFLUXDIR/icons"
[ -r "$FB_ICONDIR" ] || mkdir "$FB_ICONDIR" [ -r "$FB_ICONDIR" ] || mkdir "$FB_ICONDIR"
ICONMAPPING="$HOME/.fluxbox/iconmapping" ICONMAPPING="$USERFLUXDIR/iconmapping"
if [ "$GNOMEMENU" ] ; then if [ "$GNOMEMENU" ] ; then
OTHER_DESKTOP_PATHS="\"$HOME/.gnome/apps\" \"${GNOME_PREFIX}/share/gnome/apps\" $OTHER_DESKTOP_PATHS" OTHER_DESKTOP_PATHS="\"$HOME/.gnome/apps\" \"${GNOME_PREFIX}/share/gnome/apps\" $OTHER_DESKTOP_PATHS"
@ -1483,7 +1485,7 @@ fi
# directory for the backgrounds # directory for the backgrounds
if [ -z "$BACKGROUND_DIRS" ]; then if [ -z "$BACKGROUND_DIRS" ]; then
BACKGROUND_DIRS="${HOME}/.fluxbox/backgrounds/:${PREFIX}/share/fluxbox/backgrounds/" BACKGROUND_DIRS="${USERFLUXDIR}/backgrounds/:${PREFIX}/share/fluxbox/backgrounds/"
fi fi
# find the default terminal # find the default terminal
@ -1492,7 +1494,7 @@ if find_it_options $MY_TERM; then
else else
[ -n "$MY_TERM" ] && echo "Warning: you chose an invalid term." >&2 [ -n "$MY_TERM" ] && echo "Warning: you chose an invalid term." >&2
#The precise order is up for debate. #The precise order is up for debate.
for term in Eterm urxvt urxvtc aterm rxvt wterm xterm konsole gnome-terminal; do for term in Eterm urxvt urxvtc aterm mrxvt rxvt wterm konsole gnome-terminal xterm; do
if find_it $term; then if find_it $term; then
DEFAULT_TERM=$term DEFAULT_TERM=$term
break break
@ -1541,7 +1543,7 @@ cat << EOF > ${MENUFILENAME}
# If you read this it means you want to edit this file manually, so here # If you read this it means you want to edit this file manually, so here
# are some useful tips: # are some useful tips:
# #
# - You can add your own menu-entries to ~/.fluxbox/usermenu # - You can add your own menu-entries to ~/.@pkgprefix@fluxbox@pkgsuffix@/usermenu
# #
# - If you miss apps please let me know and I will add them for the next # - If you miss apps please let me know and I will add them for the next
# release. # release.
@ -1550,8 +1552,8 @@ cat << EOF > ${MENUFILENAME}
# makes things much more readable. # makes things much more readable.
# #
# - To prevent any other app from overwriting your menu # - To prevent any other app from overwriting your menu
# you can change the menu name in .fluxbox/init to: # you can change the menu name in .@pkgprefix@fluxbox@pkgsuffix@/init to:
# session.menuFile: /home/you/.fluxbox/my-menu # session.menuFile: ${USERFLUXDIR}/my-menu
EOF EOF
@ -1806,7 +1808,7 @@ append_submenu "${FBSETTINGSMENU}"
append_menu_end append_menu_end
append_menu "[submenu] (${USERSTYLES}) {${STYLEMENUTITLE}}" append_menu "[submenu] (${USERSTYLES}) {${STYLEMENUTITLE}}"
append "[stylesdir] (~/.fluxbox/styles)" append "[stylesdir] (~/.@pkgprefix@fluxbox@pkgsuffix@/styles)"
append_menu_end append_menu_end
# Backgroundmenu # Backgroundmenu
@ -1820,7 +1822,7 @@ append_submenu "${FBSETTINGSMENU}"
NUMBER_OF_BACKGROUNDS=`find $BACKGROUND_DIRS -follow -type f 2> /dev/null|wc -l` NUMBER_OF_BACKGROUNDS=`find $BACKGROUND_DIRS -follow -type f 2> /dev/null|wc -l`
if [ "$NUMBER_OF_BACKGROUNDS" -gt 0 ]; then if [ "$NUMBER_OF_BACKGROUNDS" -gt 0 ]; then
append_menu "[submenu] (${BACKGROUNDMENU}) {${BACKGROUNDMENUTITLE}}" append_menu "[submenu] (${BACKGROUNDMENU}) {${BACKGROUNDMENUTITLE}}"
append "[exec] (${RANDOMBACKGROUND}) {fbsetbg -r ${HOME}/.fluxbox/backgrounds}" append "[exec] (${RANDOMBACKGROUND}) {fbsetbg -r ${USERFLUXDIR}/backgrounds}"
if [ "$NUMBER_OF_BACKGROUNDS" -gt 30 ]; then if [ "$NUMBER_OF_BACKGROUNDS" -gt 30 ]; then
menucounter=1 ; counter=1 menucounter=1 ; counter=1
append_menu "[submenu] (${BACKGROUNDMENU} $menucounter) {${BACKGROUNDMENUTITLE}}" append_menu "[submenu] (${BACKGROUNDMENU} $menucounter) {${BACKGROUNDMENUTITLE}}"
@ -1862,7 +1864,7 @@ append_submenu "${FBSETTINGSMENU}"
find_it ${LAUNCHER} append "[exec] (${RUNCOMMAND}) {${LAUNCHER} $FBRUNOPTIONS}" find_it ${LAUNCHER} append "[exec] (${RUNCOMMAND}) {${LAUNCHER} $FBRUNOPTIONS}"
find_it switch append "[exec] (gtk-theme-switch) {switch}" find_it switch append "[exec] (gtk-theme-switch) {switch}"
find_it switch2 append "[exec] (gtk2-theme-switch) {switch2}" find_it switch2 append "[exec] (gtk2-theme-switch) {switch2}"
find_it fluxbox-generate_menu append "[exec] (${REGENERATEMENU}) {fluxbox-generate_menu ${BACKUPOPTIONS}}" find_it $0 append "[exec] (${REGENERATEMENU}) {$0 ${BACKUPOPTIONS}}"
append_menu_end append_menu_end
append_submenu "${WINDOWMANAGERS}" append_submenu "${WINDOWMANAGERS}"
@ -1908,13 +1910,13 @@ mv -f menu.tmp $MENUFILENAME
if [ -z "$INSTALL" ]; then if [ -z "$INSTALL" ]; then
if [ -z "$CHECKINIT" ]; then if [ -z "$CHECKINIT" ]; then
INITMENUFILENAME=`awk '/menuFile/ {print $2}' $HOME/.fluxbox/init` INITMENUFILENAME=`awk '/menuFile/ {print $2}' $USERFLUXDIR/init`
INITMENUFILENAME=`replaceWithinString "$INITMENUFILENAME" "~" "$HOME"` INITMENUFILENAME=`replaceWithinString "$INITMENUFILENAME" "~" "$HOME"`
if [ ! "$INITMENUFILENAME" = "$MENUFILENAME" ]; then if [ ! "$INITMENUFILENAME" = "$MENUFILENAME" ]; then
echo "Note: In $HOME/.fluxbox/init, your \"session.menuFile\" does not point to $MENUFILENAME but to $INITMENUFILENAME" >&2 echo "Note: In $USERFLUXDIR/init, your \"session.menuFile\" does not point to $MENUFILENAME but to $INITMENUFILENAME" >&2
fi fi
fi fi
echo "Menu successfully generated: $MENUFILENAME" echo "Menu successfully generated: $MENUFILENAME"
#echo " Make sure \"session.menuFile: $MENUFILENAME\" is in $HOME/.fluxbox/init." #echo " Make sure \"session.menuFile: $MENUFILENAME\" is in $HOME/.fluxbox/init."
echo 'Use fluxbox-generate_menu -h to read about all the latest features.' echo 'Use @pkgprefix@fluxbox-generate_menu@pkgsuffix@ -h to read about all the latest features.'
fi fi

View file

@ -2,7 +2,8 @@
# $Id$ # $Id$
command="`basename \"$0\"`" command="`basename \"$0\"`"
startup="$HOME/.fluxbox/startup" fluxdir="$HOME/.@pkgprefix@fluxbox@pkgsuffix@"
startup="$fluxdir/startup"
while [ $# -gt 0 ]; do while [ $# -gt 0 ]; do
case "$1" in case "$1" in
@ -28,8 +29,8 @@ if [ -x "$startup" ]; then
elif [ -r "$startup" ]; then elif [ -r "$startup" ]; then
exec sh "$startup" exec sh "$startup"
else else
if [ ! -d "$HOME/.fluxbox" ]; then if [ ! -d $fluxdir ]; then
mkdir -p "$HOME/.fluxbox/backgrounds" "$HOME/.fluxbox/styles" "$HOME/.fluxbox/pixmaps" mkdir -p "$fluxdir/backgrounds" "$fluxdir/styles" "$fluxdir/pixmaps"
fi fi
if [ ! -r "$startup" ]; then if [ ! -r "$startup" ]; then
( cat << EOF ( cat << EOF
@ -81,7 +82,7 @@ else
exec @pkgbindir@/@pkgprefix@fluxbox@pkgsuffix@ exec @pkgbindir@/@pkgprefix@fluxbox@pkgsuffix@
# or if you want to keep a log: # or if you want to keep a log:
# exec @pkgbindir@/@pkgprefix@fluxbox@pkgsuffix@ -log "$HOME/.fluxbox/log" # exec @pkgbindir@/@pkgprefix@fluxbox@pkgsuffix@ -log "$fluxdir/log"
EOF EOF
) > "$startup" ) > "$startup"
fi fi