localedir = $(datadir)/locale
configdir = $(sysconfdir)/xdg
rcdir = $(configdir)/openbox
-desktopfilesdir = $(datadir)/gnome/wm-properties
+xsessionsdir = $(datadir)/xsessions
+gnomewmfilesdir = $(datadir)/gnome/wm-properties
pkgconfigdir = $(libdir)/pkgconfig
pubincludedir = $(includedir)/openbox/@OB_VERSION@/openbox
pixmapdir = $(datadir)/pixmaps
openbox/openbox \
tools/gnome-panel-control/gnome-panel-control
+bin_SCRIPTS = \
+ data/xsession/openbox-gnome-session \
+ data/xsession/openbox-kde-session \
+ data/xsession/openbox-gnome \
+ data/xsession/openbox-kde
+
noinst_PROGRAMS = \
tools/themetoxml/themetoxml
@mkdir data 2>/dev/null || true
@$(edit) $(srcdir)/data/menu.xml.in >$@
-dist_desktopfiles_DATA = \
- data/openbox.desktop
+dist_gnomewmfiles_DATA = \
+ data/gnome-wm-properties/openbox.desktop \
+ data/gnome-wm-properties/openbox-gnome.desktop \
+ data/gnome-wm-properties/openbox-kde.desktop
+
+dist_xsessions_DATA = \
+ data/xsession/openbox.desktop \
+ data/xsession/openbox-gnome.desktop \
+ data/xsession/openbox-kde.desktop
dist_noinst_DATA = \
version.h.in \
--- /dev/null
+all clean install:
+ $(MAKE) -C .. -$(MAKEFLAGS) $@
+
+.PHONY: all clean install
--- /dev/null
+[Desktop Entry]
+Name=Openbox/GNOME
+Exec=openbox-gnome
+
+# name we put on the WM spec check window
+X-GNOME-WMName=openbox-gnome
+
+# our config tool
+ConfigExec=obconf
--- /dev/null
+[Desktop Entry]
+Name=Openbox/GNOME
+Exec=openbox-kde
+
+# name we put on the WM spec check window
+X-GNOME-WMName=openbox-kde
+
+# our config tool
+ConfigExec=obconf
+
Exec=openbox
# name we put on the WM spec check window
-X-GNOME-WMName=Openbox
+X-GNOME-WMName=openbox
# our config tool
-ConfigExec=obconf2
+ConfigExec=obconf
--- /dev/null
+all clean install:
+ $(MAKE) -C .. -$(MAKEFLAGS) $@
+
+.PHONY: all clean install
--- /dev/null
+#!/bin/sh
+
+# A temporary script to be replaced by a real program..
+export OPENBOX_RESTART_BINARY=openbox-gnome
+exec openbox "$@"
--- /dev/null
+#!/bin/sh
+
+# Run GNOME with Openbox as its window manager
+export WINDOW_MANAGER=openbox-gnome
+exec gnome-session "$@"
--- /dev/null
+[Desktop Entry]
+Encoding=UTF-8
+Name=Openbox/GNOME
+Comment=Use the Openbox window manager inside of the GNOME desktop environment
+Exec=openbox-gnome-session
+TryExec=gnome-session
+Icon=openbox.png
+Type=XSession
--- /dev/null
+#!/bin/sh
+
+# A temporary script to be replaced by a real program..
+export OPENBOX_RESTART_BINARY=openbox-kde
+exec openbox "$@"
--- /dev/null
+#!/bin/sh
+
+# Run KDE with Openbox as its window manager
+export KDEWM=openbox-kde
+exec startkde "$@"
--- /dev/null
+[Desktop Entry]
+Encoding=UTF-8
+Name=Openbox/KDE
+Comment=Use the Openbox window manager inside of the K Desktop Environment
+Exec=openbox-kde-session
+TryExec=startkde
+Icon=openbox.png
+Type=XSession
--- /dev/null
+[Desktop Entry]
+Encoding=UTF-8
+Name=Openbox
+Comment=Use this session to run Openbox as your desktop environment
+Exec=openbox
+TryExec=openbox-shell
+Icon=openbox.png
+Type=XSession
static guint remote_control = 0;
static gboolean being_replaced = FALSE;
static gchar *config_type = NULL;
+static pid_t reconfigure_notify = 0;
static void signal_handler(gint signal, gpointer data);
static void parse_env(char **argv0);
gint main(gint argc, gchar **argv)
{
+ gchar *program_name;
+
state = OB_STATE_STARTING;
/* initialize the locale */
bind_textdomain_codeset(PACKAGE_NAME, "UTF-8");
textdomain(PACKAGE_NAME);
- g_set_prgname(argv[0]);
-
if (chdir(g_get_home_dir()) == -1)
g_message(_("Unable to change to home directory '%s': %s"),
g_get_home_dir(), g_strerror(errno));
- /* parse out environment and command line args */
+ /* parse the environment first, it can change the argv[0] */
parse_env(&argv[0]);
+
+ program_name = g_path_get_basename(argv[0]);
+ g_set_prgname(program_name);
+
+ /* parse the command line args */
parse_args(&argc, argv);
if (!remote_control) {
prop_startup(); /* get atoms values for the display */
extensions_query_all(); /* find which extensions are present */
- if (screen_annex()) { /* it will be ours! */
+ if (screen_annex(program_name)) { /* it will be ours! */
do {
{
ObParseInst *i;
/* re-run me */
execvp(argv[0], argv); /* try how we were run */
- execlp(argv[0], g_path_get_basename(argv[0]),
- (char *)NULL); /* last resort */
+ execlp(argv[0], program_name, (gchar*)NULL); /* last resort */
}
/* free stuff passed in from the command line or environment */
g_free(ob_sm_save_file);
g_free(ob_sm_id);
g_free(config_type);
+ g_free(program_name);
return exitcode;
}
if ((c = getenv("OPENBOX_RESTART_BINARY")))
*argv0 = g_strdup(c);
unsetenv("OPENBOX_RESTART_BINARY");
+
+ /* notify this application when openbox reconfigures */
+ if ((c = getenv("OPENBOX_RECONFIGURE_NOTIFY_PID")))
+ reconfigure_notify = (pid_t) atol(c);
}
static void remove_args(gint *argc, gchar **argv, gint index, gint num)
void ob_reconfigure()
{
+ if (reconfigure_notify)
+ kill(reconfigure_notify, SIGUSR2);
+
reconfigure = TRUE;
ob_exit(0);
}
return TRUE;
}
-gboolean screen_annex()
+gboolean screen_annex(const gchar *program_name)
{
XSetWindowAttributes attrib;
pid_t pid;
net_supporting_wm_check, window, screen_support_win);
/* set properties on the supporting window */
- PROP_SETS(screen_support_win, net_wm_name, "Openbox");
+ PROP_SETS(screen_support_win, net_wm_name, program_name);
PROP_SET32(screen_support_win, net_supporting_wm_check,
window, screen_support_win);
extern gchar **screen_desktop_names;
/*! Take over the screen, set the basic hints on it claming it as ours */
-gboolean screen_annex();
+gboolean screen_annex(const gchar *program_name);
/*! Once the screen is ours, set up its initial state */
void screen_startup(gboolean reconfig);