diff --git a/README.md b/README.md index e8dbeabc..05cb37a8 100644 --- a/README.md +++ b/README.md @@ -121,14 +121,15 @@ Ensure to meet the following dependencies: - `gir1.2-notify-0.7` - `gir1.2-gtk-4.0` -- `ffmpeg` or `pipewire` (any of them works) +- `ffmpeg` or `pipewire` (for the audible alert plugin) - `python3` (>= 3.10.0) - `python3-gi` - `python3-babel` - `python3-croniter` - `python3-packaging` - `python3-xlib` (required on x11) -- **Optional**: Either `python3-pywayland` (provides smartpause in Wayland) or `xprintidle` (provides smartpause in x11). +- **Optional**: `pipewire`/`pipewire-tools`/`pipewire-utils` (depending on the distro) for providing `pw-dump` tool. This is for the "Disable on Screen Sharing" plugin. +- **Optional**: Either `python3-pywayland` (for "smartpause" plugin in Wayland) or `xprintidle` (for "smartpause" plugin in x11). **To install Safe Eyes from PyPI:** diff --git a/safeeyes/config/locale/ar/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/ar/LC_MESSAGES/safeeyes.po index 7dd381ad..942c23dd 100644 --- a/safeeyes/config/locale/ar/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/ar/LC_MESSAGES/safeeyes.po @@ -7,8 +7,8 @@ msgstr "" "Project-Id-Version: \n" "POT-Creation-Date: \n" "PO-Revision-Date: 2025-05-22 09:20+0000\n" -"Last-Translator: abdelbasset jabrane " -"\n" +"Last-Translator: abdelbasset jabrane \n" "Language-Team: Arabic \n" "Language: ar\n" @@ -541,6 +541,13 @@ msgstr "حدد عدد فترات الاستراحة التي يمكن تخطيه msgid "Skipped or postponed %(num)d/%(allowed)d breaks in a row" msgstr "تم تخطي أو تأجيل %(num)d/%(allowed)d من فترات الاستراحة على التوالي" +# plugin/screenshare +msgid "Disable on Screen Sharing" +msgstr "" + +msgid "Skip break if some app is sharing screen" +msgstr "" + # safeeyes/platform/io.github.slgobinath.SafeEyes.desktop msgid "RSI Prevention" msgstr "الوقاية من الإصابات الناتجة عن الإجهاد المتكرر للعينين" diff --git a/safeeyes/config/locale/bg/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/bg/LC_MESSAGES/safeeyes.po index f09f3316..98d3dff0 100644 --- a/safeeyes/config/locale/bg/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/bg/LC_MESSAGES/safeeyes.po @@ -526,6 +526,13 @@ msgstr "" msgid "Skipped or postponed %(num)d/%(allowed)d breaks in a row" msgstr "" +# plugin/screenshare +msgid "Disable on Screen Sharing" +msgstr "" + +msgid "Skip break if some app is sharing screen" +msgstr "" + # safeeyes/platform/io.github.slgobinath.SafeEyes.desktop msgid "RSI Prevention" msgstr "" diff --git a/safeeyes/config/locale/bn/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/bn/LC_MESSAGES/safeeyes.po index b08ecbbf..7c80facb 100644 --- a/safeeyes/config/locale/bn/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/bn/LC_MESSAGES/safeeyes.po @@ -528,13 +528,21 @@ msgstr "পরপর কতবার বিরতি স্থগিত কর msgid "Skipped or postponed %(num)d/%(allowed)d breaks in a row" msgstr "পরপর %(num)d/%(allowed)d টি বিরতি স্থগিত হয়েছে" +# plugin/screenshare +msgid "Disable on Screen Sharing" +msgstr "" + +msgid "Skip break if some app is sharing screen" +msgstr "" + # safeeyes/platform/io.github.slgobinath.SafeEyes.desktop msgid "RSI Prevention" msgstr "RSI প্রতিরোধ" msgid "" "Please install service providing tray icons for your desktop environment." -msgstr "অনুগ্রহ করে আপনার ডেস্কটপ পরিবেশের জন্য ট্রে আইকন প্রদানকারী সার্ভিসটি ইনস্টল করুন।" +msgstr "" +"অনুগ্রহ করে আপনার ডেস্কটপ পরিবেশের জন্য ট্রে আইকন প্রদানকারী সার্ভিসটি ইনস্টল করুন।" #, python-format msgid "Next long break at %s" @@ -551,7 +559,9 @@ msgstr "প্রয়োজনীয় প্লাগইন '%s' এর dependency msgid "" "Please install the dependencies or disable the plugin. To hide this message, " "you can also deactivate the plugin in the settings." -msgstr "অনুগ্রহ করে dependencyগুলো ইনস্টল করুন অথবা প্লাগইনটি নিষ্ক্রিয় করুন। এই বার্তাটি মুছে ফেলতে আপনি সেটিংসে প্লাগইনটি নিষ্ক্রিয়ও করতে পারেন।" +msgstr "" +"অনুগ্রহ করে dependencyগুলো ইনস্টল করুন অথবা প্লাগইনটি নিষ্ক্রিয় করুন। এই বার্তাটি মুছে " +"ফেলতে আপনি সেটিংসে প্লাগইনটি নিষ্ক্রিয়ও করতে পারেন।" msgid "Click here for more information" msgstr "আরও তথ্যের জন্য এখানে ক্লিক করুন" @@ -569,7 +579,9 @@ msgstr "লাইসেন্স:" msgid "" "Old stylesheet found at '%(old)s', ignoring. For custom styles, create a new " "stylesheet in '%(new)s' instead." -msgstr "পুরনো স্টাইলশীট '%(old)s' এ পাওয়া গেছে; এটি উপেক্ষা করা হচ্ছে। কাস্টম স্টাইলের জন্য '%(new)s' এ একটি নতুন স্টাইলশীট তৈরি করুন।" +msgstr "" +"পুরনো স্টাইলশীট '%(old)s' এ পাওয়া গেছে; এটি উপেক্ষা করা হচ্ছে। কাস্টম স্টাইলের জন্য " +"'%(new)s' এ একটি নতুন স্টাইলশীট তৈরি করুন।" msgid "Customizing the postpone and skip shortcuts does not work on Wayland." msgstr "Wayland-এ স্থগিত এবং বাতিল করার শর্টকাট কাস্টমাইজ করা কাজ করে না।" diff --git a/safeeyes/config/locale/bn_IN/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/bn_IN/LC_MESSAGES/safeeyes.po index 2f74ea81..793861bd 100644 --- a/safeeyes/config/locale/bn_IN/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/bn_IN/LC_MESSAGES/safeeyes.po @@ -8,8 +8,8 @@ msgstr "" "POT-Creation-Date: \n" "PO-Revision-Date: 2025-08-29 17:30+0000\n" "Last-Translator: Archisman Panigrahi \n" -"Language-Team: Bengali (India) \n" +"Language-Team: Bengali (India) \n" "Language: bn_IN\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -528,13 +528,21 @@ msgstr "পরপর কতবার বিরতি স্থগিত কর msgid "Skipped or postponed %(num)d/%(allowed)d breaks in a row" msgstr "পরপর %(num)d/%(allowed)d টি বিরতি স্থগিত হয়েছে" +# plugin/screenshare +msgid "Disable on Screen Sharing" +msgstr "" + +msgid "Skip break if some app is sharing screen" +msgstr "" + # safeeyes/platform/io.github.slgobinath.SafeEyes.desktop msgid "RSI Prevention" msgstr "RSI প্রতিরোধ" msgid "" "Please install service providing tray icons for your desktop environment." -msgstr "অনুগ্রহ করে আপনার ডেস্কটপ পরিবেশের জন্য ট্রে আইকন প্রদানকারী সার্ভিসটি ইনস্টল করুন।" +msgstr "" +"অনুগ্রহ করে আপনার ডেস্কটপ পরিবেশের জন্য ট্রে আইকন প্রদানকারী সার্ভিসটি ইনস্টল করুন।" #, python-format msgid "Next long break at %s" @@ -551,7 +559,9 @@ msgstr "প্রয়োজনীয় প্লাগইন '%s' এর dependency msgid "" "Please install the dependencies or disable the plugin. To hide this message, " "you can also deactivate the plugin in the settings." -msgstr "অনুগ্রহ করে dependencyগুলো ইনস্টল করুন অথবা প্লাগইনটি নিষ্ক্রিয় করুন। এই বার্তাটি মুছে ফেলতে আপনি সেটিংসে প্লাগইনটি নিষ্ক্রিয়ও করতে পারেন।" +msgstr "" +"অনুগ্রহ করে dependencyগুলো ইনস্টল করুন অথবা প্লাগইনটি নিষ্ক্রিয় করুন। এই বার্তাটি মুছে " +"ফেলতে আপনি সেটিংসে প্লাগইনটি নিষ্ক্রিয়ও করতে পারেন।" msgid "Click here for more information" msgstr "আরও তথ্যের জন্য এখানে ক্লিক করুন" @@ -569,7 +579,9 @@ msgstr "লাইসেন্স:" msgid "" "Old stylesheet found at '%(old)s', ignoring. For custom styles, create a new " "stylesheet in '%(new)s' instead." -msgstr "পুরনো স্টাইলশীট '%(old)s' এ পাওয়া গেছে; এটি উপেক্ষা করা হচ্ছে। কাস্টম স্টাইলের জন্য '%(new)s' এ একটি নতুন স্টাইলশীট তৈরি করুন।" +msgstr "" +"পুরনো স্টাইলশীট '%(old)s' এ পাওয়া গেছে; এটি উপেক্ষা করা হচ্ছে। কাস্টম স্টাইলের জন্য " +"'%(new)s' এ একটি নতুন স্টাইলশীট তৈরি করুন।" msgid "Customizing the postpone and skip shortcuts does not work on Wayland." msgstr "Wayland-এ স্থগিত এবং বাতিল করার শর্টকাট কাস্টমাইজ করা কাজ করে না।" diff --git a/safeeyes/config/locale/ca/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/ca/LC_MESSAGES/safeeyes.po index a1494aa2..990b3cb7 100644 --- a/safeeyes/config/locale/ca/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/ca/LC_MESSAGES/safeeyes.po @@ -536,6 +536,13 @@ msgstr "Limita quantes pauses seguides es poden ometre o posposar" msgid "Skipped or postponed %(num)d/%(allowed)d breaks in a row" msgstr "Heu saltat o posposat %(num)d/%(allowed)d pauses seguides" +# plugin/screenshare +msgid "Disable on Screen Sharing" +msgstr "" + +msgid "Skip break if some app is sharing screen" +msgstr "" + # safeeyes/platform/io.github.slgobinath.SafeEyes.desktop msgid "RSI Prevention" msgstr "Prevenció de lesions a causa de moviments repetitius" diff --git a/safeeyes/config/locale/cs/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/cs/LC_MESSAGES/safeeyes.po index e2e00f81..7389d1a6 100644 --- a/safeeyes/config/locale/cs/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/cs/LC_MESSAGES/safeeyes.po @@ -534,6 +534,13 @@ msgstr "Omezit počet přestávek, které lze vynechat nebo odložit za sebou" msgid "Skipped or postponed %(num)d/%(allowed)d breaks in a row" msgstr "Vynechané nebo odložené %(num)d/%(allowed)d přestávky za sebou" +# plugin/screenshare +msgid "Disable on Screen Sharing" +msgstr "" + +msgid "Skip break if some app is sharing screen" +msgstr "" + # safeeyes/platform/io.github.slgobinath.SafeEyes.desktop msgid "RSI Prevention" msgstr "Prevence poranění z opakovaného namáhání (RSI)" diff --git a/safeeyes/config/locale/da/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/da/LC_MESSAGES/safeeyes.po index fac45d64..5c50bd43 100644 --- a/safeeyes/config/locale/da/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/da/LC_MESSAGES/safeeyes.po @@ -527,6 +527,13 @@ msgstr "" msgid "Skipped or postponed %(num)d/%(allowed)d breaks in a row" msgstr "" +# plugin/screenshare +msgid "Disable on Screen Sharing" +msgstr "" + +msgid "Skip break if some app is sharing screen" +msgstr "" + # safeeyes/platform/io.github.slgobinath.SafeEyes.desktop msgid "RSI Prevention" msgstr "" diff --git a/safeeyes/config/locale/de/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/de/LC_MESSAGES/safeeyes.po index 8a85a936..e8caa9e6 100644 --- a/safeeyes/config/locale/de/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/de/LC_MESSAGES/safeeyes.po @@ -539,6 +539,13 @@ msgid "Skipped or postponed %(num)d/%(allowed)d breaks in a row" msgstr "" "%(num)d/%(allowed)d Pausen hintereinander übersprungen oder aufgeschoben" +# plugin/screenshare +msgid "Disable on Screen Sharing" +msgstr "" + +msgid "Skip break if some app is sharing screen" +msgstr "" + # safeeyes/platform/io.github.slgobinath.SafeEyes.desktop msgid "RSI Prevention" msgstr "RSI-Prävention" diff --git a/safeeyes/config/locale/eo/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/eo/LC_MESSAGES/safeeyes.po index 150d9ba0..4fc710fc 100644 --- a/safeeyes/config/locale/eo/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/eo/LC_MESSAGES/safeeyes.po @@ -529,6 +529,13 @@ msgstr "" msgid "Skipped or postponed %(num)d/%(allowed)d breaks in a row" msgstr "" +# plugin/screenshare +msgid "Disable on Screen Sharing" +msgstr "" + +msgid "Skip break if some app is sharing screen" +msgstr "" + # safeeyes/platform/io.github.slgobinath.SafeEyes.desktop msgid "RSI Prevention" msgstr "" diff --git a/safeeyes/config/locale/es/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/es/LC_MESSAGES/safeeyes.po index 13207282..6dd6c042 100644 --- a/safeeyes/config/locale/es/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/es/LC_MESSAGES/safeeyes.po @@ -536,6 +536,13 @@ msgstr "" msgid "Skipped or postponed %(num)d/%(allowed)d breaks in a row" msgstr "Se ha(n) saltado o pospuesto %(num)d/%(allowed)d pausa(s) seguida(s)" +# plugin/screenshare +msgid "Disable on Screen Sharing" +msgstr "" + +msgid "Skip break if some app is sharing screen" +msgstr "" + # safeeyes/platform/io.github.slgobinath.SafeEyes.desktop msgid "RSI Prevention" msgstr "Prevención de RSI" diff --git a/safeeyes/config/locale/et/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/et/LC_MESSAGES/safeeyes.po index 3bbaa11c..d2f6e4ec 100644 --- a/safeeyes/config/locale/et/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/et/LC_MESSAGES/safeeyes.po @@ -528,6 +528,13 @@ msgstr "Kui mitu pausi võid järjest vahele jätta või edasi lükata" msgid "Skipped or postponed %(num)d/%(allowed)d breaks in a row" msgstr "Järjest vahelejäetud või edasilükatatud %(num)d/%(allowed)d pausi" +# plugin/screenshare +msgid "Disable on Screen Sharing" +msgstr "" + +msgid "Skip break if some app is sharing screen" +msgstr "" + # safeeyes/platform/io.github.slgobinath.SafeEyes.desktop msgid "RSI Prevention" msgstr "RSI ennetus" diff --git a/safeeyes/config/locale/eu/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/eu/LC_MESSAGES/safeeyes.po index 450ee04e..e920d704 100644 --- a/safeeyes/config/locale/eu/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/eu/LC_MESSAGES/safeeyes.po @@ -533,6 +533,13 @@ msgstr "" msgid "Skipped or postponed %(num)d/%(allowed)d breaks in a row" msgstr "" +# plugin/screenshare +msgid "Disable on Screen Sharing" +msgstr "" + +msgid "Skip break if some app is sharing screen" +msgstr "" + # safeeyes/platform/io.github.slgobinath.SafeEyes.desktop msgid "RSI Prevention" msgstr "" diff --git a/safeeyes/config/locale/fa/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/fa/LC_MESSAGES/safeeyes.po index 456276cb..c68dbb99 100644 --- a/safeeyes/config/locale/fa/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/fa/LC_MESSAGES/safeeyes.po @@ -528,6 +528,13 @@ msgstr "تعداد استراحت‌ها را که می‌توان پشت‌سر msgid "Skipped or postponed %(num)d/%(allowed)d breaks in a row" msgstr "%(num)d/%(allowed)d استراحت‌ها پشت‌سرهم رد یا به تعویق افتاده‌اند" +# plugin/screenshare +msgid "Disable on Screen Sharing" +msgstr "" + +msgid "Skip break if some app is sharing screen" +msgstr "" + # safeeyes/platform/io.github.slgobinath.SafeEyes.desktop msgid "RSI Prevention" msgstr "جلوگیری از آر‌ اس آی" diff --git a/safeeyes/config/locale/fi/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/fi/LC_MESSAGES/safeeyes.po index 2b991175..d3fb5019 100644 --- a/safeeyes/config/locale/fi/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/fi/LC_MESSAGES/safeeyes.po @@ -79,7 +79,9 @@ msgstr "" # Description in about dialog # Safe Eyes protects your eyes from eye strain (asthenopia) by reminding you to take breaks while you're working long hours at the computer -msgid "Safe Eyes protects your eyes from eye strain (asthenopia) by reminding you to take breaks while you're working long hours at the computer" +msgid "" +"Safe Eyes protects your eyes from eye strain (asthenopia) by reminding you " +"to take breaks while you're working long hours at the computer" msgstr "" # About dialog @@ -512,11 +514,19 @@ msgstr "" msgid "Skipped or postponed %(num)d/%(allowed)d breaks in a row" msgstr "" +# plugin/screenshare +msgid "Disable on Screen Sharing" +msgstr "" + +msgid "Skip break if some app is sharing screen" +msgstr "" + # safeeyes/platform/io.github.slgobinath.SafeEyes.desktop msgid "RSI Prevention" msgstr "" -msgid "Please install service providing tray icons for your desktop environment." +msgid "" +"Please install service providing tray icons for your desktop environment." msgstr "" #, python-format @@ -531,7 +541,9 @@ msgstr "" msgid "The required plugin '%s' is missing dependencies!" msgstr "" -msgid "Please install the dependencies or disable the plugin. To hide this message, you can also deactivate the plugin in the settings." +msgid "" +"Please install the dependencies or disable the plugin. To hide this message, " +"you can also deactivate the plugin in the settings." msgstr "" msgid "Click here for more information" @@ -547,7 +559,9 @@ msgid "License:" msgstr "" #, python-format -msgid "Old stylesheet found at '%(old)s', ignoring. For custom styles, create a new stylesheet in '%(new)s' instead." +msgid "" +"Old stylesheet found at '%(old)s', ignoring. For custom styles, create a new " +"stylesheet in '%(new)s' instead." msgstr "" msgid "Customizing the postpone and skip shortcuts does not work on Wayland." diff --git a/safeeyes/config/locale/fr/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/fr/LC_MESSAGES/safeeyes.po index fcf0ddc0..513b8bba 100644 --- a/safeeyes/config/locale/fr/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/fr/LC_MESSAGES/safeeyes.po @@ -7,8 +7,8 @@ msgstr "" "Project-Id-Version: \n" "POT-Creation-Date: \n" "PO-Revision-Date: 2025-08-19 19:02+0000\n" -"Last-Translator: AO Localisation Lab " -"\n" +"Last-Translator: AO Localisation Lab \n" "Language-Team: French \n" "Language: fr\n" @@ -540,6 +540,13 @@ msgstr "Limiter le nombre de pauses sautées ou reportées d’affilée" msgid "Skipped or postponed %(num)d/%(allowed)d breaks in a row" msgstr "%(num)d/%(allowed)d pauses sautées ou reportées d’affilée" +# plugin/screenshare +msgid "Disable on Screen Sharing" +msgstr "" + +msgid "Skip break if some app is sharing screen" +msgstr "" + # safeeyes/platform/io.github.slgobinath.SafeEyes.desktop msgid "RSI Prevention" msgstr "Prévention des lésions attribuables au travail répétitif" diff --git a/safeeyes/config/locale/he/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/he/LC_MESSAGES/safeeyes.po index 95e209c9..d94ff607 100644 --- a/safeeyes/config/locale/he/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/he/LC_MESSAGES/safeeyes.po @@ -528,6 +528,13 @@ msgstr "הגבלת כמות הפעמים שניתן לדחות או לדלג ב msgid "Skipped or postponed %(num)d/%(allowed)d breaks in a row" msgstr "דילגת על או דחית %(num)d/%(allowed)d הפסקות ברצף" +# plugin/screenshare +msgid "Disable on Screen Sharing" +msgstr "" + +msgid "Skip break if some app is sharing screen" +msgstr "" + # safeeyes/platform/io.github.slgobinath.SafeEyes.desktop msgid "RSI Prevention" msgstr "מניעת פציעת מאמץ חוזרני" diff --git a/safeeyes/config/locale/hi/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/hi/LC_MESSAGES/safeeyes.po index f95a3086..ef994027 100644 --- a/safeeyes/config/locale/hi/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/hi/LC_MESSAGES/safeeyes.po @@ -526,6 +526,13 @@ msgstr "" msgid "Skipped or postponed %(num)d/%(allowed)d breaks in a row" msgstr "" +# plugin/screenshare +msgid "Disable on Screen Sharing" +msgstr "" + +msgid "Skip break if some app is sharing screen" +msgstr "" + # safeeyes/platform/io.github.slgobinath.SafeEyes.desktop msgid "RSI Prevention" msgstr "" diff --git a/safeeyes/config/locale/hu/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/hu/LC_MESSAGES/safeeyes.po index 77b95ad9..abd02d2e 100644 --- a/safeeyes/config/locale/hu/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/hu/LC_MESSAGES/safeeyes.po @@ -528,6 +528,13 @@ msgstr "" msgid "Skipped or postponed %(num)d/%(allowed)d breaks in a row" msgstr "" +# plugin/screenshare +msgid "Disable on Screen Sharing" +msgstr "" + +msgid "Skip break if some app is sharing screen" +msgstr "" + # safeeyes/platform/io.github.slgobinath.SafeEyes.desktop msgid "RSI Prevention" msgstr "" diff --git a/safeeyes/config/locale/id/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/id/LC_MESSAGES/safeeyes.po index 9557ec78..1f9bbf81 100644 --- a/safeeyes/config/locale/id/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/id/LC_MESSAGES/safeeyes.po @@ -529,6 +529,13 @@ msgstr "" msgid "Skipped or postponed %(num)d/%(allowed)d breaks in a row" msgstr "" +# plugin/screenshare +msgid "Disable on Screen Sharing" +msgstr "" + +msgid "Skip break if some app is sharing screen" +msgstr "" + # safeeyes/platform/io.github.slgobinath.SafeEyes.desktop msgid "RSI Prevention" msgstr "" diff --git a/safeeyes/config/locale/it/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/it/LC_MESSAGES/safeeyes.po index a450c357..dea8986e 100644 --- a/safeeyes/config/locale/it/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/it/LC_MESSAGES/safeeyes.po @@ -535,6 +535,13 @@ msgstr "" msgid "Skipped or postponed %(num)d/%(allowed)d breaks in a row" msgstr "%(num)d/%(allowed)d pause saltate o posticipate di seguito" +# plugin/screenshare +msgid "Disable on Screen Sharing" +msgstr "" + +msgid "Skip break if some app is sharing screen" +msgstr "" + # safeeyes/platform/io.github.slgobinath.SafeEyes.desktop msgid "RSI Prevention" msgstr "Prevenzione RSI" @@ -585,7 +592,8 @@ msgstr "" "personalizzati, crea un nuovo foglio di stile in %(new)s invece." msgid "Customizing the postpone and skip shortcuts does not work on Wayland." -msgstr "Personalizzare le scorciatoie postponi e salta non funziona in Wayland." +msgstr "" +"Personalizzare le scorciatoie postponi e salta non funziona in Wayland." msgid "Safe Eyes - Error" msgstr "Safe Eyes - Errore" diff --git a/safeeyes/config/locale/kn/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/kn/LC_MESSAGES/safeeyes.po index e83ff12c..37a45669 100644 --- a/safeeyes/config/locale/kn/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/kn/LC_MESSAGES/safeeyes.po @@ -523,6 +523,13 @@ msgstr "" msgid "Skipped or postponed %(num)d/%(allowed)d breaks in a row" msgstr "" +# plugin/screenshare +msgid "Disable on Screen Sharing" +msgstr "" + +msgid "Skip break if some app is sharing screen" +msgstr "" + # safeeyes/platform/io.github.slgobinath.SafeEyes.desktop msgid "RSI Prevention" msgstr "" diff --git a/safeeyes/config/locale/ko/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/ko/LC_MESSAGES/safeeyes.po index 9fb2e01c..e63a1081 100644 --- a/safeeyes/config/locale/ko/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/ko/LC_MESSAGES/safeeyes.po @@ -523,6 +523,13 @@ msgstr "" msgid "Skipped or postponed %(num)d/%(allowed)d breaks in a row" msgstr "" +# plugin/screenshare +msgid "Disable on Screen Sharing" +msgstr "" + +msgid "Skip break if some app is sharing screen" +msgstr "" + # safeeyes/platform/io.github.slgobinath.SafeEyes.desktop msgid "RSI Prevention" msgstr "" diff --git a/safeeyes/config/locale/lt/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/lt/LC_MESSAGES/safeeyes.po index 18ccfa2b..42c1be2f 100644 --- a/safeeyes/config/locale/lt/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/lt/LC_MESSAGES/safeeyes.po @@ -536,6 +536,13 @@ msgstr "Apriboti, kiek kartų galima iš eilės praleisti arba atidėti pertrauk msgid "Skipped or postponed %(num)d/%(allowed)d breaks in a row" msgstr "Paeiliui praleistos arba atidėtos pertraukos: %(num)d/%(allowed)d" +# plugin/screenshare +msgid "Disable on Screen Sharing" +msgstr "" + +msgid "Skip break if some app is sharing screen" +msgstr "" + # safeeyes/platform/io.github.slgobinath.SafeEyes.desktop msgid "RSI Prevention" msgstr "Apsaugokite savo akis nuo įtampos" diff --git a/safeeyes/config/locale/lv/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/lv/LC_MESSAGES/safeeyes.po index 2f2752d9..fd24f98f 100644 --- a/safeeyes/config/locale/lv/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/lv/LC_MESSAGES/safeeyes.po @@ -445,6 +445,13 @@ msgstr "" msgid "Skipped or postponed %(num)d/%(allowed)d breaks in a row" msgstr "" +# plugin/screenshare +msgid "Disable on Screen Sharing" +msgstr "" + +msgid "Skip break if some app is sharing screen" +msgstr "" + # safeeyes/platform/io.github.slgobinath.SafeEyes.desktop msgid "RSI Prevention" msgstr "" diff --git a/safeeyes/config/locale/mk/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/mk/LC_MESSAGES/safeeyes.po index 26b7e2e0..f8343e47 100644 --- a/safeeyes/config/locale/mk/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/mk/LC_MESSAGES/safeeyes.po @@ -528,6 +528,13 @@ msgstr "" msgid "Skipped or postponed %(num)d/%(allowed)d breaks in a row" msgstr "" +# plugin/screenshare +msgid "Disable on Screen Sharing" +msgstr "" + +msgid "Skip break if some app is sharing screen" +msgstr "" + # safeeyes/platform/io.github.slgobinath.SafeEyes.desktop msgid "RSI Prevention" msgstr "" diff --git a/safeeyes/config/locale/mr/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/mr/LC_MESSAGES/safeeyes.po index 7c83b098..07e25c6c 100644 --- a/safeeyes/config/locale/mr/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/mr/LC_MESSAGES/safeeyes.po @@ -526,6 +526,13 @@ msgstr "" msgid "Skipped or postponed %(num)d/%(allowed)d breaks in a row" msgstr "" +# plugin/screenshare +msgid "Disable on Screen Sharing" +msgstr "" + +msgid "Skip break if some app is sharing screen" +msgstr "" + # safeeyes/platform/io.github.slgobinath.SafeEyes.desktop msgid "RSI Prevention" msgstr "" diff --git a/safeeyes/config/locale/nb/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/nb/LC_MESSAGES/safeeyes.po index 93013d73..a9fefb30 100644 --- a/safeeyes/config/locale/nb/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/nb/LC_MESSAGES/safeeyes.po @@ -530,6 +530,13 @@ msgstr "" msgid "Skipped or postponed %(num)d/%(allowed)d breaks in a row" msgstr "" +# plugin/screenshare +msgid "Disable on Screen Sharing" +msgstr "" + +msgid "Skip break if some app is sharing screen" +msgstr "" + # safeeyes/platform/io.github.slgobinath.SafeEyes.desktop msgid "RSI Prevention" msgstr "" diff --git a/safeeyes/config/locale/nl/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/nl/LC_MESSAGES/safeeyes.po index 82169122..b608a165 100644 --- a/safeeyes/config/locale/nl/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/nl/LC_MESSAGES/safeeyes.po @@ -535,6 +535,13 @@ msgstr "" msgid "Skipped or postponed %(num)d/%(allowed)d breaks in a row" msgstr "%(num)d/%(allowed)d pauzes achter elkaar uitgesteld of overgeslagen" +# plugin/screenshare +msgid "Disable on Screen Sharing" +msgstr "" + +msgid "Skip break if some app is sharing screen" +msgstr "" + # safeeyes/platform/io.github.slgobinath.SafeEyes.desktop msgid "RSI Prevention" msgstr "RSI voorkomen" diff --git a/safeeyes/config/locale/pl/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/pl/LC_MESSAGES/safeeyes.po index 7b43c805..bdf5dcc5 100644 --- a/safeeyes/config/locale/pl/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/pl/LC_MESSAGES/safeeyes.po @@ -534,6 +534,13 @@ msgstr "" msgid "Skipped or postponed %(num)d/%(allowed)d breaks in a row" msgstr "" +# plugin/screenshare +msgid "Disable on Screen Sharing" +msgstr "" + +msgid "Skip break if some app is sharing screen" +msgstr "" + # safeeyes/platform/io.github.slgobinath.SafeEyes.desktop msgid "RSI Prevention" msgstr "" diff --git a/safeeyes/config/locale/pt/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/pt/LC_MESSAGES/safeeyes.po index 0b1d8187..53ec62ea 100644 --- a/safeeyes/config/locale/pt/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/pt/LC_MESSAGES/safeeyes.po @@ -531,6 +531,13 @@ msgstr "Limitar quantas pausas podem ser puladas ou adiadas em sequência" msgid "Skipped or postponed %(num)d/%(allowed)d breaks in a row" msgstr "%(num)d%(allowed)d pausas seguidas ignoradas ou adiadas" +# plugin/screenshare +msgid "Disable on Screen Sharing" +msgstr "" + +msgid "Skip break if some app is sharing screen" +msgstr "" + # safeeyes/platform/io.github.slgobinath.SafeEyes.desktop msgid "RSI Prevention" msgstr "Prevenção de LER" diff --git a/safeeyes/config/locale/pt_BR/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/pt_BR/LC_MESSAGES/safeeyes.po index e5d18fd4..f3e5e3ff 100644 --- a/safeeyes/config/locale/pt_BR/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/pt_BR/LC_MESSAGES/safeeyes.po @@ -535,6 +535,13 @@ msgstr "" msgid "Skipped or postponed %(num)d/%(allowed)d breaks in a row" msgstr "" +# plugin/screenshare +msgid "Disable on Screen Sharing" +msgstr "" + +msgid "Skip break if some app is sharing screen" +msgstr "" + # safeeyes/platform/io.github.slgobinath.SafeEyes.desktop msgid "RSI Prevention" msgstr "" diff --git a/safeeyes/config/locale/ru/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/ru/LC_MESSAGES/safeeyes.po index 49376e27..b79cd1b1 100644 --- a/safeeyes/config/locale/ru/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/ru/LC_MESSAGES/safeeyes.po @@ -535,6 +535,13 @@ msgstr "Какое количество перерывов можно пропу msgid "Skipped or postponed %(num)d/%(allowed)d breaks in a row" msgstr "Пропущенные или отложенные %(num)d/%(allowed)d перерывы подряд" +# plugin/screenshare +msgid "Disable on Screen Sharing" +msgstr "" + +msgid "Skip break if some app is sharing screen" +msgstr "" + # safeeyes/platform/io.github.slgobinath.SafeEyes.desktop msgid "RSI Prevention" msgstr "Профилактика RSI" diff --git a/safeeyes/config/locale/safeeyes.pot b/safeeyes/config/locale/safeeyes.pot index 2b991175..e839fce9 100644 --- a/safeeyes/config/locale/safeeyes.pot +++ b/safeeyes/config/locale/safeeyes.pot @@ -512,6 +512,13 @@ msgstr "" msgid "Skipped or postponed %(num)d/%(allowed)d breaks in a row" msgstr "" +# plugin/screenshare +msgid "Disable on Screen Sharing" +msgstr "" + +msgid "Skip break if some app is sharing screen" +msgstr "" + # safeeyes/platform/io.github.slgobinath.SafeEyes.desktop msgid "RSI Prevention" msgstr "" diff --git a/safeeyes/config/locale/sk/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/sk/LC_MESSAGES/safeeyes.po index 868579fc..68cd0f59 100644 --- a/safeeyes/config/locale/sk/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/sk/LC_MESSAGES/safeeyes.po @@ -532,6 +532,13 @@ msgstr "Limit, koľko prestávky je možné preskočiť alebo odložiť v rade" msgid "Skipped or postponed %(num)d/%(allowed)d breaks in a row" msgstr "Sklo alebo odložené %(num)d/%(allowed)d prestávky v rade" +# plugin/screenshare +msgid "Disable on Screen Sharing" +msgstr "" + +msgid "Skip break if some app is sharing screen" +msgstr "" + # safeeyes/platform/io.github.slgobinath.SafeEyes.desktop msgid "RSI Prevention" msgstr "Prevencia RSI" diff --git a/safeeyes/config/locale/sr/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/sr/LC_MESSAGES/safeeyes.po index eaf20aeb..67e0abd1 100644 --- a/safeeyes/config/locale/sr/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/sr/LC_MESSAGES/safeeyes.po @@ -539,6 +539,13 @@ msgstr "" msgid "Skipped or postponed %(num)d/%(allowed)d breaks in a row" msgstr "" +# plugin/screenshare +msgid "Disable on Screen Sharing" +msgstr "" + +msgid "Skip break if some app is sharing screen" +msgstr "" + # safeeyes/platform/io.github.slgobinath.SafeEyes.desktop msgid "RSI Prevention" msgstr "" diff --git a/safeeyes/config/locale/sv/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/sv/LC_MESSAGES/safeeyes.po index 4c826838..76f79abd 100644 --- a/safeeyes/config/locale/sv/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/sv/LC_MESSAGES/safeeyes.po @@ -528,6 +528,13 @@ msgstr "" msgid "Skipped or postponed %(num)d/%(allowed)d breaks in a row" msgstr "" +# plugin/screenshare +msgid "Disable on Screen Sharing" +msgstr "" + +msgid "Skip break if some app is sharing screen" +msgstr "" + # safeeyes/platform/io.github.slgobinath.SafeEyes.desktop msgid "RSI Prevention" msgstr "" diff --git a/safeeyes/config/locale/ta/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/ta/LC_MESSAGES/safeeyes.po index 02a79873..0c13d544 100644 --- a/safeeyes/config/locale/ta/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/ta/LC_MESSAGES/safeeyes.po @@ -532,6 +532,13 @@ msgid "Skipped or postponed %(num)d/%(allowed)d breaks in a row" msgstr "" "ஒரு வரிசையில் %(num)d/ %(allowed)d இடைவெளிகளைத் தவிர்க்கவும் அல்லது ஒத்திவைக்கவும்" +# plugin/screenshare +msgid "Disable on Screen Sharing" +msgstr "" + +msgid "Skip break if some app is sharing screen" +msgstr "" + # safeeyes/platform/io.github.slgobinath.SafeEyes.desktop msgid "RSI Prevention" msgstr "ஆர்.எச்.ஐ தடுப்பு" diff --git a/safeeyes/config/locale/tr/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/tr/LC_MESSAGES/safeeyes.po index c65c22f2..43c382cd 100644 --- a/safeeyes/config/locale/tr/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/tr/LC_MESSAGES/safeeyes.po @@ -533,6 +533,13 @@ msgstr "" msgid "Skipped or postponed %(num)d/%(allowed)d breaks in a row" msgstr "Arka arkaya %(num)d/%(allowed)d mola geçildi veya ertelendi" +# plugin/screenshare +msgid "Disable on Screen Sharing" +msgstr "" + +msgid "Skip break if some app is sharing screen" +msgstr "" + # safeeyes/platform/io.github.slgobinath.SafeEyes.desktop msgid "RSI Prevention" msgstr "Tekrarlayan zorlanma yaralanmalarının önlenmesi" diff --git a/safeeyes/config/locale/ug/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/ug/LC_MESSAGES/safeeyes.po index ed66aa91..81a6bc19 100644 --- a/safeeyes/config/locale/ug/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/ug/LC_MESSAGES/safeeyes.po @@ -522,6 +522,13 @@ msgstr "" msgid "Skipped or postponed %(num)d/%(allowed)d breaks in a row" msgstr "" +# plugin/screenshare +msgid "Disable on Screen Sharing" +msgstr "" + +msgid "Skip break if some app is sharing screen" +msgstr "" + # safeeyes/platform/io.github.slgobinath.SafeEyes.desktop msgid "RSI Prevention" msgstr "" diff --git a/safeeyes/config/locale/uk/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/uk/LC_MESSAGES/safeeyes.po index d60b9416..9a4f6e62 100644 --- a/safeeyes/config/locale/uk/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/uk/LC_MESSAGES/safeeyes.po @@ -535,6 +535,13 @@ msgstr "" msgid "Skipped or postponed %(num)d/%(allowed)d breaks in a row" msgstr "" +# plugin/screenshare +msgid "Disable on Screen Sharing" +msgstr "" + +msgid "Skip break if some app is sharing screen" +msgstr "" + # safeeyes/platform/io.github.slgobinath.SafeEyes.desktop msgid "RSI Prevention" msgstr "" diff --git a/safeeyes/config/locale/uz_Latn/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/uz_Latn/LC_MESSAGES/safeeyes.po index 19ef1fc8..1eee25af 100644 --- a/safeeyes/config/locale/uz_Latn/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/uz_Latn/LC_MESSAGES/safeeyes.po @@ -522,6 +522,13 @@ msgstr "" msgid "Skipped or postponed %(num)d/%(allowed)d breaks in a row" msgstr "" +# plugin/screenshare +msgid "Disable on Screen Sharing" +msgstr "" + +msgid "Skip break if some app is sharing screen" +msgstr "" + # safeeyes/platform/io.github.slgobinath.SafeEyes.desktop msgid "RSI Prevention" msgstr "" diff --git a/safeeyes/config/locale/vi/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/vi/LC_MESSAGES/safeeyes.po index 4c24f160..ebffca81 100644 --- a/safeeyes/config/locale/vi/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/vi/LC_MESSAGES/safeeyes.po @@ -529,6 +529,13 @@ msgstr "" msgid "Skipped or postponed %(num)d/%(allowed)d breaks in a row" msgstr "" +# plugin/screenshare +msgid "Disable on Screen Sharing" +msgstr "" + +msgid "Skip break if some app is sharing screen" +msgstr "" + # safeeyes/platform/io.github.slgobinath.SafeEyes.desktop msgid "RSI Prevention" msgstr "" diff --git a/safeeyes/config/locale/zh_CN/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/zh_CN/LC_MESSAGES/safeeyes.po index 35ba10d2..749e145f 100644 --- a/safeeyes/config/locale/zh_CN/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/zh_CN/LC_MESSAGES/safeeyes.po @@ -525,6 +525,13 @@ msgstr "限制连续跳过或推迟的次数" msgid "Skipped or postponed %(num)d/%(allowed)d breaks in a row" msgstr "连续跳过或推迟休息 %(num)d/%(allowed)d 次" +# plugin/screenshare +msgid "Disable on Screen Sharing" +msgstr "" + +msgid "Skip break if some app is sharing screen" +msgstr "" + # safeeyes/platform/io.github.slgobinath.SafeEyes.desktop msgid "RSI Prevention" msgstr "RSI 预防" diff --git a/safeeyes/config/locale/zh_TW/LC_MESSAGES/safeeyes.po b/safeeyes/config/locale/zh_TW/LC_MESSAGES/safeeyes.po index 3f6af813..2a865fc1 100644 --- a/safeeyes/config/locale/zh_TW/LC_MESSAGES/safeeyes.po +++ b/safeeyes/config/locale/zh_TW/LC_MESSAGES/safeeyes.po @@ -523,6 +523,13 @@ msgstr "限制可以連續跳過或延遲多少次休息" msgid "Skipped or postponed %(num)d/%(allowed)d breaks in a row" msgstr "跳過或延遲 %(num)d/%(allowed)d 個休息" +# plugin/screenshare +msgid "Disable on Screen Sharing" +msgstr "" + +msgid "Skip break if some app is sharing screen" +msgstr "" + # safeeyes/platform/io.github.slgobinath.SafeEyes.desktop msgid "RSI Prevention" msgstr "RSI 預防" diff --git a/safeeyes/plugins/screenshare/config.json b/safeeyes/plugins/screenshare/config.json new file mode 100644 index 00000000..6b21534b --- /dev/null +++ b/safeeyes/plugins/screenshare/config.json @@ -0,0 +1,16 @@ +{ + "meta": { + "name": "Disable on Screen Sharing", + "description": "Skip break if some app is sharing screen", + "version": "0.1" + }, + "dependencies": { + "python_modules": [], + "shell_commands": ["pw-dump"], + "operating_systems": [], + "desktop_environments": [], + "resources": [] + }, + "settings": [], + "break_override_allowed": true +} diff --git a/safeeyes/plugins/screenshare/dependency_checker.py b/safeeyes/plugins/screenshare/dependency_checker.py new file mode 100644 index 00000000..d19b6632 --- /dev/null +++ b/safeeyes/plugins/screenshare/dependency_checker.py @@ -0,0 +1,30 @@ +# Safe Eyes is a utility to remind you to take break frequently +# to protect your eyes from eye strain. + +# Copyright (C) 2017 Gobinath +# Copyright (C) 2025 Archisman Panigrahi + + +# 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 . + +from safeeyes import utility +from safeeyes.translations import translate as _ + + +def validate(plugin_config, plugin_settings): + command = "pw-dump" + if not utility.command_exist(command): + return _("Please install the command-line tool '%s'") % command + else: + return None diff --git a/safeeyes/plugins/screenshare/icon.png b/safeeyes/plugins/screenshare/icon.png new file mode 100644 index 00000000..6fc65037 Binary files /dev/null and b/safeeyes/plugins/screenshare/icon.png differ diff --git a/safeeyes/plugins/screenshare/plugin.py b/safeeyes/plugins/screenshare/plugin.py new file mode 100644 index 00000000..dee95b93 --- /dev/null +++ b/safeeyes/plugins/screenshare/plugin.py @@ -0,0 +1,128 @@ +#!/usr/bin/env python +# Safe Eyes - Screen Share Do Not Disturb plugin +# Skips breaks while a screen share is active (detected via PipeWire). +# +# Copyright (C) 2025 Archisman Panigrahi +# License: GPL-3.0-or-later +# This program was written with the help of copilot + +import json +import subprocess +from typing import Any, Dict, List + +# Plugin globals populated at init +_context = None +_config: Dict[str, Any] = {} + +# Default heuristics: known producers and keywords commonly present +_DEFAULT_PRODUCERS = { + "gnome-shell", + "gnome-shell-wayland", + "mutter", + "kwin", + "kwin_x11", + "kwin_wayland", + "xdg-desktop-portal-wlr", + "xdg-desktop-portal-gnome", + "xdg-desktop-portal-kde", + "xdg-desktop-portal-gtk", # Xfce, MATE, and other GTK-based DEs + "xdg-desktop-portal-xapp", # Cinnamon + "wlroots", + "gamescope", + "xfwm4", # Xfce window manager + "cinnamon", # Cinnamon compositor + "marco", # MATE window manager + "gala", # Pantheon (elementary OS) compositor +} +_DEFAULT_KEYWORDS = {"screencast", "screen", "desktop", "monitor"} + + +def _load_config(plugin_config: Dict[str, Any]) -> None: + global _config + # Allow users to extend or override heuristics if needed + _config = { + "producers": set(_DEFAULT_PRODUCERS) + | set(map(str.lower, plugin_config.get("producers", []))), + "keywords": set(_DEFAULT_KEYWORDS) + | set(map(str.lower, plugin_config.get("keywords", []))), + # Set to True to log each Video/Source node we see (debugging) + "log_nodes": bool(plugin_config.get("log_nodes", False)), + } + + +def _pw_dump_nodes() -> List[Dict[str, Any]]: + """ + Returns a list of PipeWire node objects (JSON) or an empty list on failure. + Uses `pw-dump -N` to keep output minimal. + """ + try: + out = subprocess.check_output(["pw-dump", "-N"], text=True) + nodes = json.loads(out) + if not isinstance(nodes, list): + return [] + return nodes + except Exception: + return [] + + +def _node_is_screencast(node: Dict[str, Any]) -> bool: + """ + Heuristic to decide if a PipeWire node corresponds to a screen share. + Looks for media.class == Video/Source and compositor/portal producers, + or descriptive hints like 'screen'/'screencast' in node metadata. + """ + if node.get("type") != "PipeWire:Interface:Node": + return False + + props = (node.get("info") or {}).get("props") or {} + if props.get("media.class") != "Video/Source": + return False + + app_name = str(props.get("application.name", "")).lower() + node_name = str(props.get("node.name", "")).lower() + node_desc = str(props.get("node.description", "")).lower() + + producers = _config.get("producers", _DEFAULT_PRODUCERS) + keywords = _config.get("keywords", _DEFAULT_KEYWORDS) + + if app_name in producers: + return True + + text = f"{node_name} {node_desc}" + if any(k in text for k in keywords): + return True + + return False + + +def _is_screencast_active_pipewire() -> bool: + # Return True if any PipeWire node matches our screencast heuristic. + # Avoid printing or exposing application names. + nodes = _pw_dump_nodes() + return any(_node_is_screencast(n) for n in nodes) + + +def init(ctx, safeeyes_config, plugin_config): + global _context + _context = ctx + _load_config(plugin_config or {}) + + +def on_pre_break(break_obj): + """ + Lifecycle method executes before the pre-break period. + Return True to skip break. + """ + if _is_screencast_active_pipewire(): + return True + return False + + +def on_start_break(break_obj): + """ + Lifecycle method executes just before the break. + Return True to skip break. + """ + if _is_screencast_active_pipewire(): + return True + return False