Package: lxpanel
Version: 0.5.6-1
Tags: patch
Usertags: origin-ubuntu natty ubuntu-patch
In Ubuntu, we've applied the attached patch to achieve the following:
* debian/patches/configure_desktop_number.patch:
- Add configuration for desktop number for the pager plugin.
We thought you might be interested in doing the same.
Description: Add configuration for desktop number for the pager plugin.
Author: Julien Lavergne <[email protected]>
--- lxpanel-0.5.6.orig/src/plugins/pager.c
+++ lxpanel-0.5.6/src/plugins/pager.c
@@ -775,6 +775,80 @@ static void pager_destructor(Plugin * p)
g_free(pg);
}
+/* Callback when the configuration dialog is to be shown. */
+static void deskno_configure(Plugin * p, GtkWindow * parent)
+{
+
+ GdkScreen *screen = gdk_screen_get_default();
+ const char *wm_name = gdk_x11_screen_get_window_manager_name(screen);
+ GError *error = NULL;
+ const gchar *command_line = NULL;
+
+ if(g_strcmp0(wm_name, "Openbox") == 0)
+ {
+ if (g_find_program_in_path("obconf"))
+ {
+ command_line = "obconf --tab 6";
+ }
+ }
+ else if (g_strcmp0(wm_name, "compiz") == 0)
+ {
+ if (g_find_program_in_path("ccsm"))
+ {
+ command_line = "ccsm";
+
+ }
+ else if (g_find_program_in_path("simple-ccsm"))
+ {
+ command_line = "simple-ccsm";
+ }
+ }
+ else
+ {
+
+ GtkWidget* msg;
+
+ msg = gtk_message_dialog_new( NULL,
+ 0,
+ GTK_MESSAGE_ERROR,
+ GTK_BUTTONS_OK,
+ _("Error, only openbox and compiz are supported") );
+ gtk_dialog_run( GTK_DIALOG(msg) );
+ gtk_widget_destroy( msg );
+
+ }
+
+ if (command_line)
+ {
+ gdk_spawn_command_line_on_screen(screen,
+ command_line,
+ &error);
+ }
+
+ else
+ {
+
+ GtkWidget* msg;
+
+ msg = gtk_message_dialog_new( NULL,
+ 0,
+ GTK_MESSAGE_ERROR,
+ GTK_BUTTONS_OK,
+ _("Error, you need to install obconf, ccsm of simple-ccsm") );
+ gtk_dialog_run( GTK_DIALOG(msg) );
+ gtk_widget_destroy( msg );
+
+ }
+
+ if (error)
+ {
+ g_print("%s\n", error->message);
+
+ g_free (error);
+ }
+
+}
+
/* Callback when panel configuration changes. */
static void pager_panel_configuration_changed(Plugin * p)
{
@@ -800,7 +874,7 @@ PluginClass pager_plugin_class = {
constructor : pager_constructor,
destructor : pager_destructor,
- config : NULL,
+ config : deskno_configure,
save : NULL,
panel_configuration_changed : pager_panel_configuration_changed
};