From bd51aed7240d3def1f87398a2ba6288871a45854 Mon Sep 17 00:00:00 2001 From: undefiened Date: Sun, 28 May 2023 13:54:09 +0200 Subject: [PATCH 01/29] Added plugin for limiting the number of consecutive skips or postpones --- .../locale/en_US/LC_MESSAGES/safeeyes.po | 16 +++ safeeyes/core.py | 4 + .../limitconsecutiveskipping/config.json | 23 +++++ .../limitconsecutiveskipping/plugin.py | 99 +++++++++++++++++++ safeeyes/ui/break_screen.py | 7 +- 5 files changed, 147 insertions(+), 2 deletions(-) create mode 100644 safeeyes/plugins/limitconsecutiveskipping/config.json create mode 100644 safeeyes/plugins/limitconsecutiveskipping/plugin.py diff --git a/safeeyes/config/locale/en_US/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/en_US/LC_MESSAGES/safeeyes.po index ac8eabb5..9d9c2e04 100644 --- a/safeeyes/config/locale/en_US/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/en_US/LC_MESSAGES/safeeyes.po @@ -500,3 +500,19 @@ msgstr "Pause media" # plugin/healthstats #~ msgid "Interval to reset statistics (in hours)" #~ msgstr "Interval to reset statistics (in hours)" + +# plugin/limitconsecutiveskipping +msgid "Limit Consecutive Skipping" +msgstr "Limit Consecutive Skipping" + +# plugin/limitconsecutiveskipping +msgid "How many skips or postpones are allowed in a row" +msgstr "How many skips or postpones are allowed in a row" + +# plugin/limitconsecutiveskipping +msgid "Limit how many breaks can be skipped or postponed in a row" +msgstr "Limit how many breaks can be skipped or postponed in a row" + +# plugin/limitconsecutiveskipping +msgid "Skipped or postponed %d/%d breaks in a row" +msgstr "Skipped or postponed %d/%d breaks in a row" \ No newline at end of file diff --git a/safeeyes/core.py b/safeeyes/core.py index 00a7f980..b152065f 100644 --- a/safeeyes/core.py +++ b/safeeyes/core.py @@ -67,6 +67,8 @@ def __init__(self, context): self.context = context self.context['skipped'] = False self.context['postponed'] = False + self.context['skip_button_disabled'] = False + self.context['postpone_button_disabled'] = False self.context['state'] = State.WAITING def initialize(self, config): @@ -288,6 +290,8 @@ def __fire_stop_break(self): # Reset the skipped flag self.context['skipped'] = False + self.context['skip_button_disabled'] = False + self.context['postpone_button_disabled'] = False self.__start_next_break() def __wait_for(self, duration): diff --git a/safeeyes/plugins/limitconsecutiveskipping/config.json b/safeeyes/plugins/limitconsecutiveskipping/config.json new file mode 100644 index 00000000..fc775b40 --- /dev/null +++ b/safeeyes/plugins/limitconsecutiveskipping/config.json @@ -0,0 +1,23 @@ +{ + "meta": { + "name": "Limit Consecutive Skipping", + "description": "Limit how many breaks can be skipped or postponed in a row", + "version": "0.0.1" + }, + "dependencies": { + "python_modules": [], + "shell_commands": [], + "operating_systems": [], + "desktop_environments": [], + "resources": [] + }, + "settings": [{ + "id": "number_of_allowed_skips_in_a_row", + "label": "How many skips or postpones are allowed in a row", + "type": "INT", + "default": 2, + "min": 1, + "max": 100 + }], + "break_override_allowed": true +} \ No newline at end of file diff --git a/safeeyes/plugins/limitconsecutiveskipping/plugin.py b/safeeyes/plugins/limitconsecutiveskipping/plugin.py new file mode 100644 index 00000000..352f9455 --- /dev/null +++ b/safeeyes/plugins/limitconsecutiveskipping/plugin.py @@ -0,0 +1,99 @@ +#!/usr/bin/env python +# Safe Eyes is a utility to remind you to take break frequently +# to protect your eyes from eye strain. + +# Copyright (C) 2017 Gobinath + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +""" +Show health statistics on the break screen. +""" + +import logging + +context = None +no_of_skipped_breaks = 0 +session = None +enabled = True + +def init(ctx, safeeyes_config, plugin_config): + """ + Initialize the plugin. + """ + global enabled + global context + global session + global no_of_skipped_breaks + global no_allowed_skips + + logging.debug('Initialize Limit consecutive skipping plugin') + context = ctx + + no_allowed_skips = plugin_config.get('number_of_allowed_skips_in_a_row', 2) + + if session is None: + # Read the session + session = context['session']['plugin'].get('limitconsecutiveskipping', None) + if session is None: + session = {'no_of_skipped_breaks': 0} + context['session']['plugin']['limitconsecutiveskipping'] = session + no_of_skipped_breaks = session.get('no_of_skipped_breaks', 0) + + +def on_stop_break(): + """ + After the break, check if it is skipped. + """ + # Check if the plugin is enabled + if not enabled: + return + + global no_of_skipped_breaks + if context['skipped'] or context['postponed']: + no_of_skipped_breaks += 1 + session['no_of_skipped_breaks'] = no_of_skipped_breaks + else: + no_of_skipped_breaks = 0 + session['no_of_skipped_breaks'] = no_of_skipped_breaks + + +def on_start_break(break_obj): + logging.debug('Skipped / allowed = {} / {}'.format(no_of_skipped_breaks, no_allowed_skips)) + + if no_of_skipped_breaks >= no_allowed_skips: + context['postpone_button_disabled'] = True + context['skip_button_disabled'] = True + + +def get_widget_title(break_obj): + """ + Return the widget title. + """ + # Check if the plugin is enabled + if not enabled: + return "" + + return _('Limit Consecutive Skipping') + + +def get_widget_content(break_obj): + """ + Return the statistics. + """ + # Check if the plugin is enabled + if not enabled: + return "" + + return _('Skipped or postponed %d/%d breaks in a row') % (no_of_skipped_breaks, no_allowed_skips) + diff --git a/safeeyes/ui/break_screen.py b/safeeyes/ui/break_screen.py index 873c6ef9..17f23445 100644 --- a/safeeyes/ui/break_screen.py +++ b/safeeyes/ui/break_screen.py @@ -155,6 +155,9 @@ def __show_break_screen(self, message, image_path, widget, tray_actions): no_of_monitors = screen.get_n_monitors() logging.info("Show break screens in %d display(s)", no_of_monitors) + skip_button_disabled = self.context.get('skip_button_disabled', False) + postpone_button_disabled = self.context.get('postpone_button_disabled', False) + for monitor in range(no_of_monitors): monitor_gemoetry = screen.get_monitor_geometry(monitor) x = monitor_gemoetry.x @@ -186,7 +189,7 @@ def __show_break_screen(self, message, image_path, widget, tray_actions): toolbar_button.show() # Add the buttons - if self.enable_postpone: + if self.enable_postpone and not postpone_button_disabled: # Add postpone button btn_postpone = Gtk.Button(_('Postpone')) btn_postpone.get_style_context().add_class('btn_postpone') @@ -194,7 +197,7 @@ def __show_break_screen(self, message, image_path, widget, tray_actions): btn_postpone.set_visible(True) box_buttons.pack_start(btn_postpone, True, True, 0) - if not self.strict_break: + if not self.strict_break and not skip_button_disabled: # Add the skip button btn_skip = Gtk.Button(_('Skip')) btn_skip.get_style_context().add_class('btn_skip') From 3428759a85cbf9d0182b0df92d28c35b8d34e41d Mon Sep 17 00:00:00 2001 From: undefiened Date: Sun, 28 May 2023 21:07:55 +0200 Subject: [PATCH 02/29] Fixed comment --- safeeyes/plugins/limitconsecutiveskipping/plugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/safeeyes/plugins/limitconsecutiveskipping/plugin.py b/safeeyes/plugins/limitconsecutiveskipping/plugin.py index 352f9455..92215671 100644 --- a/safeeyes/plugins/limitconsecutiveskipping/plugin.py +++ b/safeeyes/plugins/limitconsecutiveskipping/plugin.py @@ -17,7 +17,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . """ -Show health statistics on the break screen. +Limit how many breaks can be skipped or postponed in a row. """ import logging From bc7ae6312009f304e79dd220c52905ea0981465d Mon Sep 17 00:00:00 2001 From: undefiened Date: Sun, 9 Jul 2023 00:59:20 +0200 Subject: [PATCH 03/29] Added an icon --- .../plugins/limitconsecutiveskipping/icon.png | Bin 0 -> 959 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 safeeyes/plugins/limitconsecutiveskipping/icon.png diff --git a/safeeyes/plugins/limitconsecutiveskipping/icon.png b/safeeyes/plugins/limitconsecutiveskipping/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..c104d9d2d1c6bff461c999d519dee2bff2f8f5ae GIT binary patch literal 959 zcmV;w13>(VP)|sbkkz8suR!f`uM*N4v@`?_QA=M# z|3R%mYe5hcK}1`7UrWgCJt`QX=W_1*<2mPfIp;ZG59hUl*)ax%V#$ckg?vl#WuNm6 zCocN&GMdm#eI^nK({_A6U{m!zsCu>E*K%~H(xwJBm++*f8ztds;qXRDSG*(Kr{xkU z;bY-|AqNz`QF^k@uZpvE{#0zlqO)LEJ$>0foczOD&L{|v2>T29ver0{x`{hoTwIVk zAaf9tD077Hk)+HTc}fJO7A3RRzOkBbo^|nP^4F>n)(ubx2gG$z_SGx*G(bv{3?%I2= zwf0E}xm7jpN+A(W-MS8i$~>nZwEeD~7vXRn-r*eTz?m}eGzL1kXauL~#hY>7ML)sz z9&Zhllm}RZa!3MO6%01u9tI%~blNtM<{=qg;SGE;r%-zg4Pb9l%Xklr-4gvgo2zvhm6M(X@wHv_QINSwp)6X5F-R%vC`u_%^UZ#Cn+W8TCLbD3O8JX8sHm_c%}$ zg-H)0mNHpv2iaY~3q-1riB3oZ-72cgm4jL({{U_vXkBwE5<5o>zpwSx;YUU;rI3YU zW6|zBIM6Q$MAn@=I^R!okTHL^*E7EUI|B_(<`a@;7kg`9LTvIl_^cS|C33w hlC=z%Fas;#M4w`7jJmx}C4B$@002ovPDHLkV1fjSuSEa= literal 0 HcmV?d00001 From a54c16476e98a2395e18a74b440f6e40b23c1ae8 Mon Sep 17 00:00:00 2001 From: undefiened Date: Sun, 9 Jul 2023 01:17:08 +0200 Subject: [PATCH 04/29] Removed copyright --- safeeyes/plugins/limitconsecutiveskipping/plugin.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/safeeyes/plugins/limitconsecutiveskipping/plugin.py b/safeeyes/plugins/limitconsecutiveskipping/plugin.py index 92215671..a306a988 100644 --- a/safeeyes/plugins/limitconsecutiveskipping/plugin.py +++ b/safeeyes/plugins/limitconsecutiveskipping/plugin.py @@ -1,9 +1,4 @@ #!/usr/bin/env python -# Safe Eyes is a utility to remind you to take break frequently -# to protect your eyes from eye strain. - -# Copyright (C) 2017 Gobinath - # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or From a33235b11bbf1a0e6a9d247c31188e708a630624 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anton=C3=ADn=20K=C5=99=C3=AD=C5=BE?= <15214494+antoninkriz@users.noreply.github.com> Date: Mon, 13 Nov 2023 16:01:57 +0100 Subject: [PATCH 05/29] Correctly detect all possible GNOME sessions in screen saver plugin lock feature and in utility.py --- safeeyes/plugins/screensaver/plugin.py | 2 +- safeeyes/utility.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/safeeyes/plugins/screensaver/plugin.py b/safeeyes/plugins/screensaver/plugin.py index 0165b63b..e8e5e3b9 100644 --- a/safeeyes/plugins/screensaver/plugin.py +++ b/safeeyes/plugins/screensaver/plugin.py @@ -64,7 +64,7 @@ def __lock_screen_command(): return ['mate-screensaver-command', '--lock'] elif desktop_session == 'kde' or 'plasma' in desktop_session or desktop_session.startswith('kubuntu') or os.environ.get('KDE_FULL_SESSION') == 'true': return ['qdbus', 'org.freedesktop.ScreenSaver', '/ScreenSaver', 'Lock'] - elif desktop_session in ['gnome', 'unity', 'budgie-desktop'] or desktop_session.startswith('ubuntu'): + elif desktop_session in ['gnome', 'unity', 'budgie-desktop'] or desktop_session.startswith('ubuntu') or desktop_session.startswith('gnome'): if utility.command_exist('gnome-screensaver-command'): return ['gnome-screensaver-command', '--lock'] # From Gnome 3.8 no gnome-screensaver-command diff --git a/safeeyes/utility.py b/safeeyes/utility.py index e145d4dc..f91e62bb 100644 --- a/safeeyes/utility.py +++ b/safeeyes/utility.py @@ -287,7 +287,7 @@ def desktop_environment(): env = 'lxde' elif 'plasma' in desktop_session or desktop_session.startswith('kubuntu') or os.environ.get('KDE_FULL_SESSION') == 'true': env = 'kde' - elif os.environ.get('GNOME_DESKTOP_SESSION_ID'): + elif os.environ.get('GNOME_DESKTOP_SESSION_ID') or desktop_session.startswith('gnome'): env = 'gnome' elif desktop_session.startswith('ubuntu'): env = 'unity' From d93b0480f033a2f7456fd35d03eaf65f22b52676 Mon Sep 17 00:00:00 2001 From: Tero Paloheimo Date: Sat, 30 Dec 2023 19:55:25 +0200 Subject: [PATCH 06/29] Add dbus-python to required dependencies SafeEyes does not start without dbus-python and therefore it is added to required dependencies in setup.py. --- README.md | 2 +- setup.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6f9d1606..29d7f523 100644 --- a/README.md +++ b/README.md @@ -140,7 +140,7 @@ Some Linux systems like Cent OS do not have matching dependencies available in t pip3 install virtualenv --user virtualenv --no-site-packages venv source venv/bin/activate - pip3 install dbus-python safeeyes + pip3 install safeeyes ``` 3. Start Safe Eyes from terminal diff --git a/setup.py b/setup.py index c7bc490f..934f927e 100644 --- a/setup.py +++ b/setup.py @@ -7,6 +7,7 @@ 'babel', 'psutil', 'croniter', + 'dbus-python', 'PyGObject', 'python-xlib' ] From e995446cfcb2c1557dce7e56eee0aa85a1792455 Mon Sep 17 00:00:00 2001 From: Tero Paloheimo Date: Sat, 30 Dec 2023 20:01:40 +0200 Subject: [PATCH 07/29] Fix some typos --- safeeyes/plugins/healthstats/plugin.py | 2 +- safeeyes/plugins/notification/plugin.py | 2 +- safeeyes/rpc.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/safeeyes/plugins/healthstats/plugin.py b/safeeyes/plugins/healthstats/plugin.py index e1cae38a..126c1c86 100644 --- a/safeeyes/plugins/healthstats/plugin.py +++ b/safeeyes/plugins/healthstats/plugin.py @@ -78,7 +78,7 @@ def on_start_break(break_obj): global session session['breaks'] += 1 - # Screen time has stoped. + # Screen time has stopped. on_stop() diff --git a/safeeyes/plugins/notification/plugin.py b/safeeyes/plugins/notification/plugin.py index ed4a0e8f..b7920fbb 100644 --- a/safeeyes/plugins/notification/plugin.py +++ b/safeeyes/plugins/notification/plugin.py @@ -84,7 +84,7 @@ def on_start_break(break_obj): def on_exit(): """ - Uninitialize the registered notificaion. + Uninitialize the registered notification. """ logging.debug('Stop Notification plugin') Notify.uninit() diff --git a/safeeyes/rpc.py b/safeeyes/rpc.py index ebb3686b..abe36295 100644 --- a/safeeyes/rpc.py +++ b/safeeyes/rpc.py @@ -28,7 +28,7 @@ class RPCServer: """ - An aynchronous RPC server. + An asynchronous RPC server. """ def __init__(self, port, context): self.__running = False From 2786f55c8a3ae8c6cb25615fd8166bcbfbbf904c Mon Sep 17 00:00:00 2001 From: Ryan Hendrickson Date: Wed, 24 Apr 2024 03:02:35 -0400 Subject: [PATCH 08/29] donotdisturb: fix for GNOME --- .../donotdisturb/dependency_checker.py | 2 ++ safeeyes/plugins/donotdisturb/plugin.py | 36 +++++++++++++++++-- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/safeeyes/plugins/donotdisturb/dependency_checker.py b/safeeyes/plugins/donotdisturb/dependency_checker.py index 293baa36..600cb2bf 100644 --- a/safeeyes/plugins/donotdisturb/dependency_checker.py +++ b/safeeyes/plugins/donotdisturb/dependency_checker.py @@ -22,6 +22,8 @@ def validate(plugin_config, plugin_settings): command = None if utility.IS_WAYLAND: + if utility.DESKTOP_ENVIRONMENT == "gnome": + return None command = "wlrctl" else: command = "xprop" diff --git a/safeeyes/plugins/donotdisturb/plugin.py b/safeeyes/plugins/donotdisturb/plugin.py index 5d179904..0fdefa5c 100644 --- a/safeeyes/plugins/donotdisturb/plugin.py +++ b/safeeyes/plugins/donotdisturb/plugin.py @@ -30,6 +30,7 @@ gi.require_version('Gdk', '3.0') from gi.repository import Gdk from gi.repository import GdkX11 # noqa F401 +from gi.repository import Gio from safeeyes import utility context = None @@ -96,6 +97,31 @@ def is_active_window_skipped_xorg(pre_break): return False +def is_idle_inhibited_gnome(): + """ + GNOME Shell doesn't work with wlrctl, and there is no way to enumerate + fullscreen windows, but GNOME does expose whether idle actions like + starting a screensaver are inhibited, which is a close approximation if + not a better metric. + """ + + dbus_proxy = Gio.DBusProxy.new_for_bus_sync( + bus_type=Gio.BusType.SESSION, + flags=Gio.DBusProxyFlags.NONE, + info=None, + name='org.gnome.SessionManager', + object_path='/org/gnome/SessionManager', + interface_name='org.gnome.SessionManager', + cancellable=None, + ) + result = dbus_proxy.get_cached_property('InhibitedActions').unpack() + + # The result is a bitfield, documented here: + # https://gitlab.gnome.org/GNOME/gnome-session/-/blob/9aa419397b7f6d42bee6e66cc5c5aad12902fba0/gnome-session/org.gnome.SessionManager.xml#L155 + # The fourth bit indicates that idle is inhibited. + return bool(result & 0b1000) + + def _window_class_matches(window_class: str, classes: list) -> bool: return any(map(lambda w: w in classes, window_class.split())) @@ -149,7 +175,10 @@ def on_pre_break(break_obj): Lifecycle method executes before the pre-break period. """ if utility.IS_WAYLAND: - skip_break = is_active_window_skipped_wayland(True) + if utility.DESKTOP_ENVIRONMENT == 'gnome': + skip_break = is_idle_inhibited_gnome() + else: + skip_break = is_active_window_skipped_wayland(True) else: skip_break = is_active_window_skipped_xorg(True) if dnd_while_on_battery and not skip_break: @@ -162,7 +191,10 @@ def on_start_break(break_obj): Lifecycle method executes just before the break. """ if utility.IS_WAYLAND: - skip_break = is_active_window_skipped_wayland(True) + if utility.DESKTOP_ENVIRONMENT == 'gnome': + skip_break = is_idle_inhibited_gnome() + else: + skip_break = is_active_window_skipped_wayland(True) else: skip_break = is_active_window_skipped_xorg(True) if dnd_while_on_battery and not skip_break: From e087e8b94e0be3449d72e1b055478db5f026a5a7 Mon Sep 17 00:00:00 2001 From: Tero Paloheimo Date: Sat, 30 Dec 2023 20:07:42 +0200 Subject: [PATCH 09/29] Remove build.sh build.sh has been replaced by GitHub actions and is therefore removed. --- build.sh | 8 -------- 1 file changed, 8 deletions(-) delete mode 100755 build.sh diff --git a/build.sh b/build.sh deleted file mode 100755 index 84745960..00000000 --- a/build.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -rm -rf build/ dist/ safeeyes.egg-info/ .eggs/ - -python3 setup.py sdist bdist_wheel -twine upload --repository pypitest dist/safeeyes*.tar.gz -clear >$(tty) -twine upload --repository pypitest dist/safeeyes*.whl \ No newline at end of file From 5c0884facbbbf622f2628beaabc4a7de09cff80f Mon Sep 17 00:00:00 2001 From: Tero Paloheimo Date: Sat, 30 Dec 2023 19:42:32 +0200 Subject: [PATCH 10/29] Remove use of distutils As of Python 3.12 setuptools is no longer installed by default and if setuptools is not installed distutils is not found and SafeEyes fails to start. Furthermore distutils is deprecated and should thus not be used anymore. The packaging module provides a replacement for LooseVersion and it is also recommended by PEP 632 [1]. Also update required Python version for Debian to 3.12 or newer. [1] https://peps.python.org/pep-0632/#migration-advice --- debian/control | 6 +++--- safeeyes/model.py | 5 +++-- safeeyes/utility.py | 4 ++-- setup.py | 1 + 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/debian/control b/debian/control index 33a81af7..246f29ed 100644 --- a/debian/control +++ b/debian/control @@ -2,14 +2,14 @@ Source: safeeyes Section: utils Priority: optional Maintainer: Gobinath Loganathan -Build-Depends: debhelper (>= 10), dh-python, python3, python3-setuptools +Build-Depends: debhelper (>= 10), dh-python, python3, python3-packaging Standards-Version: 3.9.6 -X-Python3-Version: >= 3.5 +X-Python3-Version: >= 3.12 Homepage: https://github.com/slgobinath/SafeEyes/ Package: safeeyes Architecture: all -Depends: ${misc:Depends}, ${python3:Depends}, gir1.2-ayatanaappindicator3-0.1, python3 (>= 3.5.0), python3-xlib, python3-dbus, gir1.2-notify-0.7, python3-babel, x11-utils, xprintidle, alsa-utils, python3-psutil, python3-croniter +Depends: ${misc:Depends}, ${python3:Depends}, gir1.2-ayatanaappindicator3-0.1, python3 (>= 3.12.0), python3-xlib, python3-dbus, gir1.2-notify-0.7, python3-babel, x11-utils, xprintidle, alsa-utils, python3-psutil, python3-croniter Description: Safe Eyes Safe Eyes is a simple tool to remind you to take periodic breaks for your eyes. This is essential for anyone spending more time on the computer to avoid eye strain and other physical problems. . diff --git a/safeeyes/model.py b/safeeyes/model.py index 453761df..c43dc570 100644 --- a/safeeyes/model.py +++ b/safeeyes/model.py @@ -22,9 +22,10 @@ import logging import random -from distutils.version import LooseVersion from enum import Enum +from packaging.version import parse + from safeeyes import utility @@ -323,7 +324,7 @@ def __init__(self, init=True): else: user_config_version = str( meta_obj.get('config_version', '0.0.0')) - if LooseVersion(user_config_version) != LooseVersion(system_config_version): + if parse(user_config_version) != parse(system_config_version): # Update the user config self.__merge_dictionary( self.__user_config, self.__system_config) diff --git a/safeeyes/utility.py b/safeeyes/utility.py index 8006dd42..fb487f10 100644 --- a/safeeyes/utility.py +++ b/safeeyes/utility.py @@ -32,7 +32,6 @@ import shutil import subprocess import threading -from distutils.version import LooseVersion from logging.handlers import RotatingFileHandler from pathlib import Path @@ -43,6 +42,7 @@ from gi.repository import Gtk from gi.repository import GLib from gi.repository import GdkPixbuf +from packaging.version import parse gi.require_version('Gdk', '3.0') @@ -547,7 +547,7 @@ def __update_plugin_config(plugin, plugin_config, config): if plugin_config is None: config['plugins'].remove(plugin) else: - if LooseVersion(plugin.get('version', '0.0.0')) != LooseVersion(plugin_config['meta']['version']): + if parse(plugin.get('version', '0.0.0')) != parse(plugin_config['meta']['version']): # Update the configuration plugin['version'] = plugin_config['meta']['version'] setting_ids = [] diff --git a/setup.py b/setup.py index 07a314b9..4dda0231 100644 --- a/setup.py +++ b/setup.py @@ -8,6 +8,7 @@ 'psutil', 'croniter', 'PyGObject', + 'packaging', 'python-xlib' ] From 603e1d744510862de2e981ffa5393d6bea2fae7e Mon Sep 17 00:00:00 2001 From: Gobinath Date: Wed, 26 Jun 2024 20:56:22 -0400 Subject: [PATCH 11/29] Update locale files --- .../config/locale/ar/LC_MESSAGES/safeeyes.po | 12 ++++++++++++ .../config/locale/bg/LC_MESSAGES/safeeyes.po | 12 ++++++++++++ .../config/locale/ca/LC_MESSAGES/safeeyes.po | 15 ++++++++++++++- .../config/locale/cs/LC_MESSAGES/safeeyes.po | 12 ++++++++++++ .../config/locale/da/LC_MESSAGES/safeeyes.po | 12 ++++++++++++ .../config/locale/de/LC_MESSAGES/safeeyes.po | 12 ++++++++++++ .../config/locale/en_US/LC_MESSAGES/safeeyes.po | 12 ++++++++++++ .../config/locale/eo/LC_MESSAGES/safeeyes.po | 12 ++++++++++++ .../config/locale/es/LC_MESSAGES/safeeyes.po | 12 ++++++++++++ .../config/locale/et/LC_MESSAGES/safeeyes.po | 12 ++++++++++++ .../config/locale/eu/LC_MESSAGES/safeeyes.po | 15 ++++++++++++++- .../config/locale/fa/LC_MESSAGES/safeeyes.po | 12 ++++++++++++ .../config/locale/fr/LC_MESSAGES/safeeyes.po | 12 ++++++++++++ .../config/locale/he/LC_MESSAGES/safeeyes.po | 12 ++++++++++++ .../config/locale/hi/LC_MESSAGES/safeeyes.po | 12 ++++++++++++ .../config/locale/hu/LC_MESSAGES/safeeyes.po | 12 ++++++++++++ .../config/locale/id/LC_MESSAGES/safeeyes.po | 12 ++++++++++++ .../config/locale/it/LC_MESSAGES/safeeyes.po | 15 ++++++++++++++- .../config/locale/kn/LC_MESSAGES/safeeyes.po | 12 ++++++++++++ .../config/locale/ko/LC_MESSAGES/safeeyes.po | 12 ++++++++++++ .../config/locale/lt/LC_MESSAGES/safeeyes.po | 16 ++++++++++++++-- .../config/locale/lv/LC_MESSAGES/safeeyes.po | 12 ++++++++++++ .../config/locale/mk/LC_MESSAGES/safeeyes.po | 12 ++++++++++++ .../config/locale/mr/LC_MESSAGES/safeeyes.po | 12 ++++++++++++ .../config/locale/nb/LC_MESSAGES/safeeyes.po | 16 ++++++++++++++-- .../config/locale/nl/LC_MESSAGES/safeeyes.po | 12 ++++++++++++ .../config/locale/pl/LC_MESSAGES/safeeyes.po | 12 ++++++++++++ .../config/locale/pt/LC_MESSAGES/safeeyes.po | 12 ++++++++++++ .../config/locale/pt_BR/LC_MESSAGES/safeeyes.po | 16 ++++++++++++++-- .../config/locale/ru/LC_MESSAGES/safeeyes.po | 12 ++++++++++++ .../config/locale/sk/LC_MESSAGES/safeeyes.po | 12 ++++++++++++ .../config/locale/sr/LC_MESSAGES/safeeyes.po | 12 ++++++++++++ .../config/locale/sv/LC_MESSAGES/safeeyes.po | 12 ++++++++++++ .../config/locale/ta/LC_MESSAGES/safeeyes.po | 12 ++++++++++++ .../config/locale/tr/LC_MESSAGES/safeeyes.po | 12 ++++++++++++ .../config/locale/ug/LC_MESSAGES/safeeyes.po | 12 ++++++++++++ .../config/locale/uk/LC_MESSAGES/safeeyes.po | 12 ++++++++++++ .../locale/uz_Latn/LC_MESSAGES/safeeyes.po | 12 ++++++++++++ .../config/locale/vi/LC_MESSAGES/safeeyes.po | 12 ++++++++++++ .../config/locale/zh_CN/LC_MESSAGES/safeeyes.po | 15 ++++++++++++++- .../config/locale/zh_TW/LC_MESSAGES/safeeyes.po | 12 ++++++++++++ 41 files changed, 506 insertions(+), 10 deletions(-) diff --git a/safeeyes/config/locale/ar/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/ar/LC_MESSAGES/safeeyes.po index 99a1944d..6d8b8ac6 100644 --- a/safeeyes/config/locale/ar/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/ar/LC_MESSAGES/safeeyes.po @@ -486,6 +486,18 @@ msgstr "الإعدادات" msgid "Take a break now" msgstr "خُذ استراحة الآن" +#: plugins/trayicon +msgid "Any break" +msgstr "" + +#: plugins/trayicon +msgid "Short break" +msgstr "" + +#: plugins/trayicon +msgid "Long break" +msgstr "" + #: plugins/trayicon msgid "Until restart" msgstr "حتى إعادة التشغيل" diff --git a/safeeyes/config/locale/bg/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/bg/LC_MESSAGES/safeeyes.po index e07f8485..cdc681d6 100644 --- a/safeeyes/config/locale/bg/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/bg/LC_MESSAGES/safeeyes.po @@ -472,6 +472,18 @@ msgstr "Настройки" msgid "Take a break now" msgstr "Направете почивка сега" +#: plugins/trayicon +msgid "Any break" +msgstr "" + +#: plugins/trayicon +msgid "Short break" +msgstr "" + +#: plugins/trayicon +msgid "Long break" +msgstr "" + #: plugins/trayicon msgid "Until restart" msgstr "До рестартиране" diff --git a/safeeyes/config/locale/ca/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/ca/LC_MESSAGES/safeeyes.po index 94633480..95d8f90d 100644 --- a/safeeyes/config/locale/ca/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/ca/LC_MESSAGES/safeeyes.po @@ -171,7 +171,8 @@ msgstr "Restablir" # Settings dialog msgid "Are you sure you want to reset all settings to default?" -msgstr "De veritat que voleu restablir les preferències als valors per defecte?" +msgstr "" +"De veritat que voleu restablir les preferències als valors per defecte?" # Settings dialog msgid "Options" @@ -475,6 +476,18 @@ msgstr "Configuració" msgid "Take a break now" msgstr "" +#: plugins/trayicon +msgid "Any break" +msgstr "" + +#: plugins/trayicon +msgid "Short break" +msgstr "" + +#: plugins/trayicon +msgid "Long break" +msgstr "" + #: plugins/trayicon msgid "Until restart" msgstr "Fins que es reinicïi" diff --git a/safeeyes/config/locale/cs/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/cs/LC_MESSAGES/safeeyes.po index 381d1694..8bdca653 100644 --- a/safeeyes/config/locale/cs/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/cs/LC_MESSAGES/safeeyes.po @@ -482,6 +482,18 @@ msgstr "Nastavení" msgid "Take a break now" msgstr "Udělat si přestávku" +#: plugins/trayicon +msgid "Any break" +msgstr "" + +#: plugins/trayicon +msgid "Short break" +msgstr "" + +#: plugins/trayicon +msgid "Long break" +msgstr "" + #: plugins/trayicon msgid "Until restart" msgstr "Do restartu" diff --git a/safeeyes/config/locale/da/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/da/LC_MESSAGES/safeeyes.po index e4f2d2d1..91957c8c 100644 --- a/safeeyes/config/locale/da/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/da/LC_MESSAGES/safeeyes.po @@ -475,6 +475,18 @@ msgstr "Indstillinger" msgid "Take a break now" msgstr "Hold pause nu" +#: plugins/trayicon +msgid "Any break" +msgstr "" + +#: plugins/trayicon +msgid "Short break" +msgstr "" + +#: plugins/trayicon +msgid "Long break" +msgstr "" + #: plugins/trayicon msgid "Until restart" msgstr "Indtil genstart" diff --git a/safeeyes/config/locale/de/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/de/LC_MESSAGES/safeeyes.po index 7b514a99..4f68e12d 100644 --- a/safeeyes/config/locale/de/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/de/LC_MESSAGES/safeeyes.po @@ -484,6 +484,18 @@ msgstr "Einstellungen" msgid "Take a break now" msgstr "Jetzt Pause machen" +#: plugins/trayicon +msgid "Any break" +msgstr "" + +#: plugins/trayicon +msgid "Short break" +msgstr "" + +#: plugins/trayicon +msgid "Long break" +msgstr "" + #: plugins/trayicon msgid "Until restart" msgstr "Bis zum Neustart" diff --git a/safeeyes/config/locale/en_US/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/en_US/LC_MESSAGES/safeeyes.po index ac8eabb5..6224f76f 100644 --- a/safeeyes/config/locale/en_US/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/en_US/LC_MESSAGES/safeeyes.po @@ -477,6 +477,18 @@ msgstr "Settings" msgid "Take a break now" msgstr "Take a break now" +#: plugins/trayicon +msgid "Any break" +msgstr "" + +#: plugins/trayicon +msgid "Short break" +msgstr "" + +#: plugins/trayicon +msgid "Long break" +msgstr "" + #: plugins/trayicon msgid "Until restart" msgstr "Until restart" diff --git a/safeeyes/config/locale/eo/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/eo/LC_MESSAGES/safeeyes.po index 9dd0e6ff..546c3ac5 100644 --- a/safeeyes/config/locale/eo/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/eo/LC_MESSAGES/safeeyes.po @@ -477,6 +477,18 @@ msgstr "Agordoj" msgid "Take a break now" msgstr "Paŭzi nun" +#: plugins/trayicon +msgid "Any break" +msgstr "" + +#: plugins/trayicon +msgid "Short break" +msgstr "" + +#: plugins/trayicon +msgid "Long break" +msgstr "" + #: plugins/trayicon msgid "Until restart" msgstr "Ĝis restarto" diff --git a/safeeyes/config/locale/es/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/es/LC_MESSAGES/safeeyes.po index ed760ebd..c1f825ed 100644 --- a/safeeyes/config/locale/es/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/es/LC_MESSAGES/safeeyes.po @@ -485,6 +485,18 @@ msgstr "Configuración" msgid "Take a break now" msgstr "Tomar un descanso ahora" +#: plugins/trayicon +msgid "Any break" +msgstr "" + +#: plugins/trayicon +msgid "Short break" +msgstr "" + +#: plugins/trayicon +msgid "Long break" +msgstr "" + #: plugins/trayicon msgid "Until restart" msgstr "Hasta el reinicio" diff --git a/safeeyes/config/locale/et/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/et/LC_MESSAGES/safeeyes.po index 67005c49..806d65cb 100644 --- a/safeeyes/config/locale/et/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/et/LC_MESSAGES/safeeyes.po @@ -476,6 +476,18 @@ msgstr "Seaded" msgid "Take a break now" msgstr "Tee nüüd paus" +#: plugins/trayicon +msgid "Any break" +msgstr "" + +#: plugins/trayicon +msgid "Short break" +msgstr "" + +#: plugins/trayicon +msgid "Long break" +msgstr "" + #: plugins/trayicon msgid "Until restart" msgstr "Taaskäivitumiseni" diff --git a/safeeyes/config/locale/eu/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/eu/LC_MESSAGES/safeeyes.po index 1f1c877d..f488d039 100644 --- a/safeeyes/config/locale/eu/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/eu/LC_MESSAGES/safeeyes.po @@ -160,7 +160,8 @@ msgstr "Erabili RPC zerbitzaria exekuzio-denboraren komanduak jasotzeko" # Settings dialog msgid "Without the RPC server, command-line commands may not work" -msgstr "RPC zerbitzaririk gabe, komandu-lineako komanduek ez dute funtzionatuko" +msgstr "" +"RPC zerbitzaririk gabe, komandu-lineako komanduek ez dute funtzionatuko" # Settings dialog msgid "Long break interval must be a multiple of short break interval" @@ -481,6 +482,18 @@ msgstr "Ezarpenak" msgid "Take a break now" msgstr "Egin orain etenaldia" +#: plugins/trayicon +msgid "Any break" +msgstr "" + +#: plugins/trayicon +msgid "Short break" +msgstr "" + +#: plugins/trayicon +msgid "Long break" +msgstr "" + #: plugins/trayicon msgid "Until restart" msgstr "Berrabiarazi arte" diff --git a/safeeyes/config/locale/fa/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/fa/LC_MESSAGES/safeeyes.po index 64d0e060..c00542a7 100644 --- a/safeeyes/config/locale/fa/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/fa/LC_MESSAGES/safeeyes.po @@ -476,6 +476,18 @@ msgstr "تنظیمات" msgid "Take a break now" msgstr "اکنون استراحت کنید" +#: plugins/trayicon +msgid "Any break" +msgstr "" + +#: plugins/trayicon +msgid "Short break" +msgstr "" + +#: plugins/trayicon +msgid "Long break" +msgstr "" + #: plugins/trayicon msgid "Until restart" msgstr "تا آغاز دوباره" diff --git a/safeeyes/config/locale/fr/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/fr/LC_MESSAGES/safeeyes.po index aaf3802a..694ae94b 100644 --- a/safeeyes/config/locale/fr/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/fr/LC_MESSAGES/safeeyes.po @@ -489,6 +489,18 @@ msgstr "Paramètres" msgid "Take a break now" msgstr "Prendre une pause maintenant" +#: plugins/trayicon +msgid "Any break" +msgstr "" + +#: plugins/trayicon +msgid "Short break" +msgstr "" + +#: plugins/trayicon +msgid "Long break" +msgstr "" + #: plugins/trayicon msgid "Until restart" msgstr "Jusqu’au redémarrage" diff --git a/safeeyes/config/locale/he/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/he/LC_MESSAGES/safeeyes.po index 33dfd445..777611fe 100644 --- a/safeeyes/config/locale/he/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/he/LC_MESSAGES/safeeyes.po @@ -474,6 +474,18 @@ msgstr "הגדרות" msgid "Take a break now" msgstr "לקחת הפסקה עכשיו" +#: plugins/trayicon +msgid "Any break" +msgstr "" + +#: plugins/trayicon +msgid "Short break" +msgstr "" + +#: plugins/trayicon +msgid "Long break" +msgstr "" + #: plugins/trayicon msgid "Until restart" msgstr "עד להפעלה מחדש" diff --git a/safeeyes/config/locale/hi/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/hi/LC_MESSAGES/safeeyes.po index 4b4f2fbc..cd1618d3 100644 --- a/safeeyes/config/locale/hi/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/hi/LC_MESSAGES/safeeyes.po @@ -472,6 +472,18 @@ msgstr "" msgid "Take a break now" msgstr "" +#: plugins/trayicon +msgid "Any break" +msgstr "" + +#: plugins/trayicon +msgid "Short break" +msgstr "" + +#: plugins/trayicon +msgid "Long break" +msgstr "" + #: plugins/trayicon msgid "Until restart" msgstr "" diff --git a/safeeyes/config/locale/hu/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/hu/LC_MESSAGES/safeeyes.po index fdcf6e3a..df709e6e 100644 --- a/safeeyes/config/locale/hu/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/hu/LC_MESSAGES/safeeyes.po @@ -473,6 +473,18 @@ msgstr "Beállítások" msgid "Take a break now" msgstr "Kezdd meg a pihenőt most" +#: plugins/trayicon +msgid "Any break" +msgstr "" + +#: plugins/trayicon +msgid "Short break" +msgstr "" + +#: plugins/trayicon +msgid "Long break" +msgstr "" + #: plugins/trayicon msgid "Until restart" msgstr "Újraindításig" diff --git a/safeeyes/config/locale/id/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/id/LC_MESSAGES/safeeyes.po index f56a347c..d1a9bcef 100644 --- a/safeeyes/config/locale/id/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/id/LC_MESSAGES/safeeyes.po @@ -477,6 +477,18 @@ msgstr "Pengaturan" msgid "Take a break now" msgstr "Ambil istirahat sekarang" +#: plugins/trayicon +msgid "Any break" +msgstr "" + +#: plugins/trayicon +msgid "Short break" +msgstr "" + +#: plugins/trayicon +msgid "Long break" +msgstr "" + #: plugins/trayicon msgid "Until restart" msgstr "Sampai restart" diff --git a/safeeyes/config/locale/it/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/it/LC_MESSAGES/safeeyes.po index 59f04700..b4208d16 100644 --- a/safeeyes/config/locale/it/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/it/LC_MESSAGES/safeeyes.po @@ -161,7 +161,8 @@ msgstr "Utilizza il server RPC per ricevere i comandi" # Settings dialog msgid "Without the RPC server, command-line commands may not work" -msgstr "Senza il server RPC, i comandi a riga di comando non possono funzionare" +msgstr "" +"Senza il server RPC, i comandi a riga di comando non possono funzionare" # Settings dialog msgid "Long break interval must be a multiple of short break interval" @@ -482,6 +483,18 @@ msgstr "Preferenze" msgid "Take a break now" msgstr "Fai una pausa adesso" +#: plugins/trayicon +msgid "Any break" +msgstr "" + +#: plugins/trayicon +msgid "Short break" +msgstr "" + +#: plugins/trayicon +msgid "Long break" +msgstr "" + #: plugins/trayicon msgid "Until restart" msgstr "Fino al riavvio" diff --git a/safeeyes/config/locale/kn/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/kn/LC_MESSAGES/safeeyes.po index 0a78c90a..91963ecc 100644 --- a/safeeyes/config/locale/kn/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/kn/LC_MESSAGES/safeeyes.po @@ -471,6 +471,18 @@ msgstr "" msgid "Take a break now" msgstr "" +#: plugins/trayicon +msgid "Any break" +msgstr "" + +#: plugins/trayicon +msgid "Short break" +msgstr "" + +#: plugins/trayicon +msgid "Long break" +msgstr "" + #: plugins/trayicon msgid "Until restart" msgstr "" diff --git a/safeeyes/config/locale/ko/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/ko/LC_MESSAGES/safeeyes.po index 31dd5391..6ea7bdf3 100644 --- a/safeeyes/config/locale/ko/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/ko/LC_MESSAGES/safeeyes.po @@ -471,6 +471,18 @@ msgstr "설정" msgid "Take a break now" msgstr "지금 휴식" +#: plugins/trayicon +msgid "Any break" +msgstr "" + +#: plugins/trayicon +msgid "Short break" +msgstr "" + +#: plugins/trayicon +msgid "Long break" +msgstr "" + #: plugins/trayicon msgid "Until restart" msgstr "다시 시작할 때까지" diff --git a/safeeyes/config/locale/lt/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/lt/LC_MESSAGES/safeeyes.po index 54a7cd57..840aba77 100644 --- a/safeeyes/config/locale/lt/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/lt/LC_MESSAGES/safeeyes.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n" -"%100<10 || n%100>=20) ? 1 : 2);\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && " +"(n%100<10 || n%100>=20) ? 1 : 2);\n" "X-Generator: Weblate 4.5-dev\n" # Short break @@ -484,6 +484,18 @@ msgstr "Nuostatos" msgid "Take a break now" msgstr "Padaryti pertrauką" +#: plugins/trayicon +msgid "Any break" +msgstr "" + +#: plugins/trayicon +msgid "Short break" +msgstr "" + +#: plugins/trayicon +msgid "Long break" +msgstr "" + #: plugins/trayicon msgid "Until restart" msgstr "Iki paleidimo iš naujo" diff --git a/safeeyes/config/locale/lv/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/lv/LC_MESSAGES/safeeyes.po index 8ff7f1a6..c9caa660 100644 --- a/safeeyes/config/locale/lv/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/lv/LC_MESSAGES/safeeyes.po @@ -393,6 +393,18 @@ msgstr "Iestatījumi" msgid "Take a break now" msgstr "Paņemt pārtraukumu tagad" +#: plugins/trayicon +msgid "Any break" +msgstr "" + +#: plugins/trayicon +msgid "Short break" +msgstr "" + +#: plugins/trayicon +msgid "Long break" +msgstr "" + #: plugins/trayicon msgid "Until restart" msgstr "Līdz restartam" diff --git a/safeeyes/config/locale/mk/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/mk/LC_MESSAGES/safeeyes.po index ed23538b..5b056947 100644 --- a/safeeyes/config/locale/mk/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/mk/LC_MESSAGES/safeeyes.po @@ -474,6 +474,18 @@ msgstr "" msgid "Take a break now" msgstr "" +#: plugins/trayicon +msgid "Any break" +msgstr "" + +#: plugins/trayicon +msgid "Short break" +msgstr "" + +#: plugins/trayicon +msgid "Long break" +msgstr "" + #: plugins/trayicon msgid "Until restart" msgstr "" diff --git a/safeeyes/config/locale/mr/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/mr/LC_MESSAGES/safeeyes.po index 2cadcc6f..921da50e 100644 --- a/safeeyes/config/locale/mr/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/mr/LC_MESSAGES/safeeyes.po @@ -473,6 +473,18 @@ msgstr "" msgid "Take a break now" msgstr "" +#: plugins/trayicon +msgid "Any break" +msgstr "" + +#: plugins/trayicon +msgid "Short break" +msgstr "" + +#: plugins/trayicon +msgid "Long break" +msgstr "" + #: plugins/trayicon msgid "Until restart" msgstr "" diff --git a/safeeyes/config/locale/nb/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/nb/LC_MESSAGES/safeeyes.po index c58c0b00..b75647bf 100644 --- a/safeeyes/config/locale/nb/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/nb/LC_MESSAGES/safeeyes.po @@ -8,8 +8,8 @@ msgstr "" "POT-Creation-Date: \n" "PO-Revision-Date: 2021-07-30 17:35+0000\n" "Last-Translator: Allan Nordhøy \n" -"Language-Team: Norwegian Bokmål \n" +"Language-Team: Norwegian Bokmål \n" "Language: nb\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -479,6 +479,18 @@ msgstr "Innstillinger" msgid "Take a break now" msgstr "Ta en pause nå" +#: plugins/trayicon +msgid "Any break" +msgstr "" + +#: plugins/trayicon +msgid "Short break" +msgstr "" + +#: plugins/trayicon +msgid "Long break" +msgstr "" + #: plugins/trayicon msgid "Until restart" msgstr "Til omstart" diff --git a/safeeyes/config/locale/nl/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/nl/LC_MESSAGES/safeeyes.po index 3fa7a681..428a1f12 100644 --- a/safeeyes/config/locale/nl/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/nl/LC_MESSAGES/safeeyes.po @@ -482,6 +482,18 @@ msgstr "Instellingen" msgid "Take a break now" msgstr "Neem nu een pauze" +#: plugins/trayicon +msgid "Any break" +msgstr "" + +#: plugins/trayicon +msgid "Short break" +msgstr "" + +#: plugins/trayicon +msgid "Long break" +msgstr "" + #: plugins/trayicon msgid "Until restart" msgstr "Tot herstart" diff --git a/safeeyes/config/locale/pl/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/pl/LC_MESSAGES/safeeyes.po index d0a5ffed..5b66c655 100644 --- a/safeeyes/config/locale/pl/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/pl/LC_MESSAGES/safeeyes.po @@ -482,6 +482,18 @@ msgstr "Ustawienia" msgid "Take a break now" msgstr "Zrób sobie teraz przerwę" +#: plugins/trayicon +msgid "Any break" +msgstr "" + +#: plugins/trayicon +msgid "Short break" +msgstr "" + +#: plugins/trayicon +msgid "Long break" +msgstr "" + #: plugins/trayicon msgid "Until restart" msgstr "Do ponownego uruchomienia" diff --git a/safeeyes/config/locale/pt/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/pt/LC_MESSAGES/safeeyes.po index f3516cc7..1b9a1602 100644 --- a/safeeyes/config/locale/pt/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/pt/LC_MESSAGES/safeeyes.po @@ -480,6 +480,18 @@ msgstr "Definições" msgid "Take a break now" msgstr "Fazer uma pausa agora" +#: plugins/trayicon +msgid "Any break" +msgstr "" + +#: plugins/trayicon +msgid "Short break" +msgstr "" + +#: plugins/trayicon +msgid "Long break" +msgstr "" + #: plugins/trayicon msgid "Until restart" msgstr "Até reiniciar" diff --git a/safeeyes/config/locale/pt_BR/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/pt_BR/LC_MESSAGES/safeeyes.po index 70a24fc3..c4cdb434 100644 --- a/safeeyes/config/locale/pt_BR/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/pt_BR/LC_MESSAGES/safeeyes.po @@ -8,8 +8,8 @@ msgstr "" "POT-Creation-Date: \n" "PO-Revision-Date: 2021-04-18 10:26+0000\n" "Last-Translator: José Vieira \n" -"Language-Team: Portuguese (Brazil) \n" +"Language-Team: Portuguese (Brazil) \n" "Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -484,6 +484,18 @@ msgstr "Configurações" msgid "Take a break now" msgstr "Faça uma parada agora" +#: plugins/trayicon +msgid "Any break" +msgstr "" + +#: plugins/trayicon +msgid "Short break" +msgstr "" + +#: plugins/trayicon +msgid "Long break" +msgstr "" + #: plugins/trayicon msgid "Until restart" msgstr "Até reiniciar" diff --git a/safeeyes/config/locale/ru/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/ru/LC_MESSAGES/safeeyes.po index f9fc80b0..663bb4fd 100644 --- a/safeeyes/config/locale/ru/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/ru/LC_MESSAGES/safeeyes.po @@ -483,6 +483,18 @@ msgstr "Настройки" msgid "Take a break now" msgstr "Отдохнуть сейчас" +#: plugins/trayicon +msgid "Any break" +msgstr "" + +#: plugins/trayicon +msgid "Short break" +msgstr "" + +#: plugins/trayicon +msgid "Long break" +msgstr "" + #: plugins/trayicon msgid "Until restart" msgstr "До перезапуска" diff --git a/safeeyes/config/locale/sk/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/sk/LC_MESSAGES/safeeyes.po index 7556efc8..ef1d620d 100644 --- a/safeeyes/config/locale/sk/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/sk/LC_MESSAGES/safeeyes.po @@ -480,6 +480,18 @@ msgstr "Nastavenia" msgid "Take a break now" msgstr "Dať si prestávku" +#: plugins/trayicon +msgid "Any break" +msgstr "" + +#: plugins/trayicon +msgid "Short break" +msgstr "" + +#: plugins/trayicon +msgid "Long break" +msgstr "" + #: plugins/trayicon msgid "Until restart" msgstr "Do reštartu" diff --git a/safeeyes/config/locale/sr/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/sr/LC_MESSAGES/safeeyes.po index fa06b35b..21e77b84 100644 --- a/safeeyes/config/locale/sr/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/sr/LC_MESSAGES/safeeyes.po @@ -487,6 +487,18 @@ msgstr "Подешавања" msgid "Take a break now" msgstr "Сада направи паузу" +#: plugins/trayicon +msgid "Any break" +msgstr "" + +#: plugins/trayicon +msgid "Short break" +msgstr "" + +#: plugins/trayicon +msgid "Long break" +msgstr "" + #: plugins/trayicon msgid "Until restart" msgstr "До ресетовања" diff --git a/safeeyes/config/locale/sv/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/sv/LC_MESSAGES/safeeyes.po index fc4d2989..1bde9026 100644 --- a/safeeyes/config/locale/sv/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/sv/LC_MESSAGES/safeeyes.po @@ -476,6 +476,18 @@ msgstr "Inställningar" msgid "Take a break now" msgstr "Ta en paus nu" +#: plugins/trayicon +msgid "Any break" +msgstr "" + +#: plugins/trayicon +msgid "Short break" +msgstr "" + +#: plugins/trayicon +msgid "Long break" +msgstr "" + #: plugins/trayicon msgid "Until restart" msgstr "Tills omstart" diff --git a/safeeyes/config/locale/ta/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/ta/LC_MESSAGES/safeeyes.po index 733e50cc..307e2d39 100644 --- a/safeeyes/config/locale/ta/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/ta/LC_MESSAGES/safeeyes.po @@ -479,6 +479,18 @@ msgstr "அமைப்பு" msgid "Take a break now" msgstr "சுயவிருப்பிலான இடைவேளை" +#: plugins/trayicon +msgid "Any break" +msgstr "" + +#: plugins/trayicon +msgid "Short break" +msgstr "" + +#: plugins/trayicon +msgid "Long break" +msgstr "" + #: plugins/trayicon msgid "Until restart" msgstr "மீள ஆரம்பிக்கும் வரை" diff --git a/safeeyes/config/locale/tr/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/tr/LC_MESSAGES/safeeyes.po index a55d4288..978dccd5 100644 --- a/safeeyes/config/locale/tr/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/tr/LC_MESSAGES/safeeyes.po @@ -480,6 +480,18 @@ msgstr "Ayarlar" msgid "Take a break now" msgstr "Şimdi mola ver" +#: plugins/trayicon +msgid "Any break" +msgstr "" + +#: plugins/trayicon +msgid "Short break" +msgstr "" + +#: plugins/trayicon +msgid "Long break" +msgstr "" + #: plugins/trayicon msgid "Until restart" msgstr "Tekrar başlatılana kadar" diff --git a/safeeyes/config/locale/ug/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/ug/LC_MESSAGES/safeeyes.po index 1e052497..22f2eeba 100644 --- a/safeeyes/config/locale/ug/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/ug/LC_MESSAGES/safeeyes.po @@ -468,6 +468,18 @@ msgstr "" msgid "Take a break now" msgstr "" +#: plugins/trayicon +msgid "Any break" +msgstr "" + +#: plugins/trayicon +msgid "Short break" +msgstr "" + +#: plugins/trayicon +msgid "Long break" +msgstr "" + #: plugins/trayicon msgid "Until restart" msgstr "" diff --git a/safeeyes/config/locale/uk/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/uk/LC_MESSAGES/safeeyes.po index 0b5d8d18..527c9744 100644 --- a/safeeyes/config/locale/uk/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/uk/LC_MESSAGES/safeeyes.po @@ -483,6 +483,18 @@ msgstr "Налаштування" msgid "Take a break now" msgstr "Зробити перерву зараз" +#: plugins/trayicon +msgid "Any break" +msgstr "" + +#: plugins/trayicon +msgid "Short break" +msgstr "" + +#: plugins/trayicon +msgid "Long break" +msgstr "" + #: plugins/trayicon msgid "Until restart" msgstr "До перезавантаження" diff --git a/safeeyes/config/locale/uz_Latn/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/uz_Latn/LC_MESSAGES/safeeyes.po index dec5a6a9..75c8123b 100644 --- a/safeeyes/config/locale/uz_Latn/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/uz_Latn/LC_MESSAGES/safeeyes.po @@ -468,6 +468,18 @@ msgstr "" msgid "Take a break now" msgstr "" +#: plugins/trayicon +msgid "Any break" +msgstr "" + +#: plugins/trayicon +msgid "Short break" +msgstr "" + +#: plugins/trayicon +msgid "Long break" +msgstr "" + #: plugins/trayicon msgid "Until restart" msgstr "" diff --git a/safeeyes/config/locale/vi/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/vi/LC_MESSAGES/safeeyes.po index 6edbaccd..5659ba9f 100644 --- a/safeeyes/config/locale/vi/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/vi/LC_MESSAGES/safeeyes.po @@ -477,6 +477,18 @@ msgstr "Cài đặt" msgid "Take a break now" msgstr "Nghỉ ngay bây giờ" +#: plugins/trayicon +msgid "Any break" +msgstr "" + +#: plugins/trayicon +msgid "Short break" +msgstr "" + +#: plugins/trayicon +msgid "Long break" +msgstr "" + #: plugins/trayicon msgid "Until restart" msgstr "Cho đến khi khởi động lại" diff --git a/safeeyes/config/locale/zh_CN/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/zh_CN/LC_MESSAGES/safeeyes.po index 7a054f6a..71ca1027 100644 --- a/safeeyes/config/locale/zh_CN/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/zh_CN/LC_MESSAGES/safeeyes.po @@ -89,7 +89,8 @@ msgstr "Safe Eyes 没有运行" msgid "" "Safe Eyes is running without an RPC server. Turn it on to use command-line " "arguments." -msgstr "Safe Eyes 正在没有RPC服务器的情况下运行。打开RPC服务器可以使用命令行参数。" +msgstr "" +"Safe Eyes 正在没有RPC服务器的情况下运行。打开RPC服务器可以使用命令行参数。" # About dialog msgid "Close" @@ -471,6 +472,18 @@ msgstr "设置" msgid "Take a break now" msgstr "立即休息" +#: plugins/trayicon +msgid "Any break" +msgstr "" + +#: plugins/trayicon +msgid "Short break" +msgstr "" + +#: plugins/trayicon +msgid "Long break" +msgstr "" + #: plugins/trayicon msgid "Until restart" msgstr "直到重启" diff --git a/safeeyes/config/locale/zh_TW/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/zh_TW/LC_MESSAGES/safeeyes.po index 25afdf70..82016b3f 100644 --- a/safeeyes/config/locale/zh_TW/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/zh_TW/LC_MESSAGES/safeeyes.po @@ -469,6 +469,18 @@ msgstr "設定" msgid "Take a break now" msgstr "立即休息" +#: plugins/trayicon +msgid "Any break" +msgstr "" + +#: plugins/trayicon +msgid "Short break" +msgstr "" + +#: plugins/trayicon +msgid "Long break" +msgstr "" + #: plugins/trayicon msgid "Until restart" msgstr "直到重新啟動" From 1c59cee5fa5eccf6e15b0ecef0a2140795fc4e12 Mon Sep 17 00:00:00 2001 From: aerowolf Date: Wed, 26 Jun 2024 01:18:26 +0000 Subject: [PATCH 12/29] Translated using Weblate (Chinese (Simplified)) Currently translated at 100.0% (116 of 116 strings) Translation: Safe Eyes/Translations Translate-URL: https://hosted.weblate.org/projects/safe-eyes/translations/zh_Hans/ --- safeeyes/config/locale/zh_CN/LC_MESSAGES/safeeyes.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/safeeyes/config/locale/zh_CN/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/zh_CN/LC_MESSAGES/safeeyes.po index 7a054f6a..f8f0d41d 100644 --- a/safeeyes/config/locale/zh_CN/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/zh_CN/LC_MESSAGES/safeeyes.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2024-02-21 10:01+0000\n" +"PO-Revision-Date: 2024-06-27 00:57+0000\n" "Last-Translator: aerowolf \n" "Language-Team: Chinese (Simplified) \n" @@ -15,7 +15,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 5.5-dev\n" +"X-Generator: Weblate 5.6-rc\n" # Short break msgid "Tightly close your eyes" @@ -39,7 +39,7 @@ msgstr "眨眨眼" # Short break msgid "Focus on a point in the far distance" -msgstr "远眺:看看尽可能远的远处" +msgstr "远眺:看看最远处" # Short break msgid "Have some water" From e2f54a8d2bf1190e09cbf88a7dac727d047d69e7 Mon Sep 17 00:00:00 2001 From: Archisman Panigrahi Date: Wed, 26 Jun 2024 21:49:33 -0400 Subject: [PATCH 13/29] README: Add updating translation to release checklist --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 41f29ded..ee540979 100644 --- a/README.md +++ b/README.md @@ -168,6 +168,7 @@ Thirdparty plugins are available at another GitHub repository: [safeeyes-plugins ## How to Release? +0. Run `update-po.sh` to generate new translation files (which will be eventually updated by translators). Commit and push the changes to the master branch. 1. Checkout the latest commits from the `master` branch 2. Run `python3 -m safeeyes` to make sure nothing is broken 3. Update the Safe Eyes version in the following places (Open the project in VSCode and search for the current version): From e850b0aa2b82b2c87f47017cd0055707c7e1b17f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?O=C4=9Fuz=20Ersen?= Date: Thu, 27 Jun 2024 16:36:16 +0000 Subject: [PATCH 14/29] Translated using Weblate (Turkish) Currently translated at 100.0% (119 of 119 strings) Translation: Safe Eyes/Translations Translate-URL: https://hosted.weblate.org/projects/safe-eyes/translations/tr/ --- safeeyes/config/locale/tr/LC_MESSAGES/safeeyes.po | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/safeeyes/config/locale/tr/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/tr/LC_MESSAGES/safeeyes.po index 978dccd5..4743c5f2 100644 --- a/safeeyes/config/locale/tr/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/tr/LC_MESSAGES/safeeyes.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: \n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2021-02-10 15:50+0000\n" -"Last-Translator: Oğuz Ersen \n" +"PO-Revision-Date: 2024-06-28 17:09+0000\n" +"Last-Translator: Oğuz Ersen \n" "Language-Team: Turkish \n" "Language: tr\n" @@ -15,7 +15,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 4.5-dev\n" +"X-Generator: Weblate 5.7-dev\n" # Short break msgid "Tightly close your eyes" @@ -482,15 +482,15 @@ msgstr "Şimdi mola ver" #: plugins/trayicon msgid "Any break" -msgstr "" +msgstr "Herhangi bir mola" #: plugins/trayicon msgid "Short break" -msgstr "" +msgstr "Kısa mola" #: plugins/trayicon msgid "Long break" -msgstr "" +msgstr "Uzun mola" #: plugins/trayicon msgid "Until restart" From 08f5d578b879dc2a71fffe08a3e814d132139fac Mon Sep 17 00:00:00 2001 From: Archisman Panigrahi Date: Sat, 29 Jun 2024 08:36:50 -0400 Subject: [PATCH 15/29] Update installation section on README --- README.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ee540979..45152f9b 100644 --- a/README.md +++ b/README.md @@ -35,10 +35,19 @@ optional arguments: ## Installation guide -Safe Eyes is available in Ubuntu PPA, Arch AUR, Gentoo and Python PyPI. You can choose any installation source and install on any Linux system with Python 3. +Safe Eyes is available on the official repositories of many popular the distributions. + +[![Packaging status](https://repology.org/badge/vertical-allrepos/safeeyes.svg)](https://repology.org/project/safeeyes/versions) + + +It is also available in Ubuntu PPA, Arch AUR, Gentoo and Python PyPI. You can choose any installation source and install on any Linux system with Python 3. + + ### Ubuntu, Linux Mint and other Ubuntu Derivatives +The official Safe Eyes PPA hosts the latest version of safeeyes for Ubuntu 22.04 and above. On older versions of Ubuntu, an older version of Safe Eyes is available on the official repositories. + ```bash sudo add-apt-repository ppa:safeeyes-team/safeeyes sudo apt update From 8a78f7173a9280e95d07492376008b3780ec45d1 Mon Sep 17 00:00:00 2001 From: gallegonovato Date: Sat, 29 Jun 2024 20:55:18 +0000 Subject: [PATCH 16/29] Translated using Weblate (Spanish) Currently translated at 100.0% (119 of 119 strings) Translation: Safe Eyes/Translations Translate-URL: https://hosted.weblate.org/projects/safe-eyes/translations/es/ --- safeeyes/config/locale/es/LC_MESSAGES/safeeyes.po | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/safeeyes/config/locale/es/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/es/LC_MESSAGES/safeeyes.po index c1f825ed..637dfd10 100644 --- a/safeeyes/config/locale/es/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/es/LC_MESSAGES/safeeyes.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: \n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2021-03-25 08:29+0000\n" -"Last-Translator: Adolfo Jayme Barrientos \n" +"PO-Revision-Date: 2024-06-30 21:09+0000\n" +"Last-Translator: gallegonovato \n" "Language-Team: Spanish \n" "Language: es\n" @@ -15,7 +15,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 4.5.2-dev\n" +"X-Generator: Weblate 5.7-dev\n" # Short break msgid "Tightly close your eyes" @@ -487,15 +487,15 @@ msgstr "Tomar un descanso ahora" #: plugins/trayicon msgid "Any break" -msgstr "" +msgstr "Cualquier descanso" #: plugins/trayicon msgid "Short break" -msgstr "" +msgstr "Descanso corto" #: plugins/trayicon msgid "Long break" -msgstr "" +msgstr "Descanso largo" #: plugins/trayicon msgid "Until restart" From 981988a74a13de5bbd8f06d62d4a814db7dbfcad Mon Sep 17 00:00:00 2001 From: onur Date: Mon, 1 Jul 2024 12:30:15 +0300 Subject: [PATCH 17/29] fix MetaInfo errors flatpak run --command=flatpak-builder-lint org.flatpak.Builder appstream io.github.slgobinath.SafeEyes.metainfo.xml --- ...io.github.slgobinath.SafeEyes.metainfo.xml | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/safeeyes/platform/io.github.slgobinath.SafeEyes.metainfo.xml b/safeeyes/platform/io.github.slgobinath.SafeEyes.metainfo.xml index e8d796df..de011162 100644 --- a/safeeyes/platform/io.github.slgobinath.SafeEyes.metainfo.xml +++ b/safeeyes/platform/io.github.slgobinath.SafeEyes.metainfo.xml @@ -3,9 +3,12 @@ io.github.slgobinath.SafeEyes Safe Eyes - Gobinath - A Free and Open Source tool for Linux users to reduce and prevent repetitive strain - injury (RSI). + + + Gobinath + + + A FOSS tool for Linux users to reduce and prevent repetitive strain injury (RSI) CC0-1.0 GPL-3.0 @@ -13,7 +16,7 @@ Utility Accessibility - +

