Merge pull request #1608 from andreas-h/desktop_install

BUG: allow non-root installation on linux
This commit is contained in:
ThomasV 2016-01-05 12:42:48 +01:00
commit d168f66b60
1 changed files with 5 additions and 0 deletions

5
setup.py Normal file → Executable file
View File

@ -17,6 +17,11 @@ data_files = []
if platform.system() in ['Linux', 'FreeBSD', 'DragonFly']:
usr_share = os.path.join(sys.prefix, "share")
if not os.access(usr_share, os.W_OK):
if 'XDG_DATA_HOME' in os.environ.keys():
usr_share = os.environ['$XDG_DATA_HOME']
else:
usr_share = os.path.expanduser('~/.local/share')
data_files += [
(os.path.join(usr_share, 'applications/'), ['electrum.desktop']),
(os.path.join(usr_share, 'pixmaps/'), ['icons/electrum.png'])