]> Dogcows Code - chaz/openbox/commitdiff
add .desktops for running Openbox, KDE/Openbox and GNOME/Openbox
authorDana Jansens <danakj@orodu.net>
Mon, 7 May 2007 01:41:48 +0000 (01:41 +0000)
committerDana Jansens <danakj@orodu.net>
Mon, 7 May 2007 01:41:48 +0000 (01:41 +0000)
add more .desktops for gnome and update it
add scripts to run an KDE/Openbox and GNOME/Openbox session
also add scripts for openbox-gnome and openbox-kde which are placeholders and will be replaced by real programs.
also set the name on the wm_support_win to be how we were called (which is passed in the environment) rather than just "Openbox"
add an envionment variable for wanting to be notified (SIGUSR2) when openbox reconfigures. this would be used by openbox-shell to update the root window.. if i make such a thing.. i dunno.

16 files changed:
Makefile.am
data/gnome-wm-properties/Makefile [new file with mode: 0644]
data/gnome-wm-properties/openbox-gnome.desktop [new file with mode: 0644]
data/gnome-wm-properties/openbox-kde.desktop [new file with mode: 0644]
data/gnome-wm-properties/openbox.desktop [moved from data/openbox.desktop with 71% similarity]
data/xsession/Makefile [new file with mode: 0644]
data/xsession/openbox-gnome [new file with mode: 0755]
data/xsession/openbox-gnome-session [new file with mode: 0755]
data/xsession/openbox-gnome.desktop [new file with mode: 0644]
data/xsession/openbox-kde [new file with mode: 0755]
data/xsession/openbox-kde-session [new file with mode: 0755]
data/xsession/openbox-kde.desktop [new file with mode: 0644]
data/xsession/openbox.desktop [new file with mode: 0644]
openbox/openbox.c
openbox/screen.c
openbox/screen.h

index b879c0178e76722a8ccef8d9b10ee93d8ee604da..af283aac4467fead2390e35883c1706ee07344eb 100644 (file)
@@ -4,7 +4,8 @@ themedir        = $(datadir)/themes
 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
@@ -29,6 +30,12 @@ bin_PROGRAMS = \
        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
 
@@ -386,8 +393,15 @@ data/menu.xml: Makefile $(srcdir)/data/menu.xml.in data
        @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 \
diff --git a/data/gnome-wm-properties/Makefile b/data/gnome-wm-properties/Makefile
new file mode 100644 (file)
index 0000000..b90edac
--- /dev/null
@@ -0,0 +1,4 @@
+all clean install:
+       $(MAKE) -C .. -$(MAKEFLAGS) $@
+
+.PHONY: all clean install
diff --git a/data/gnome-wm-properties/openbox-gnome.desktop b/data/gnome-wm-properties/openbox-gnome.desktop
new file mode 100644 (file)
index 0000000..be8ff35
--- /dev/null
@@ -0,0 +1,9 @@
+[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
diff --git a/data/gnome-wm-properties/openbox-kde.desktop b/data/gnome-wm-properties/openbox-kde.desktop
new file mode 100644 (file)
index 0000000..0208c32
--- /dev/null
@@ -0,0 +1,10 @@
+[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
+
similarity index 71%
rename from data/openbox.desktop
rename to data/gnome-wm-properties/openbox.desktop
index 559a1a001a20fc7238a7662cd6ae494b4b394935..96418613767b2151f9861825d71fb218c9b2f06f 100644 (file)
@@ -3,7 +3,7 @@ Name=Openbox
 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
diff --git a/data/xsession/Makefile b/data/xsession/Makefile
new file mode 100644 (file)
index 0000000..b90edac
--- /dev/null
@@ -0,0 +1,4 @@
+all clean install:
+       $(MAKE) -C .. -$(MAKEFLAGS) $@
+
+.PHONY: all clean install
diff --git a/data/xsession/openbox-gnome b/data/xsession/openbox-gnome
new file mode 100755 (executable)
index 0000000..03a22d3
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+# A temporary script to be replaced by a real program..
+export OPENBOX_RESTART_BINARY=openbox-gnome
+exec openbox "$@"
diff --git a/data/xsession/openbox-gnome-session b/data/xsession/openbox-gnome-session
new file mode 100755 (executable)
index 0000000..d2b7701
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+# Run GNOME with Openbox as its window manager
+export WINDOW_MANAGER=openbox-gnome
+exec gnome-session "$@"
diff --git a/data/xsession/openbox-gnome.desktop b/data/xsession/openbox-gnome.desktop
new file mode 100644 (file)
index 0000000..a7ac098
--- /dev/null
@@ -0,0 +1,8 @@
+[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
diff --git a/data/xsession/openbox-kde b/data/xsession/openbox-kde
new file mode 100755 (executable)
index 0000000..a3b603a
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+# A temporary script to be replaced by a real program..
+export OPENBOX_RESTART_BINARY=openbox-kde
+exec openbox "$@"
diff --git a/data/xsession/openbox-kde-session b/data/xsession/openbox-kde-session
new file mode 100755 (executable)
index 0000000..589a2c5
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+# Run KDE with Openbox as its window manager
+export KDEWM=openbox-kde
+exec startkde "$@"
diff --git a/data/xsession/openbox-kde.desktop b/data/xsession/openbox-kde.desktop
new file mode 100644 (file)
index 0000000..456b0df
--- /dev/null
@@ -0,0 +1,8 @@
+[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
diff --git a/data/xsession/openbox.desktop b/data/xsession/openbox.desktop
new file mode 100644 (file)
index 0000000..3b4d998
--- /dev/null
@@ -0,0 +1,8 @@
+[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
index 53299873dfc7b94b6d7cf079a5ffae0b45eb4bad..198d073599a22b2068e64c15453077257a97386d 100644 (file)
@@ -96,6 +96,7 @@ static gint      exitcode = 0;
 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);
@@ -105,6 +106,8 @@ static Cursor load_cursor(const gchar *name, guint fontval);
 
 gint main(gint argc, gchar **argv)
 {
+    gchar *program_name;
+
     state = OB_STATE_STARTING;
 
     /* initialize the locale */
@@ -114,14 +117,17 @@ gint main(gint argc, gchar **argv)
     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) {
@@ -216,7 +222,7 @@ gint main(gint argc, gchar **argv)
     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;
@@ -404,14 +410,14 @@ gint main(gint argc, gchar **argv)
 
         /* 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;
 }
@@ -481,6 +487,10 @@ static void parse_env(gchar **argv0)
     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)
@@ -597,6 +607,9 @@ void ob_restart()
 
 void ob_reconfigure()
 {
+    if (reconfigure_notify)
+        kill(reconfigure_notify, SIGUSR2);
+
     reconfigure = TRUE;
     ob_exit(0);
 }
index 3c35395a2e5cc1130c556ebf9bb485eb222b3cfe..b0c3286a2d7815fbc90b14ed738d3e4ce772224f 100644 (file)
@@ -153,7 +153,7 @@ static gboolean replace_wm()
     return TRUE;
 }
 
-gboolean screen_annex()
+gboolean screen_annex(const gchar *program_name)
 {
     XSetWindowAttributes attrib;
     pid_t pid;
@@ -203,7 +203,7 @@ gboolean screen_annex()
                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);
 
index b4c510a71456cfac05e9e143803b6fbca714b82f..ccaa4f5726edb486efd68994465e9c2654f1c6e6 100644 (file)
@@ -53,7 +53,7 @@ extern DesktopLayout screen_desktop_layout;
 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);
This page took 0.04273 seconds and 4 git commands to generate.