Skip to content

Commit

Permalink
Fixing AppIndicator icon in Ubuntu
Browse files Browse the repository at this point in the history
- Patched bsync-gui to tell libappindicator to look for the icon inside
  the appimage and not only in the system theme directories
- This closes #4
- Hopefully the patch can be removed when btsync-gui upstream adopts the
  related pull request
- Readme file had been updated to indicate Ubuntu 14.10 is now
  considered to be fully tested
  • Loading branch information
ifireball committed Feb 25, 2015
1 parent 2beb16f commit 4eacad0
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 5 deletions.
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,17 @@ The built AppImage will include the GUI created for the
## Compatibility

The AppImage is (hopefully) built in such a way that would enable it to run on
many Linux distributions. That being said, it had only been tested on Fedora 20
so far.
many Linux distributions. That being said, it had only been tested on the
following OSes so far:

- Fedora 20
- Ubuntu 14.10

The binary downloadable AppImage was also tested and shown not to run on the
following OSes. It is quite likely that running the build system on thos OSes
will result in a working AppImage for them:

- RHEL/CentOS 6.x

Binary components included in the AppImage are currtly compatible only with
64bit intel-based processors (x86-64). Patches to add components for other
Expand Down
30 changes: 30 additions & 0 deletions btsync_deb_appindicator_path.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
diff --git a/btsync-gui/trayindicator.py b/btsync-gui/trayindicator.py
index a205cee..e29a0bd 100644
--- a/btsync-gui/trayindicator.py
+++ b/btsync-gui/trayindicator.py
@@ -22,6 +22,9 @@
#

import logging
+from os import environ
+from os.path import join as path_join
+from os.path import isdir

from gi.repository import Gtk, GObject

@@ -47,6 +50,15 @@ class TrayIndicator:
icon_name,
AppIndicator.IndicatorCategory.APPLICATION_STATUS
)
+ # Try to make AppIndicator respect weird paths in XDG_DATA_DIRS
+ for p in environ.get('XDG_DATA_DIRS','').split(':'):
+ if p in ('/usr/share', '/usr/local/share'):
+ continue
+ ip = path_join(p, 'icons')
+ if not isdir(ip):
+ continue
+ self.indicator.set_icon_theme_path(ip)
+ break
if attention_icon_name is None:
self.indicator.set_attention_icon(icon_name)
else:
10 changes: 7 additions & 3 deletions pavement.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ def __init__(self, tag='btsync-1.4.1-1', workdir=WORK_DIR):
tag, workdir=workdir)
self.gui_path = self.extract_path / 'btsync-gui'
self.install_file = self.gui_path / 'debian' / 'btsync-gui-gtk.install'
self.patch = path('btsync_deb_appindicator_path.patch')

class QREncode(Package):
def __init__(self, version='3.4.4', workdir=WORK_DIR):
Expand Down Expand Up @@ -186,8 +187,8 @@ def get_appimagekit_src():

@task
@needs('get_btsync_deb_src')
def build_btsync_gui_locales():
"""Build the BySync GUI locale files"""
def build_btsync_gui():
"""Build the BySync GUI"""
btsd=BTSyncDeb()
locdir = btsd.gui_path / 'locale'
locdir.mkdir(DIR_MODE)
Expand All @@ -197,6 +198,9 @@ def build_btsync_gui_locales():
dstdir = dstdir / sd
dstdir.mkdir(DIR_MODE)
sh("msgfmt -c '%s' -o '%s'" % (pofile, dstdir / 'btsync-gu.mo'))
patchabs = btsd.patch.abspath()
with pushd(btsd.extract_path):
sh("patch -p1 < '%s'" % (patchabs))

@task
@needs('get_qrencode_src')
Expand Down Expand Up @@ -250,7 +254,7 @@ def build_appimagekit():
sh('make AppImageAssistant')

@task
@needs('build_btsync_gui_locales')
@needs('build_btsync_gui')
def install_btsync_gui():
"""Install the BTSync GUI files to the AppDir"""
btsd=BTSyncDeb()
Expand Down

0 comments on commit 4eacad0

Please sign in to comment.