diff options
author | Guillaume Seguin <guillaume@segu.in> | 2007-11-18 00:11:25 +0100 |
---|---|---|
committer | Guillaume Seguin <guillaume@segu.in> | 2007-11-18 00:11:25 +0100 |
commit | 6843efe52578a87711796f4c95e6dafdb244fd83 (patch) | |
tree | aeaba66137865caa63b9672d138f32344a5bbec1 | |
parent | 340bc3a0aa8ac3c42f6bc6de961002a8a888006d (diff) | |
download | ugok-6843efe52578a87711796f4c95e6dafdb244fd83.tar.gz ugok-6843efe52578a87711796f4c95e6dafdb244fd83.tar.bz2 |
* Use the same icon in menu and application
-rw-r--r-- | MANIFEST.in | 1 | ||||
-rwxr-xr-x | scripts/ugok.in (renamed from scripts/ugok) | 9 | ||||
-rw-r--r-- | setup.py | 10 |
3 files changed, 17 insertions, 3 deletions
diff --git a/MANIFEST.in b/MANIFEST.in index 62fec38..cf90121 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,3 +1,4 @@ include README AUTHORS COPYING VERSION include ugok.desktop include MANIFEST.in +include scripts/ugok.in diff --git a/scripts/ugok b/scripts/ugok.in index b756be2..3d35513 100755 --- a/scripts/ugok +++ b/scripts/ugok.in @@ -33,10 +33,11 @@ import sys from ugok.uinput import uinput from ugok.default_map import DEFAULT_KBMAP +PREFIX = "@prefix@" + class uGOK (gtk.Window): '''Keyboard window''' - icon_name = gtk.STOCK_SELECT_FONT small_font = None keys = [] @@ -57,7 +58,9 @@ class uGOK (gtk.Window): gtk.Window.__init__ (self) self.set_title ("uGOK") - self.set_icon_name (self.icon_name) + path = "%s/share/pixmaps/ugok.png" % PREFIX + icon_png = gtk.gdk.pixbuf_new_from_file (path) + self.set_icon (icon_png) self.set_keep_above (True) self.set_position (gtk.WIN_POS_CENTER) self.set_property ("accept-focus", False) @@ -69,7 +72,7 @@ class uGOK (gtk.Window): self.small_font = pango.FontDescription ("Sans 6") - self.tray_icon = gtk.status_icon_new_from_icon_name (self.icon_name) + self.tray_icon = gtk.status_icon_new_from_pixbuf (icon_png) self.tray_icon.connect ("activate", self.show_hide) self.main_box = gtk.HBox () @@ -101,6 +101,14 @@ version = version_file.read ().strip () if "=" in version: version = version.split ("=")[1] +f = open (os.path.join ("scripts", "ugok.in"), "rt") +data = f.read () +f.close () +data = data.replace ("@prefix@", prefix) +f = open (os.path.join ("scripts", "ugok"), "wt") +f.write (data) +f.close () + data_files = [ ("share/applications", ["ugok.desktop"]), ("share/pixmaps", ["images/ugok.png"]), @@ -137,3 +145,5 @@ setup ( "install" : install, "install_data" : install_data} ) + +os.remove (os.path.join ("scripts", "ugok")) |