#!/usr/bin/python

# python setup.py sdist --format=zip,gztar

from setuptools import setup
import os
import sys
import platform
import imp


version = imp.load_source('version', 'lib/version.py')

if sys.version_info[:3] < (2, 7, 0):
    sys.exit("Error: Electrum requires Python version >= 2.7.0...")



data_files = []
if platform.system() == 'Linux' or platform.system() == 'FreeBSD':
    usr_share = os.path.join(sys.prefix, "share")
    data_files += [
        (os.path.join(usr_share, 'applications/'), ['electrum.desktop']),
        (os.path.join(usr_share, 'app-install', 'icons/'), ['icons/electrum.png'])
    ]


setup(
    name="Electrum",
    version=version.ELECTRUM_VERSION,
    install_requires=[
        'slowaes>=0.1a1',
        'ecdsa>=0.9',
        'pbkdf2',
        'requests',
        'pyasn1-modules',
        'pyasn1',
        'qrcode',
        'protobuf',
        'tlslite',
        'dnspython',
    ],
    package_dir={
        'electrum': 'lib',
        'electrum_gui': 'gui',
        'electrum_plugins': 'plugins',
    },
    packages=['electrum','electrum_gui','electrum_gui.qt','electrum_plugins'],
    package_data={
        'electrum': [
            'wordlist/*.txt',
            'locale/*/LC_MESSAGES/electrum.mo',
        ],
        'electrum_gui': [
            "qt/themes/cleanlook/name.cfg",
            "qt/themes/cleanlook/style.css",
            "qt/themes/sahara/name.cfg",
            "qt/themes/sahara/style.css",
            "qt/themes/dark/name.cfg",
            "qt/themes/dark/style.css",
        ]
    },
    scripts=['electrum'],
    data_files=data_files,
    description="Lightweight Bitcoin Wallet",
    author="Thomas Voegtlin",
    author_email="thomasv@electrum.org",
    license="GNU GPLv3",
    url="https://electrum.org",
    long_description="""Lightweight Bitcoin Wallet"""
)

setup.py
#!/usr/bin/python

# python setup.py sdist --format=zip,gztar

from setuptools import setup
import os
import sys
import platform
import imp


version = imp.load_source('version', 'lib/version.py')

if sys.version_info[:3] < (2, 7, 0):
    sys.exit("Error: Electrum requires Python version >= 2.7.0...")



data_files = []
if platform.system() == 'Linux' or platform.system() == 'FreeBSD':
    usr_share = os.path.join(sys.prefix, "share")
    data_files += [
        (os.path.join(usr_share, 'applications/'), ['electrum.desktop']),
        (os.path.join(usr_share, 'pixmaps/'), ['icons/electrum.png'])
    ]


setup(
    name="Electrum",
    version=version.ELECTRUM_VERSION,
    install_requires=[
        'slowaes>=0.1a1',
        'ecdsa>=0.9',
        'pbkdf2',
        'requests',
        'pyasn1-modules',
        'pyasn1',
        'qrcode',
        'protobuf',
        'tlslite',
        'dnspython',
    ],
    package_dir={
        'electrum': 'lib',
        'electrum_gui': 'gui',
        'electrum_plugins': 'plugins',
    },
    packages=['electrum','electrum_gui','electrum_gui.qt','electrum_plugins'],
    package_data={
        'electrum': [
            'wordlist/*.txt',
            'locale/*/LC_MESSAGES/electrum.mo',
        ],
        'electrum_gui': [
            "qt/themes/cleanlook/name.cfg",
            "qt/themes/cleanlook/style.css",
            "qt/themes/sahara/name.cfg",
            "qt/themes/sahara/style.css",
            "qt/themes/dark/name.cfg",
            "qt/themes/dark/style.css",
        ]
    },
    scripts=['electrum'],
    data_files=data_files,
    description="Lightweight Bitcoin Wallet",
    author="Thomas Voegtlin",
    author_email="thomasv@electrum.org",
    license="GNU GPLv3",
    url="https://electrum.org",
    long_description="""Lightweight Bitcoin Wallet"""
)

setup.py
diff --git a/electrum.desktop b/electrum.desktop
index 20a0b1ee2db4..0ac2e3312113 100644
--- a/electrum.desktop
+++ b/electrum.desktop
@@ -6,7 +6,7 @@ Comment=Lightweight Bitcoin Client
 Exec=electrum %u
 GenericName[en_US]=Electrum
 GenericName=Electrum
-Icon=/usr/share/app-install/icons/electrum.png
+Icon=electrum
 Name[en_US]=Electrum Bitcoin Wallet
 Name=Electrum Bitcoin Wallet
 Categories=Network;
diff --git a/setup.py b/setup.py
index 21da71042304..c552621716b5 100644
--- a/setup.py
+++ b/setup.py
@@ -21,7 +21,7 @@
     usr_share = os.path.join(sys.prefix, "share")
     data_files += [
         (os.path.join(usr_share, 'applications/'), ['electrum.desktop']),
-        (os.path.join(usr_share, 'app-install', 'icons/'), ['icons/electrum.png'])
+        (os.path.join(usr_share, 'pixmaps/'), ['icons/electrum.png'])
     ]
 
 

Hardcoded icon path in launcher for GNU/Linux systems
Hi,

currently the icon path specified in the created _.desktop_ launcher file is set to: 
_Icon=/usr/share/app-install/icons/electrum.png_ 

(see https://github.com/spesmilo/electrum/blob/bc3013caf0d3d6a35290e9cc9e51125b7d03d14c/electrum.desktop)

This prevents icon theming without editing the launcher file.

I'd like to ask you to change the icon location as well as the icon path line in the launcher according to the freedesktop.org standards.

Please find more info here:
http://standards.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html
https://github.com/Foggalong/hardcode-fixer/wiki/What,-Why-&-How

---

According to the above resources standard icon locations are:

_/usr/share/icons/hicolor/[size]/apps/[icon name]_
_~/.local/share/icons/hicolor/[size]/apps/[icon name]_
_/usr/share/pixmaps/[icon name]_

The standard icon line in the .desktop launcher is:
_Icon=[icon name]_      (without full path, without file extension)

for instance
**Icon=electrum**  
(for an icon _electrum.svg_ or _electrum.png_ stored in standard location)

Could you please move the icon to one of those locations and adjust the icon path in the .desktop file accordingly?

