aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Eve <martin@martineve.com>2013-12-27 17:46:07 +0000
committerMartin Eve <martin@martineve.com>2013-12-27 17:46:07 +0000
commitef86299ee5fa19b4f1a9d7f0ca657fc3042e58d1 (patch)
treee578a8a9e88f60a7ece1166bb5b78ca7f4d5e903
parent9afe09f095d83d9ce9c8fa170771e84d9969db23 (diff)
downloadpyParrotZikTCP-ef86299ee5fa19b4f1a9d7f0ca657fc3042e58d1.tar.xz
pyParrotZikTCP-ef86299ee5fa19b4f1a9d7f0ca657fc3042e58d1.zip
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.
-rw-r--r--SysIndicator.py4
1 files changed, 3 insertions, 1 deletions
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()