You are not logged in.
Pages: 1
Hi there, I'm testing my panel plugin.
I have ready these files:
1.- plugintest.so
2.- plugintest.desktop
3.- plugintest.png
plugin.desktop looks like this:
[Xfce Panel]
Type=X-XFCE-PanelPlugin
Encoding=UTF-8
_Name=Plugin test
_Comment=Prueba del plugin
Icon=/usr/share/icon/plugintest.png
X-XFCE-Unique=true
X-XFCE-Module=plugintest
X-XFCE-Module-Path=/usr/lib/xfce4/panel-plugins
My question is where to save plugintest.desktop so it can be visible in the plugin list?
Offline
$datadir/xfce4/panel-plugins, where $datadir is /usr/share, /usr/local/share etc.
Offline
Thanks
Offline
ok, my plugin now is listed, but can't load it...
this is my simple main.c
#include "main.h"
PluginStruct *plugin_new(XfcePanelPlugin *plugin)
{
PluginStruct *ptr = panel_slice_new0(PluginStruct);
GtkOrientation orientation = xfce_panel_plugin_get_orientation(plugin);
ptr->plugin = plugin;
/* init the event box widget */
ptr->container = gtk_event_box_new();
/* inner layout */
ptr->hbox = xfce_hvbox_new(orientation,FALSE,0);
gtk_container_add(GTK_CONTAINER(ptr->container),ptr->hbox);
/* now the main widget */
GtkWidget *label = gtk_label_new ("Joel");
gtk_box_pack_start(GTK_BOX(ptr->hbox),label,FALSE,FALSE,0);
return ptr;
}
void plugin_free(XfcePanelPlugin *plugin, PluginStruct *ptr)
{
panel_slice_free(PluginStruct,ptr);
}
void plugin_constructor(XfcePanelPlugin *plugin)
{
/* init our plugin */
PluginStruct *ptr = plugin_new(plugin);
/* attach our widget to the panel */
gtk_container_add(GTK_CONTAINER(plugin),ptr->container);
xfce_panel_plugin_add_action_widget(plugin,ptr->container);
gtk_widget_show_all(ptr->container);
/* plugin signal handlers */
g_signal_connect(G_OBJECT(plugin),"free-data",G_CALLBACK(plugin_free),ptr);
}
XFCE_PANEL_PLUGIN_REGISTER_EXTERNAL(plugin_constructor);
it generates a file called libplugintest.so which is copied to /usr/lib/xfce4/panel-plugins.
This is my desktop file:
[Xfce Panel]
Type=X-XFCE-PanelPlugin
Encoding=UTF-8
Name=Plugin test
Comment=Prueba del plugin
Icon=/usr/share/icons/plugintest.png
X-XFCE-Unique=true
X-XFCE-Module=libplugintest.so
X-XFCE-Module-Path=/usr/lib/xfce4/panel-plugins
which is saved in /usr/share/xfce4/panel-plugins/. The plugin is listed, but when I try to add it to the panel, pops an error message: "No se pudo abrir el módulo "plugintest"" which means: "Can't open module plugintest"....any ideas?
Offline
X-XFCE-Module=libplugintest.so sould be X-XFCE-Module=plugintest, lib*.so is added when building the module path since it is system depended.
Offline
And you use XFCE_PANEL_PLUGIN_REGISTER_EXTERNAL, which is for external plugins (in libexecdir and compiled as an executable).
I suggest you clone the xfce4-sample-plugin which runs external or at the (internal) plugins shipped with xfce4-panel.
Offline
Pages: 1
[ Generated in 0.020 seconds, 9 queries executed - Memory usage: 536.26 KiB (Peak: 537.1 KiB) ]