mirror of
https://github.com/captn3m0/hackertray.git
synced 2024-09-11 16:46:37 +00:00
Fixes icon issues completely.
-Refers #11 - No longer searches in different places for the icon - Sets title of GtkStatusIcon for accessibility - Uses hackertray.data to package the image file - Bumps version to 1.9 Signed-off-by: Abhay Rana <capt.n3m0@gmail.com>
This commit is contained in:
parent
4a604c1527
commit
389da396f4
@ -1 +1 @@
|
||||
include images/hacker-tray.png
|
||||
include hackertray/data/hacker-tray.png
|
@ -16,6 +16,8 @@ import gobject
|
||||
import os
|
||||
import sys
|
||||
|
||||
from pkg_resources import resource_filename
|
||||
|
||||
# Types
|
||||
CATEGORY_APPLICATION_STATUS = 0
|
||||
|
||||
@ -24,25 +26,11 @@ STATUS_ACTIVE = 0
|
||||
STATUS_ATTENTION = 1
|
||||
|
||||
# Locations to search for the given icon
|
||||
search_locations = [ os.path.join(os.path.dirname(sys.executable), "images"),
|
||||
os.path.join(os.path.dirname(__file__), "images"),
|
||||
os.path.join(os.path.dirname(__file__), "../images"),
|
||||
'/usr/share/pixmaps' ]
|
||||
|
||||
def get_icon_filename(icon_name):
|
||||
|
||||
# Determine where the icon is
|
||||
global search_locations
|
||||
|
||||
for folder in search_locations:
|
||||
|
||||
filename = os.path.join(folder, icon_name + ".png")
|
||||
|
||||
if os.path.isfile(filename):
|
||||
return filename
|
||||
|
||||
return None
|
||||
|
||||
return os.path.abspath(resource_filename('hackertray.data', 'hacker-tray.png'))
|
||||
|
||||
# The main class
|
||||
class Indicator:
|
||||
@ -84,6 +72,7 @@ class Indicator:
|
||||
self.icon.set_from_file(self.active_icon)
|
||||
|
||||
def set_label(self, label):
|
||||
self.icon.set_title(label)
|
||||
return
|
||||
|
||||
def set_icon(self, icon):
|
||||
|
0
hackertray/data/__init__.py
Normal file
0
hackertray/data/__init__.py
Normal file
Before Width: | Height: | Size: 958 B After Width: | Height: | Size: 958 B |
13
setup.py
13
setup.py
@ -1,4 +1,5 @@
|
||||
from setuptools import setup
|
||||
from setuptools import find_packages
|
||||
import sys
|
||||
|
||||
requirements = ['requests']
|
||||
@ -6,7 +7,7 @@ if sys.version_info < (2, 7):
|
||||
requirements.append('argparse')
|
||||
|
||||
setup(name='hackertray',
|
||||
version='1.8.3',
|
||||
version='1.9',
|
||||
description='Hacker News app that sits in your System Tray',
|
||||
long_description='HackerTray is a simple Hacker News Linux application that lets you view top HN stories in your System Tray. It relies on appindicator, so it is not guaranteed to work on all systems. It also provides a Gtk StatusIcon fallback in case AppIndicator is not available.',
|
||||
keywords='hacker news hn tray system tray icon hackertray',
|
||||
@ -14,12 +15,14 @@ setup(name='hackertray',
|
||||
author='Abhay Rana',
|
||||
author_email='me@captnemo.in',
|
||||
license='MIT',
|
||||
packages=['hackertray'],
|
||||
data_files=[('images', ['images/hacker-tray.png'])],
|
||||
packages=find_packages(),
|
||||
package_data={
|
||||
'hackertray.data':['hacker-tray.png']
|
||||
},
|
||||
install_requires=[
|
||||
'requests',
|
||||
'requests',
|
||||
],
|
||||
entry_points={
|
||||
'console_scripts': ['hackertray = hackertray:main'],
|
||||
'console_scripts': ['hackertray = hackertray:main'],
|
||||
},
|
||||
zip_safe=False)
|
||||
|
Loading…
Reference in New Issue
Block a user