python scryptをここで見つけました:ubuntuアプリ開発者:インジケーターアプリを実行するためのアプリケーションインジケーター。
country-indicator.py
#!/usr/bin/env python
# Copyright 2009 Canonical Ltd.
#
# Authors: Neil Jagdish Patel <neil.patel@canonical.com>
# Jono Bacon <jono@ubuntu.com>
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of either or both of the following licenses:
#
# 1) the GNU Lesser General Public License version 3, as published by the
# Free Software Foundation; and/or
# 2) the GNU Lesser General Public License version 2.1, as published by
# the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranties of
# MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the applicable version of the GNU Lesser General Public
# License for more details.
#
# You should have received a copy of both the GNU Lesser General Public
# License version 3 and version 2.1 along with this program. If not, see
# <http://www.gnu.org/licenses/>
#
import gtk
import appindicator
import getpass
import locale
lang = locale.getdefaultlocale()
user = getpass.getuser()
png = '/home/' + user + '/.icons/flags/' + lang[0] + '.png'
def menuitem_response(w):
gtk.main_quit()
if __name__ == "__main__":
ind = appindicator.Indicator ("lang-flag-indicator", png, appindicator.CATEGORY_APPLICATION_STATUS)
ind.set_status (appindicator.STATUS_ACTIVE)
print "your current language is: %s, so it load the ~/.icons/flags/%s.png" % (lang[0], lang[0])
# create a menu
menu = gtk.Menu()
mnuQuit = gtk.MenuItem("Exit")
menu.append(mnuQuit)
mnuQuit.connect("activate", menuitem_response)
mnuQuit.show()
ind.set_menu(menu)
gtk.main()
Python scryptとして簡単に実行するか、pyinstallerでコンパイルできます。
お役に立てれば