Posts: 21
Joined: Fri Nov 25, 2016 1:34 pm

Add custom Panel Applet plugin to Panel

Fri Apr 07, 2017 7:55 pm


Does anyone know how to create or add an existing application as a plugin to a panel on Raspbian Jessie with Pixel?

I'm not talking about a shortcut, I can do that. What I want is to have a battery indicator for my Pi-Top in between my CPU usage and Clock Panel Applets. When googling i only get articles relating to getting your taskbar back if you deleted it and creating shortcuts.

The built in battery monitor applet does not work because the pi-top hub is communicating via I2C and not ACPI. I have been unable to find ACPI drivers.

Thanks in advance

Posts: 8
Joined: Fri Dec 11, 2015 1:10 pm

Re: Add custom Panel Applet plugin to Panel

Fri Jun 02, 2017 10:21 am

I would like to know that too.

I would like to create an applet, anyone can guide where to start ?

Posts: 21
Joined: Fri Nov 25, 2016 1:34 pm

Re: Add custom Panel Applet plugin to Panel

Sun Jul 02, 2017 6:58 pm

Hopefully not too late, I got distracted with other problems.

Here is a simple Python example.... Cant remember where I found it.

Code: Select all

import smbus
import time

bus = smbus.SMBus(1)
address = 0x0b

import gtk
def message(data=None):
  "Function to display messages to the user."
  msg=gtk.MessageDialog(None, gtk.DIALOG_MODAL,
    gtk.MESSAGE_INFO, gtk.BUTTONS_OK, data)
def open_app(data=None):
def close_app(data=None):
def make_menu(event_button, event_time, data=None):
  menu = gtk.Menu()
  open_item = gtk.MenuItem("Open App")
  close_item = gtk.MenuItem("Close App")
  #Append the menu items  
  #add callbacks
  open_item.connect_object("activate", open_app, "Open App")
  close_item.connect_object("activate", close_app, "Close App")
  #Show the menu items
  #Popup the menu
  menu.popup(None, None, None, event_button, event_time)
def on_right_click(data, event_button, event_time):
  make_menu(event_button, event_time)
def on_left_click(event):
  message("Status Icon Left Clicked")
if __name__ == '__main__':
  icon = gtk.status_icon_new_from_stock(gtk.STOCK_ABOUT)
  icon.connect('popup-menu', on_right_click)
  icon.connect('activate', on_left_click)

Return to “Advanced users”