[H-GEN] help with panel plugin for xfce panel

Peter Robinson pjr4171 at gmail.com
Wed Sep 24 17:34:20 AEST 2025


Hi All,
I want to write a panel app for xfce so I decided to get copilot to 
write an example for me - what could possibly go wrong. As far as I can 
tell everything is OK but I can't add the app from Panel->AddNewItem.

xfce_panel_plugin_example.c:

#include <libxfce4panel/xfce-panel-plugin.h>
#include <libxfce4panel/libxfce4panel.h>
#include <gtk/gtk.h>

static void
my_plugin_construct(XfcePanelPlugin *plugin)
{
     GtkWidget *label = gtk_label_new("Hello XFCE Panel!");
     gtk_container_add(GTK_CONTAINER(plugin), label);
     gtk_widget_show(label);
}

XFCE_PANEL_PLUGIN_REGISTER(my_plugin_construct);


----------------------------------------------------------------

xfce_panel_plugin_example.desktop:

[Xfce Panel]
Version=1.0
Type=X-XFCE-PanelPlugin
Name=Example Panel Plugin
Comment=Displays a simple label on the XFCE panel
Icon=applications-system
X-XFCE-Module=xfce_panel_plugin_example
X-XFCE-Internal=false
X-XFCE-Unique=true
X-XFCE-API=2.0


------------------------------------------------------------------

Compilation:

gcc -fPIC -shared xfce_panel_plugin_example.c -o 
xfce_panel_plugin_example.so $(pkg-config --cflags --libs 
libxfce4panel-2.0 gtk+-3.0)

(compiled without any issues)

-----------------------------------------------------------------

I put the desktop file in .local/share/xfce4/panel/plugins
and the .so file in .local/lib/xfce4/panel/plugins

I ran xfce4-panel -r  (several times) without any warnings or errors. I 
also created another panel and tried to add the app to that panel.

I even tried putting them in the appropriate system level directories 
and did a reboot.

I also tried copying and modifying  the .so file and .desktop file of 
one that is on my panel and so I know it works.

Nothing worked. It feels like I'm missing some step - like some way to 
let the system know about my app other than putting it in the 
appropriate directories.


Thoughts?


Regards,
Peter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.humbug.org.au/mailman/pipermail/general/attachments/20250924/7105060a/attachment.htm>


More information about the General mailing list