diff --git a/lib/indicator_sound_switcher/__init__.py b/lib/indicator_sound_switcher/__init__.py index dc0b595..ca95ed3 100644 --- a/lib/indicator_sound_switcher/__init__.py +++ b/lib/indicator_sound_switcher/__init__.py @@ -29,7 +29,7 @@ import fcntl import gettext -from .indicator import SoundSwitcherIndicator, APP_ID +from .indicator import SoundSwitcherIndicator, APP_ID, APP_NAME, APP_VERSION def _parse_cmd_line(): @@ -62,8 +62,8 @@ def main(): fcntl.lockf(fd, fcntl.LOCK_EX | fcntl.LOCK_NB) # Instantiate and run the indicator - logging.info('Starting indicator application') + logging.info('%s v%s', APP_NAME, APP_VERSION) SoundSwitcherIndicator().run() except OSError: - logging.info('Indicator is already running, exiting') + logging.info('%s is already running, exiting', APP_NAME) diff --git a/lib/indicator_sound_switcher/indicator.py b/lib/indicator_sound_switcher/indicator.py index 91736d3..6b66720 100644 --- a/lib/indicator_sound_switcher/indicator.py +++ b/lib/indicator_sound_switcher/indicator.py @@ -1,7 +1,7 @@ import os.path import logging import time -import pkg_resources +from importlib.metadata import version import gi @@ -38,7 +38,7 @@ with this program. If not, see http://www.gnu.org/licenses/""" # Determine app version -APP_VERSION = pkg_resources.require(APP_ID)[0].version +APP_VERSION = version(APP_ID) YESNO = {False: 'No', True: 'Yes'}