characters to be selectable.
-------
+Fork Cyrille37
+-------
+
+:Author: Cyrille37 <cyrille37@gmail.com>
+
+- Some changes to make indicator-chars works on Ubuntu 12.04LTS with Unity 2D
+
+ - replace the custom icon with a theme icon name
+
+ - add a char copy into Clipboard(selection="CLIPBOARD")
+
+- Other minors changes
+
+ - use env to find the Python engine
+
+ - add a configuration file example: "conf-example.indicator-chars"
+
+-------
Install
-------
-#!/usr/bin/python
+#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Very simple chars indicator.
def __init__(self):
self.ind = appindicator.Indicator(
- "Chars", os.path.join(self.SCRIPT_DIR, 'light16x16.png'),
+ # Custom icon seems to doesn't work on my Ubuntu 12.04 LTS running Unity 2D
+ #"Chars", os.path.join(self.SCRIPT_DIR, 'light16x16.png'),
+ # So fallback to an referenced theme's icon name
+ "Chars", "accessories-character-map",
appindicator.CATEGORY_APPLICATION_STATUS)
self.ind.set_status(appindicator.STATUS_ACTIVE)
def on_char_click(self, widget, char):
cb = gtk.Clipboard(selection="PRIMARY")
cb.set_text(char)
+ cb = gtk.Clipboard(selection="CLIPBOARD")
+ cb.set_text(char)
def on_quit(self, widget):
gtk.main_quit()