@@ -34,12 +37,15 @@ io.github.slgobinath.SafeEyes.desktop + Safe Eyes short break screen. https://slgobinath.github.io/SafeEyes/assets/screenshots/safeeyes_1.png + Safe Eyes long break screen. https://slgobinath.github.io/SafeEyes/assets/screenshots/safeeyes_3.png + Safe Eyes settings window. https://slgobinath.github.io/SafeEyes/assets/screenshots/safeeyes_6.png @@ -47,7 +53,12 @@ https://slgobinath.github.io/SafeEyes/ - + + + + + + From 60c45d21f4970f0a7836a3bd383b62ebdb0cffca Mon Sep 17 00:00:00 2001 From: albanobattistella Date: Tue, 2 Jul 2024 06:47:07 +0000 Subject: [PATCH 18/29] Translated using Weblate (Italian) Currently translated at 100.0% (119 of 119 strings) Translation: Safe Eyes/Translations Translate-URL: https://hosted.weblate.org/projects/safe-eyes/translations/it/ --- safeeyes/config/locale/it/LC_MESSAGES/safeeyes.po | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/safeeyes/config/locale/it/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/it/LC_MESSAGES/safeeyes.po index b4208d16..a2848c0e 100644 --- a/safeeyes/config/locale/it/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/it/LC_MESSAGES/safeeyes.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2022-01-16 12:55+0000\n" +"PO-Revision-Date: 2024-07-02 12:09+0000\n" "Last-Translator: albanobattistella \n" "Language-Team: Italian \n" @@ -15,7 +15,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 4.10.1\n" +"X-Generator: Weblate 5.7-dev\n" # Short break msgid "Tightly close your eyes" @@ -485,15 +485,15 @@ msgstr "Fai una pausa adesso" #: plugins/trayicon msgid "Any break" -msgstr "" +msgstr "Qualsiasi pausa" #: plugins/trayicon msgid "Short break" -msgstr "" +msgstr "Breve pausa" #: plugins/trayicon msgid "Long break" -msgstr "" +msgstr "Lunga pausa" #: plugins/trayicon msgid "Until restart" From 6c9b00db50c76808a38aab7b08014c40731d5730 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?openSUSE=20Lietuvi=C5=A1kai?= Date: Mon, 1 Jul 2024 11:19:38 +0000 Subject: [PATCH 19/29] Translated using Weblate (Lithuanian) Currently translated at 100.0% (119 of 119 strings) Translation: Safe Eyes/Translations Translate-URL: https://hosted.weblate.org/projects/safe-eyes/translations/lt/ --- .../config/locale/lt/LC_MESSAGES/safeeyes.po | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/safeeyes/config/locale/lt/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/lt/LC_MESSAGES/safeeyes.po index 840aba77..bb3ad0bd 100644 --- a/safeeyes/config/locale/lt/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/lt/LC_MESSAGES/safeeyes.po @@ -6,17 +6,17 @@ msgid "" msgstr "" "Project-Id-Version: \n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2021-02-10 15:50+0000\n" -"Last-Translator: Moo \n" +"PO-Revision-Date: 2024-07-02 12:09+0000\n" +"Last-Translator: openSUSE Lietuviškai \n" "Language-Team: Lithuanian \n" "Language: lt\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && " -"(n%100<10 || n%100>=20) ? 1 : 2);\n" -"X-Generator: Weblate 4.5-dev\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (" +"n%100<10 || n%100>=20) ? 1 : 2);\n" +"X-Generator: Weblate 5.7-dev\n" # Short break msgid "Tightly close your eyes" @@ -486,15 +486,15 @@ msgstr "Padaryti pertrauką" #: plugins/trayicon msgid "Any break" -msgstr "" +msgstr "bet kuri pertrauka" #: plugins/trayicon msgid "Short break" -msgstr "" +msgstr "trumpa pertrauka" #: plugins/trayicon msgid "Long break" -msgstr "" +msgstr "ilga pertrauka" #: plugins/trayicon msgid "Until restart" From d834af98a75123a51776e758a77db7a11707312a Mon Sep 17 00:00:00 2001 From: deltragon Date: Wed, 3 Jul 2024 02:03:40 +0200 Subject: [PATCH 20/29] Remove uses of deprecated gtk3 apis (#560) * fix deprecations * port to Gtk.Application Gtk.main() and Gtk.main_quit() are dropped in gtk4 in favor of subclassing Gtk.Application. This commit also moves argument handling from a separate thread to GtkApplication.do_startup(). * fix deprecations in settings dialog --- safeeyes/__main__.py | 25 +----------------------- safeeyes/safeeyes.py | 35 ++++++++++++++++++++++++++++------ safeeyes/ui/break_screen.py | 18 +++++++++-------- safeeyes/ui/settings_dialog.py | 32 +++++++++++++++++-------------- 4 files changed, 58 insertions(+), 52 deletions(-) diff --git a/safeeyes/__main__.py b/safeeyes/__main__.py index 2eab4cd7..a3c11714 100755 --- a/safeeyes/__main__.py +++ b/safeeyes/__main__.py @@ -25,9 +25,7 @@ import logging import signal import sys -from threading import Timer -import gi import psutil from safeeyes import utility from safeeyes.model import Config @@ -35,9 +33,6 @@ from safeeyes.safeeyes import SAFE_EYES_VERSION from safeeyes.rpc import RPCClient -gi.require_version('Gtk', '3.0') -from gi.repository import Gtk - gettext.install('safeeyes', utility.LOCALE_PATH) @@ -68,22 +63,6 @@ def __running(): return False -def __evaluate_arguments(args, safe_eyes): - """ - Evaluate the arguments and execute the operations. - """ - if args.about: - utility.execute_main_thread(safe_eyes.show_about) - elif args.disable: - utility.execute_main_thread(safe_eyes.disable_safeeyes) - elif args.enable: - utility.execute_main_thread(safe_eyes.enable_safeeyes) - elif args.settings: - utility.execute_main_thread(safe_eyes.show_settings) - elif args.take_break: - utility.execute_main_thread(safe_eyes.take_break) - - def main(): """ Start the Safe Eyes. @@ -147,10 +126,8 @@ def main(): sys.exit(0) elif not args.quit: logging.info("Starting Safe Eyes") - safe_eyes = SafeEyes(system_locale, config) + safe_eyes = SafeEyes(system_locale, config, args) safe_eyes.start() - Timer(1.0, lambda: __evaluate_arguments(args, safe_eyes)).start() - Gtk.main() if __name__ == '__main__': diff --git a/safeeyes/safeeyes.py b/safeeyes/safeeyes.py index f9b8bf4c..144181b8 100644 --- a/safeeyes/safeeyes.py +++ b/safeeyes/safeeyes.py @@ -38,17 +38,21 @@ from safeeyes.ui.settings_dialog import SettingsDialog gi.require_version('Gtk', '3.0') -from gi.repository import Gtk +from gi.repository import Gtk, Gio SAFE_EYES_VERSION = "2.1.9" -class SafeEyes: +class SafeEyes(Gtk.Application): """ This class represents a runnable Safe Eyes instance. """ - def __init__(self, system_locale, config): + def __init__(self, system_locale, config, cli_args): + super().__init__( + application_id="io.github.slgobinath.SafeEyes", + flags=Gio.ApplicationFlags.IS_SERVICE + ) self.active = False self.break_screen = None self.safe_eyes_core = None @@ -58,6 +62,7 @@ def __init__(self, system_locale, config): self.settings_dialog_active = False self.rpc_server = None self._status = '' + self.cli_args = cli_args # Initialize the Safe Eyes Context self.context['version'] = SAFE_EYES_VERSION @@ -98,6 +103,9 @@ def __init__(self, system_locale, config): self.context['api']['postpone'] = self.safe_eyes_core.postpone self.context['api']['get_break_time'] = self.safe_eyes_core.get_break_time self.plugins_manager.init(self.context, self.config) + + self.hold() + atexit.register(self.persist_session) def start(self): @@ -114,6 +122,22 @@ def start(self): self.safe_eyes_core.start() self.handle_system_suspend() + self.run() + + def do_startup(self): + Gtk.Application.do_startup(self) + + if self.cli_args.about: + self.show_about() + elif self.cli_args.disable: + self.disable_safeeyes() + elif self.cli_args.enable: + self.enable_safeeyes() + elif self.cli_args.settings: + self.show_settings() + elif self.cli_args.take_break: + self.take_break() + def show_settings(self): """ Listen to tray icon Settings action and send the signal to Settings dialog. @@ -144,9 +168,8 @@ def quit(self): self.plugins_manager.exit() self.__stop_rpc_server() self.persist_session() - Gtk.main_quit() - # Exit all threads - os._exit(0) + + super().quit() def handle_suspend_callback(self, sleeping): """ diff --git a/safeeyes/ui/break_screen.py b/safeeyes/ui/break_screen.py index d1a2c25f..cce06740 100644 --- a/safeeyes/ui/break_screen.py +++ b/safeeyes/ui/break_screen.py @@ -151,12 +151,14 @@ def __show_break_screen(self, message, image_path, widget, tray_actions): # Lock the keyboard utility.start_thread(self.__lock_keyboard) - screen = Gtk.Window().get_screen() - no_of_monitors = screen.get_n_monitors() + display = Gdk.Display.get_default() + screen = display.get_default_screen() + no_of_monitors = display.get_n_monitors() logging.info("Show break screens in %d display(s)", no_of_monitors) - for monitor in range(no_of_monitors): - monitor_gemoetry = screen.get_monitor_geometry(monitor) + for monitor_num in range(no_of_monitors): + monitor = display.get_monitor(monitor_num) + monitor_gemoetry = monitor.get_geometry() x = monitor_gemoetry.x y = monitor_gemoetry.y @@ -165,7 +167,7 @@ def __show_break_screen(self, message, image_path, widget, tray_actions): builder.connect_signals(self) window = builder.get_object("window_main") - window.set_title("SafeEyes-" + str(monitor)) + window.set_title("SafeEyes-" + str(monitor_num)) lbl_message = builder.get_object("lbl_message") lbl_count = builder.get_object("lbl_count") lbl_widget = builder.get_object("lbl_widget") @@ -188,7 +190,7 @@ def __show_break_screen(self, message, image_path, widget, tray_actions): # Add the buttons if self.enable_postpone: # Add postpone button - btn_postpone = Gtk.Button(_('Postpone')) + btn_postpone = Gtk.Button.new_with_label(_('Postpone')) btn_postpone.get_style_context().add_class('btn_postpone') btn_postpone.connect('clicked', self.on_postpone_clicked) btn_postpone.set_visible(True) @@ -196,7 +198,7 @@ def __show_break_screen(self, message, image_path, widget, tray_actions): if not self.strict_break: # Add the skip button - btn_skip = Gtk.Button(_('Skip')) + btn_skip = Gtk.Button.new_with_label(_('Skip')) btn_skip.get_style_context().add_class('btn_skip') btn_skip.connect('clicked', self.on_skip_clicked) btn_skip.set_visible(True) @@ -222,7 +224,7 @@ def __show_break_screen(self, message, image_path, widget, tray_actions): window.resize(monitor_gemoetry.width, monitor_gemoetry.height) window.stick() window.set_keep_above(True) - window.fullscreen() + window.fullscreen_on_monitor(screen, monitor_num) window.present() # In other desktop environments, move the window after present window.move(x, y) diff --git a/safeeyes/ui/settings_dialog.py b/safeeyes/ui/settings_dialog.py index b8ef8e9e..f4bc4e33 100644 --- a/safeeyes/ui/settings_dialog.py +++ b/safeeyes/ui/settings_dialog.py @@ -170,14 +170,16 @@ def __confirmation_dialog_response(widget, response_id): self.__initialize(self.config) widget.destroy() - messagedialog = Gtk.MessageDialog(parent=self.window, - flags=Gtk.DialogFlags.MODAL, - type=Gtk.MessageType.WARNING, - buttons=(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL, - _("Reset"), Gtk.ResponseType.OK), - message_format=_("Are you sure you want to reset all settings to default?")) + messagedialog = Gtk.MessageDialog() + messagedialog.set_modal(True) + messagedialog.set_transient_for(self.window) + messagedialog.set_property('message_type', Gtk.MessageType.WARNING) + messagedialog.set_property('text', _("Are you sure you want to reset all settings to default?")) + messagedialog.set_property('secondary-text', _("You can't undo this action.")) + messagedialog.add_button('_Cancel', Gtk.ResponseType.CANCEL) + messagedialog.add_button(_("Reset"), Gtk.ResponseType.OK) + messagedialog.connect("response", __confirmation_dialog_response) - messagedialog.format_secondary_text(_("You can't undo this action.")) messagedialog.show() def __delete_break(self, break_config, is_short, on_remove): @@ -194,14 +196,16 @@ def __confirmation_dialog_response(widget, response_id): on_remove() widget.destroy() - messagedialog = Gtk.MessageDialog(parent=self.window, - flags=Gtk.DialogFlags.MODAL, - type=Gtk.MessageType.WARNING, - buttons=(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL, - _("Delete"), Gtk.ResponseType.OK), - message_format=_("Are you sure you want to delete this break?")) + messagedialog = Gtk.MessageDialog() + messagedialog.set_modal(True) + messagedialog.set_transient_for(self.window) + messagedialog.set_property('message_type', Gtk.MessageType.WARNING) + messagedialog.set_property('text', _("Are you sure you want to delete this break?")) + messagedialog.set_property('secondary-text', _("You can't undo this action.")) + messagedialog.add_button('_Cancel', Gtk.ResponseType.CANCEL) + messagedialog.add_button(_("Delete"), Gtk.ResponseType.OK) + messagedialog.connect("response", __confirmation_dialog_response) - messagedialog.format_secondary_text(_("You can't undo this action.")) messagedialog.show() def __create_plugin_item(self, plugin_config): From 56393cc22f713fafc1387b619e078528cc3064f5 Mon Sep 17 00:00:00 2001 From: Archisman Panigrahi Date: Sat, 6 Jul 2024 12:48:38 -0400 Subject: [PATCH 21/29] Fix icon in settings window --- safeeyes/glade/settings_dialog.glade | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/safeeyes/glade/settings_dialog.glade b/safeeyes/glade/settings_dialog.glade index aa1e0c1f..524dbf93 100644 --- a/safeeyes/glade/settings_dialog.glade +++ b/safeeyes/glade/settings_dialog.glade @@ -1,5 +1,5 @@ - +