Student: Vishal Sharma
Organisation: XFCE
GSOC Year: 2021
Mentor: @itsmanjeet
It was great to be a part of XFCE community during the GSOC 2021. Some things get placed on right place and some didn’t, but moving forward with lot of learning and new concept related to XFCE. This was my first interaction with the GTK world and XFCE Panel plugin. I have explored different ways to implement things, some works and others doesn’t.
Here ways you can avoid to try out while developing XFCE panel plugin with Python and Javascript.
Method 1: Go all out with Python or Javascript rather than GTKSocket and GTKPlug with Libxfcepanel.
Yes, It is true that you can access most of the function or XFCE API through the usage of Libxfcepanel in python. But You would not be able to register panel with this method, due to unavailability of access to XFCE_PANEL_PLUGIN_REGISTER macros inside Libxfcepanel through panel. So, Even after implementing whole plugin with python, you would not be able to register inside a XFCE Panel, leaving your all your efforts as wastage.
Method 2: Move forward with GTKSocket and GTKPlug approach, But handing of XFCE Panel API will be done inside the Python or Javascript Part.
It would be bad approach as you would not be able to access XFCE panel plugin object inside python or javascript part in any way. And most API are based on XFCE panel plugin object, If you are able to find out any way to acess XFCE Panel Plugin pointer lying currently on a GTKSocket part inside a GTKPlug part then you it would be possible to move possible with this approach otherwise, you will not. Accessing C pointer inside a python or javascript is not a simple thing to implement.
Current Challenge: We are trying to use the concept of Dbus for handling of XFCE Panel API and signal inside a GTKSocket part, This approach is successfull in lot of API acess, but it have some challenge with menu registration.
For example, Basic requirement for right click XFCE menu is that you would have to pass GTKWidget as an argument of “xfce_panel_plugin_add_action_widget”, But You when you try to access GTKPlug through GTKSocket part, it does not return GTKPlug as an child of GTKSocket, making it difficult to access GTKPlug widget inside a GTKSocket part. This problem still remaining to solve out.
Here is an URL to the Sample Plugin with Python and Javascript.
Here is an google doc url for documentation related to this URL.
-
https://gitlab.xfce.org/apps/xfce4-panel-profiles/-/merge_requests/17
-
https://gitlab.xfce.org/xfce/libxfce4util/-/merge_requests/15
-
https://gitlab.xfce.org/xfce/xfce4-panel/-/merge_requests/52
- https://freshlybuilt.com/my-journey-to-gsoc-2021-through-xfce/
- https://freshlybuilt.com/xfce-panel-plugin-development-using-python-javascript-part-1/
- https://freshlybuilt.com/xfce-panel-plugin-development-using-python-javascript-part-2/
- https://freshlybuilt.com/xfce-panel-plugin-development-using-python-javascript-part-3/
- https://freshlybuilt.com/connection-between-xfce-api-signals-and-plug-in-python-javascript-part-1/
- https://freshlybuilt.com/connection-between-xfce-api-signals-and-plug-in-python-javascript-part-2/
This is not an end here, looking out to contribute more after the GSOC also. Thanks to all mentors, Alex, Yosuf Philips and itsmanjeet for your valuable support 🙂