Merge branch 'master' of https://github.com/Cyrille37/indicator-chars
[indicator-chars.git] / indicator-chars.py
index 0570a02..61c5365 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # -*- coding: utf-8 -*-
 #
 # Very simple chars indicator.
@@ -51,7 +51,10 @@ class IndicatorChars:
 
     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)        
 
@@ -117,6 +120,8 @@ class IndicatorChars:
     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()