Você pode criar um applet python simples. Aqui está um applet muito simples que eu notei onde colocar seus comandos e nomes para os comandos:
#!/usr/bin/env python
import sys
import gtk
import appindicator
import subprocess
import os
repo_name = "Name Of Indicator"
def sh_escape(s):
return s.replace("\"","\\"")
class Commands:
def __init__(self, title="Unknown", command=""):
self.title = title
self.command = command
commandArr = [];
commandArr.append(Commands("Command 1 name","command one"))
commandArr.append(Commands("Command 2 name","command two"))
class RemoteApplet:
def __init__(self):
self.ind = appindicator.Indicator(repo_name,
repo_name,
appindicator.CATEGORY_APPLICATION_STATUS)
self.ind.set_label(repo_name)
self.ind.set_status(appindicator.STATUS_ACTIVE)
self.ind.set_attention_icon("new-messages-red")
self.menu_setup()
self.ind.set_menu(self.menu)
def menu_setup(self):
self.menu = gtk.Menu()
self.command_items = []
cnt = 0
for x in commandArr:
self.command_items.append(gtk.MenuItem(x.title))
self.command_items[-1].connect("activate", self.handleitem, cnt)
self.command_items[-1].show()
self.menu.append(self.command_items[-1])
cnt += 1
self.quit_item = gtk.MenuItem("Quit")
self.quit_item.connect("activate", self.quit)
self.quit_item.show()
self.menu.append(self.quit_item)
def main(self):
self.login()
print "Started!"
gtk.main()
def quit(self, widget):
sys.exit(0)
def login(self):
pass
def handleitem(self, widget, index):
print "Running... " + commandArr[index].command
proc = subprocess.Popen(commandArr[index].command,stdout=subprocess.PIPE, shell=True)
(out, err) = proc.communicate()
os.system("/usr/bin/notify-send \"" + sh_escape(repo_name + " - Output") + "\" \"" + sh_escape(out) + "\"")
if __name__ == "__main__":
print "Starting..."
indicator = RemoteApplet()
indicator.main()