rename usages reverse-dns format
This commit is contained in:
parent
bcbb5a10d7
commit
b676dfe5fe
|
@ -60,7 +60,7 @@ def on_pre_break(break_obj):
|
|||
else:
|
||||
message += (_('Ready for a long break in %s seconds') % warning_time)
|
||||
|
||||
notification = Notify.Notification.new('Safe Eyes', message, icon='safeeyes_enabled')
|
||||
notification = Notify.Notification.new('Safe Eyes', message, icon='io.github.slgobinath.SafeEyes-enabled')
|
||||
try:
|
||||
notification.show()
|
||||
except BaseException:
|
||||
|
|
|
@ -68,7 +68,7 @@ class TrayIcon:
|
|||
|
||||
# Construct the tray icon
|
||||
self.indicator = appindicator.Indicator.new(
|
||||
APPINDICATOR_ID, "safeeyes_enabled", appindicator.IndicatorCategory.APPLICATION_STATUS)
|
||||
APPINDICATOR_ID, "io.github.slgobinath.SafeEyes-enabled", appindicator.IndicatorCategory.APPLICATION_STATUS)
|
||||
self.indicator.set_status(appindicator.IndicatorStatus.ACTIVE)
|
||||
|
||||
# Construct the context menu
|
||||
|
@ -77,7 +77,7 @@ class TrayIcon:
|
|||
# Next break info menu item
|
||||
self.item_info = Gtk.ImageMenuItem()
|
||||
img_timer = Gtk.Image()
|
||||
img_timer.set_from_icon_name("safeeyes_timer", 16)
|
||||
img_timer.set_from_icon_name("io.github.slgobinath.SafeEyes-timer", 16)
|
||||
self.item_info.set_image(img_timer)
|
||||
|
||||
self.item_separator = Gtk.SeparatorMenuItem()
|
||||
|
@ -206,18 +206,18 @@ class TrayIcon:
|
|||
if self.active:
|
||||
if self.date_time:
|
||||
self.__set_next_break_info()
|
||||
self.indicator.set_icon("safeeyes_enabled")
|
||||
self.indicator.set_icon("io.github.slgobinath.SafeEyes-enabled")
|
||||
else:
|
||||
if self.wakeup_time:
|
||||
self.item_info.set_label(_('Disabled until %s') % utility.format_time(self.wakeup_time))
|
||||
else:
|
||||
self.item_info.set_label(_('Disabled until restart'))
|
||||
self.indicator.set_label('', '')
|
||||
self.indicator.set_icon("safeeyes_disabled")
|
||||
self.indicator.set_icon("io.github.slgobinath.SafeEyes-disabled")
|
||||
else:
|
||||
self.item_info.set_label(_('No Breaks Available'))
|
||||
self.indicator.set_label('', '')
|
||||
self.indicator.set_icon("safeeyes_disabled")
|
||||
self.indicator.set_icon("io.github.slgobinath.SafeEyes-disabled")
|
||||
self.item_info.set_sensitive(breaks_found and self.active)
|
||||
self.item_enable.set_sensitive(breaks_found and not self.active)
|
||||
self.item_disable.set_sensitive(breaks_found and self.active)
|
||||
|
@ -360,7 +360,7 @@ class TrayIcon:
|
|||
if self.active:
|
||||
logging.info('Disable Safe Eyes')
|
||||
self.active = False
|
||||
self.indicator.set_icon("safeeyes_disabled")
|
||||
self.indicator.set_icon("io.github.slgobinath.SafeEyes-disabled")
|
||||
self.item_info.set_label(_('Disabled until restart'))
|
||||
self.indicator.set_label('', '')
|
||||
self.item_info.set_sensitive(False)
|
||||
|
@ -375,7 +375,7 @@ class TrayIcon:
|
|||
if not self.active:
|
||||
logging.info('Enable Safe Eyes')
|
||||
self.active = True
|
||||
self.indicator.set_icon("safeeyes_enabled")
|
||||
self.indicator.set_icon("io.github.slgobinath.SafeEyes-enabled")
|
||||
self.item_info.set_sensitive(True)
|
||||
self.item_enable.set_sensitive(False)
|
||||
self.item_disable.set_sensitive(True)
|
||||
|
@ -396,9 +396,9 @@ class TrayIcon:
|
|||
def start_animation(self):
|
||||
if not self.active or not self.animate:
|
||||
return
|
||||
utility.execute_main_thread(lambda: self.indicator.set_icon("safeeyes_disabled"))
|
||||
utility.execute_main_thread(lambda: self.indicator.set_icon("io.github.slgobinath.SafeEyes-disabled"))
|
||||
time.sleep(0.5)
|
||||
utility.execute_main_thread(lambda: self.indicator.set_icon("safeeyes_enabled"))
|
||||
utility.execute_main_thread(lambda: self.indicator.set_icon("io.github.slgobinath.SafeEyes-enabled"))
|
||||
if self.animate and self.active:
|
||||
time.sleep(0.5)
|
||||
if self.animate and self.active:
|
||||
|
@ -407,9 +407,9 @@ class TrayIcon:
|
|||
def stop_animation(self):
|
||||
self.animate = False
|
||||
if self.active:
|
||||
utility.execute_main_thread(lambda: self.indicator.set_icon("safeeyes_enabled"))
|
||||
utility.execute_main_thread(lambda: self.indicator.set_icon("io.github.slgobinath.SafeEyes-enabled"))
|
||||
else:
|
||||
utility.execute_main_thread(lambda: self.indicator.set_icon("safeeyes_disabled"))
|
||||
utility.execute_main_thread(lambda: self.indicator.set_icon("io.github.slgobinath.SafeEyes-disabled"))
|
||||
|
||||
def init(ctx, safeeyes_cfg, plugin_config):
|
||||
"""
|
||||
|
|
|
@ -62,7 +62,7 @@ LOG_FILE_PATH = os.path.join(HOME_DIRECTORY, 'safeeyes.log')
|
|||
SYSTEM_PLUGINS_DIR = os.path.join(BIN_DIRECTORY, 'plugins')
|
||||
USER_PLUGINS_DIR = os.path.join(CONFIG_DIRECTORY, 'plugins')
|
||||
LOCALE_PATH = os.path.join(BIN_DIRECTORY, 'config/locale')
|
||||
SYSTEM_DESKTOP_FILE = os.path.join(BIN_DIRECTORY, "platform/safeeyes.desktop")
|
||||
SYSTEM_DESKTOP_FILE = os.path.join(BIN_DIRECTORY, "platform/io.github.slgobinath.SafeEyes.desktop")
|
||||
SYSTEM_ICONS = os.path.join(BIN_DIRECTORY, "platform/icons")
|
||||
DESKTOP_ENVIRONMENT = None
|
||||
IS_WAYLAND = False
|
||||
|
@ -400,7 +400,7 @@ def create_startup_entry():
|
|||
Create start up entry.
|
||||
"""
|
||||
startup_dir_path = os.path.join(HOME_DIRECTORY, '.config/autostart')
|
||||
startup_entry = os.path.join(startup_dir_path, 'safeeyes.desktop')
|
||||
startup_entry = os.path.join(startup_dir_path, 'io.github.slgobinath.SafeEyes.desktop')
|
||||
|
||||
# Create the folder if not exist
|
||||
mkdir(startup_dir_path)
|
||||
|
@ -423,13 +423,13 @@ def initialize_platform():
|
|||
|
||||
applications_dir_path = os.path.join(HOME_DIRECTORY, '.local/share/applications')
|
||||
icons_dir_path = os.path.join(HOME_DIRECTORY, '.local/share/icons')
|
||||
desktop_entry = os.path.join(applications_dir_path, 'safeeyes.desktop')
|
||||
desktop_entry = os.path.join(applications_dir_path, 'io.github.slgobinath.SafeEyes.desktop')
|
||||
|
||||
# Create the folder if not exist
|
||||
mkdir(icons_dir_path)
|
||||
|
||||
# Create a desktop entry
|
||||
if not os.path.exists(os.path.join(sys.prefix, "share/applications/safeeyes.desktop")):
|
||||
if not os.path.exists(os.path.join(sys.prefix, "share/applications/io.github.slgobinath.SafeEyes.desktop")):
|
||||
# Create the folder if not exist
|
||||
mkdir(applications_dir_path)
|
||||
|
||||
|
|
22
setup.py
22
setup.py
|
@ -41,17 +41,17 @@ def __data_files():
|
|||
Collect the data files.
|
||||
"""
|
||||
root_dir = sys.prefix
|
||||
return [(os.path.join(root_dir, "share/applications"), ["safeeyes/platform/safeeyes.desktop"]),
|
||||
(os.path.join(root_dir, "share/icons/hicolor/24x24/status"), ["safeeyes/platform/icons/hicolor/24x24/status/safeeyes_disabled.png", "safeeyes/platform/icons/hicolor/24x24/status/safeeyes_enabled.png", "safeeyes/platform/icons/hicolor/24x24/status/safeeyes_timer.png"]),
|
||||
(os.path.join(root_dir, "share/icons/hicolor/24x24/apps"), ["safeeyes/platform/icons/hicolor/24x24/apps/safeeyes.png"]),
|
||||
(os.path.join(root_dir, "share/icons/hicolor/16x16/status"), ["safeeyes/platform/icons/hicolor/16x16/status/safeeyes_disabled.png", "safeeyes/platform/icons/hicolor/16x16/status/safeeyes_enabled.png", "safeeyes/platform/icons/hicolor/16x16/status/safeeyes_timer.png"]),
|
||||
(os.path.join(root_dir, "share/icons/hicolor/16x16/apps"), ["safeeyes/platform/icons/hicolor/16x16/apps/safeeyes.png"]),
|
||||
(os.path.join(root_dir, "share/icons/hicolor/32x32/status"), ["safeeyes/platform/icons/hicolor/32x32/status/safeeyes_disabled.png", "safeeyes/platform/icons/hicolor/32x32/status/safeeyes_enabled.png"]),
|
||||
(os.path.join(root_dir, "share/icons/hicolor/32x32/apps"), ["safeeyes/platform/icons/hicolor/32x32/apps/safeeyes.png"]),
|
||||
(os.path.join(root_dir, "share/icons/hicolor/64x64/apps"), ["safeeyes/platform/icons/hicolor/64x64/apps/safeeyes.png"]),
|
||||
(os.path.join(root_dir, "share/icons/hicolor/128x128/apps"), ["safeeyes/platform/icons/hicolor/128x128/apps/safeeyes.png"]),
|
||||
(os.path.join(root_dir, "share/icons/hicolor/48x48/status"), ["safeeyes/platform/icons/hicolor/48x48/status/safeeyes_disabled.png", "safeeyes/platform/icons/hicolor/48x48/status/safeeyes_enabled.png"]),
|
||||
(os.path.join(root_dir, "share/icons/hicolor/48x48/apps"), ["safeeyes/platform/icons/hicolor/48x48/apps/safeeyes.png"]),]
|
||||
return [(os.path.join(root_dir, "share/applications"), ["safeeyes/platform/io.github.slgobinath.SafeEyes.desktop"]),
|
||||
(os.path.join(root_dir, "share/icons/hicolor/24x24/status"), ["safeeyes/platform/icons/hicolor/24x24/status/io.github.slgobinath.SafeEyes-disabled.png", "safeeyes/platform/icons/hicolor/24x24/status/io.github.slgobinath.SafeEyes-enabled.png", "safeeyes/platform/icons/hicolor/24x24/status/io.github.slgobinath.SafeEyes-timer.png"]),
|
||||
(os.path.join(root_dir, "share/icons/hicolor/24x24/apps"), ["safeeyes/platform/icons/hicolor/24x24/apps/io.github.slgobinath.SafeEyes.png"]),
|
||||
(os.path.join(root_dir, "share/icons/hicolor/16x16/status"), ["safeeyes/platform/icons/hicolor/16x16/status/io.github.slgobinath.SafeEyes-disabled.png", "safeeyes/platform/icons/hicolor/16x16/status/io.github.slgobinath.SafeEyes-enabled.png", "safeeyes/platform/icons/hicolor/16x16/status/io.github.slgobinath.SafeEyes-timer.png"]),
|
||||
(os.path.join(root_dir, "share/icons/hicolor/16x16/apps"), ["safeeyes/platform/icons/hicolor/16x16/apps/io.github.slgobinath.SafeEyes.png"]),
|
||||
(os.path.join(root_dir, "share/icons/hicolor/32x32/status"), ["safeeyes/platform/icons/hicolor/32x32/status/io.github.slgobinath.SafeEyes-disabled.png", "safeeyes/platform/icons/hicolor/32x32/status/io.github.slgobinath.SafeEyes-enabled.png"]),
|
||||
(os.path.join(root_dir, "share/icons/hicolor/32x32/apps"), ["safeeyes/platform/icons/hicolor/32x32/apps/io.github.slgobinath.SafeEyes.png"]),
|
||||
(os.path.join(root_dir, "share/icons/hicolor/64x64/apps"), ["safeeyes/platform/icons/hicolor/64x64/apps/io.github.slgobinath.SafeEyes.png"]),
|
||||
(os.path.join(root_dir, "share/icons/hicolor/128x128/apps"), ["safeeyes/platform/icons/hicolor/128x128/apps/io.github.slgobinath.SafeEyes.png"]),
|
||||
(os.path.join(root_dir, "share/icons/hicolor/48x48/status"), ["safeeyes/platform/icons/hicolor/48x48/status/io.github.slgobinath.SafeEyes-disabled.png", "safeeyes/platform/icons/hicolor/48x48/status/io.github.slgobinath.SafeEyes-enabled.png"]),
|
||||
(os.path.join(root_dir, "share/icons/hicolor/48x48/apps"), ["safeeyes/platform/icons/hicolor/48x48/apps/io.github.slgobinath.SafeEyes.png"]),]
|
||||
|
||||
|
||||
def __package_files(directory):
|
||||
|
|
Loading…
Reference in New Issue