main
Micke Nordin 4 years ago
parent 50f410a2c8
commit a28e4e1319

@ -8,30 +8,32 @@ ingredients:
script: script:
- wget -c https://github.com/mickenordin/wireguide/blob/main/wireguide/logo.png -O ke.mic.wireguide.png - wget -c https://github.com/mickenordin/wireguide/blob/main/wireguide/logo.png -O ke.mic.wireguide.png
- wget -c https://github.com/mickenordin/wireguide/blob/main/appimage/wireguide.appdata.xml -O wireguide.appdata.xml - wget -c https://github.com/mickenordin/wireguide/blob/main/appimage/wireguide.appdata.xml -O wireguide.appdata.xml
- wget -c https://github.com/mickenordin/wireguide/blob/main/wireguide/wireguide -O wireguide
packages: packages:
- python3-pip
- python3-gi - python3-gi
- python3-wxgtk4.0 - python3-wxgtk4.0
- python3-sip - python3-sip
- libnm0 - libnm0
- gir1.2-nm-1.0 - gir1.2-nm-1.0
script: script:
- ./usr/bin/pip3 install WireGUIde==0.0.7
- cp ../ke.mic.wireguide.png ./usr/share/icons/hicolor/256x256/ - cp ../ke.mic.wireguide.png ./usr/share/icons/hicolor/256x256/
- cp ../ke.mic.wireguide.png . - cp ../ke.mic.wireguide.png .
- mkdir -p usr/share/metainfo/ ; cp ../wireguide.appdata.xml usr/share/metainfo/ - mkdir -p usr/share/metainfo/
- cat > usr/share/applications/ke.mic.wireguide.desktop <<\EOF - cp ../wireguide.appdata.xml ./usr/share/metainfo/
- cp ../wireguide ./usr/bin/
- chmod +x ./usr/bin/wireguide
- cat > ./usr/share/applications/ke.mic.wireguide.desktop <<\EOF
- [Desktop Entry] - [Desktop Entry]
- Type=Application - Type=Application
- Name=WireGUIde - Name=WireGUIde
- Comment=A GUI for WireGuard - Comment=A GUI for WireGuard
- Icon=ke.mic.wireguide - Icon=ke.mic.wireguide
- Exec=python3 /usr/local/bin/wireguide - Exec=usr/bin/wireguide
- Terminal=false - Terminal=false
- Categories=Application; - Categories=Application;
- Keywords=Python; - Keywords=Python;
- MimeType=text/x-python3; - MimeType=text/x-python3;
- EOF - EOF
- cp usr/share/applications/ke.mic.wireguide.desktop . - cp usr/share/applications/ke.mic.wireguide.desktop .
- usr/bin/pip3 freeze | grep "wireguide" | cut -d "=" -f 3 >> ../VERSION - grep self.version ../wireguide | grep = | awk '{print $3}' | sed 's/"//g' > ../VERSION

@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
setuptools.setup( setuptools.setup(
name="wireguide", name="wireguide",
version="0.0.7", version="0.0.8",
author="Mikael Nordin", author="Mikael Nordin",
author_email="mik@elnord.in", author_email="mik@elnord.in",
description="A WireGuard GUI for GNU/Linux", description="A WireGuard GUI for GNU/Linux",

@ -23,8 +23,10 @@ class WireFrame(wx.Frame): # pylint: disable=too-many-ancestors,too-many-instan
""" """
def __init__(self, *args, **kw): def __init__(self, *args, **kw):
super().__init__(*args, **kw) super().__init__(*args, **kw)
self.SetIcon(wx.Icon(get_logo_path())) icon = get_logo_path()
self.version = "0.0.7" if icon:
self.SetIcon(wx.Icon(icon))
self.version = "0.0.8"
# Get active conns from NetworkManager # Get active conns from NetworkManager
self.client = NM.Client.new(None) self.client = NM.Client.new(None)
@ -396,13 +398,18 @@ def get_logo_path():
Try to find a logo Try to find a logo
""" """
site_packages = next(p for p in sys.path if 'site-packages' in p) site_packages = next(p for p in sys.path if 'site-packages' in p)
base_path = os.path.dirname(__file__) #
logo_name = "logo.png" logo_name = "logo.png"
image = site_packages + "/wireguide/" + logo_name pipimage = site_packages + "/wireguide/" + logo_name
appimage = base_path + "/../share/icons/hicolor/256x256/ke.mic.wireguide.png"
fallback = base_path + "/" + logo_name
ret = None ret = None
if os.path.isfile(image): if os.path.isfile(pipimage):
ret = image ret = pipimage
elif os.path.isfile(logo_name): elif os.path.isfile(appimage):
ret = logo_name ret = appimage
elif os.path.isfile(fallback):
ret = fallback
return ret return ret

Loading…
Cancel
Save