From ef86299ee5fa19b4f1a9d7f0ca657fc3042e58d1 Mon Sep 17 00:00:00 2001 From: Martin Eve Date: Fri, 27 Dec 2013 17:46:07 +0000 Subject: Add second option for icon paths on Linux This commit assesses whether the user has installed the icon packs into their /usr/share directory and, if not, it instead reverts to using the icons relative to the path of the currently executing script. This allows pyParrotZik to run in a standalone environment without relying on modifications to system files. --- SysIndicator.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/SysIndicator.py b/SysIndicator.py index 3d7adce..6f68018 100644 --- a/SysIndicator.py +++ b/SysIndicator.py @@ -16,6 +16,8 @@ class SysIndicator: self.menu = menu.gtk_menu import appindicator self.icon_directory = os.path.sep + 'usr' + os.path.sep+ 'share' + os.path.sep+'icons' + os.path.sep+'zik'+ os.path.sep + if not os.path.isdir(self.icon_directory): + self.icon_directory = os.path.dirname(sys.argv[0]) + os.path.sep + 'share' + os.path.sep+'icons' + os.path.sep+'zik'+ os.path.sep self.statusicon = appindicator.Indicator("new-parrotzik-indicator", "indicator-messages", appindicator.CATEGORY_APPLICATION_STATUS) @@ -134,4 +136,4 @@ if __name__ == "__main__": menu.append(info_item) indicator = SysIndicator(icon = "audio-headset",menu = menu) - indicator.main() \ No newline at end of file + indicator.main() -- cgit v1.2.1