Merge branch 'master' of https://github.com/Cyrille37/indicator-chars
authorCyrille Giquello <cyrille@giquello.fr>
Wed, 3 Feb 2016 18:37:15 +0000 (19:37 +0100)
committerCyrille Giquello <cyrille@giquello.fr>
Wed, 3 Feb 2016 18:37:15 +0000 (19:37 +0100)
1  2 
indicator-chars.py

diff --combined indicator-chars.py
@@@ -1,4 -1,4 +1,4 @@@
- #!/usr/bin/python
+ #!/usr/bin/env python
  # -*- coding: utf-8 -*-
  #
  # Very simple chars indicator.
@@@ -36,7 -36,6 +36,7 @@@ import gt
  import gio
  import signal
  import subprocess
 +# sudo apt-get install python-appindicator
  import appindicator
  
  APP_NAME = 'indicator-chars'
@@@ -51,7 -50,10 +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)        
  
@@@ -75,6 -77,7 +78,6 @@@
  
          # Create menu
          menu = gtk.Menu()
 -        self.ind.set_menu(menu)
          
          for charLine in charDef:
              charLine = unicode(charLine)
          menu.append(quit_item)
  
          # Show the menu
 +        self.ind.set_menu(menu)
          menu.show_all()
  
      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()