diff --git a/config/settings/settings.conf b/config/settings/settings.conf index 9e7c5f8a..d66d0934 100644 --- a/config/settings/settings.conf +++ b/config/settings/settings.conf @@ -45,6 +45,12 @@ rate=0.5 pitch=0.5 # Pitch for capital letters capital_pitch=0.9 +# How to indicate capital letters: +# pitch = change speech pitch (uses capital_pitch value) +# beep = play Caps.wav sound icon +# both = play beep AND change pitch +# none = no special indication +capital_indicator=pitch # Volume controls the loudness of the voice, select from 0, quietest, to 1.0, loudest. volume=1.0 @@ -243,20 +249,6 @@ leave_review_on_cursor_change=True # Exit review mode when switching to a different TTY/screen leave_review_on_screen_change=True -[promote] -# Enable promoting (announcing) important text updates automatically -enabled=True -# Seconds of inactivity before promoting text updates (prevents spam during active typing) -inactive_timeout_sec=120 -# Comma-separated list of text patterns to promote when detected -# Leave empty to disable pattern-based promotion -# Examples: -# error,warning,failed - Announce build/command errors -# complete,finished,done - Announce task completions -# new message,@username - Announce chat notifications -# download complete - Announce download completions -list= - [menu] # Custom path for VMenu (virtual menu) profiles # Leave empty to use default location (/etc/fenrirscreenreader/vmenu-profiles/) diff --git a/config/sound/default/PromotedText.wav b/config/sound/default/PromotedText.wav deleted file mode 100644 index 210ff236..00000000 Binary files a/config/sound/default/PromotedText.wav and /dev/null differ diff --git a/config/sound/default/soundicons.conf b/config/sound/default/soundicons.conf index 9987b4be..e95caa7b 100644 --- a/config/sound/default/soundicons.conf +++ b/config/sound/default/soundicons.conf @@ -46,8 +46,6 @@ ErrorSpeech='ErrorSpeech.wav' ErrorScreen='ErrorScreen.wav' # If you cursor over an text that has attributs (like color) HasAttributes='has_attribute.wav' -# fenrir can promote strings if they appear on the screen. -PromotedText='PromotedText.wav' # missspelled indicator mispell='mispell.wav' # the for capital letter diff --git a/config/sound/template/soundicons.conf b/config/sound/template/soundicons.conf index 6304abce..5bc7ac8a 100644 --- a/config/sound/template/soundicons.conf +++ b/config/sound/template/soundicons.conf @@ -50,8 +50,6 @@ ErrorBraille='' ErrorScreen='' # If you cursor over an text that has attributs (like color) HasAttributes='' -# fenrir can promote strings if they appear on the screen. -PromotedText='' # misspelled indicator mispell='' # the for capital letter: diff --git a/docs/fenrir.adoc b/docs/fenrir.adoc index 93983756..a4cb2852 100644 --- a/docs/fenrir.adoc +++ b/docs/fenrir.adoc @@ -1095,23 +1095,6 @@ announce=True interrupt=False .... -==== Promoted List - -Promoted Lists are a nice feature if you are away from your computer or -performing more longer tasks. you can define a list of words which you -want to hear a sound icon for after a period of inactivity. Example if -the word "Chrys" appears after 120 Seconds of inactivity: - -.... -[promote] -enabled=True -inactive_timeout_sec=120 -list=Chrys -.... - -See section link:#Promote[Promote] in `+settings.conf+` for more -information. - === Dictionary You can make use of different kinds of built-in dictionary's. A @@ -2049,39 +2032,6 @@ leave_review_on_screen_change=True Values: on=`+True+`, off=`+False+` -==== Promote - -"Promoted Lists" are configured in the section `+[promote]+`. Turn -Promoted Lists" on or off: - -.... -enabled=True -.... - -Values: on=`+True+`, off=`+False+` - -The minimum time interval of inactivity to activate promoting. By -default it promotes after 120 Seconds inactivity: - -.... -inactive_timeout_sec=120 -.... - -Values: in Seconds - -Define a list of promoted words comma seperated: - -.... -list= -.... - -Values: text (comma seperated) Example to promote the word "nickname" or -a bash prompt: - -.... -list=nickname,$:,#: -.... - ==== Time The automated time announcement is configured in the section `+[time]+`. diff --git a/docs/user.txt b/docs/user.txt index b88fe793..e19abc23 100644 --- a/docs/user.txt +++ b/docs/user.txt @@ -729,15 +729,6 @@ Example on fix minutes in an hour. example every quarter "delaySec=0" and "onMin onMinutes=00,15,30,45 announce=True interrupt=False -==== Promoted List ==== -Promoted Lists are a nice feature if you are away from your computer or performing more longer tasks. -you can define a list of words which you want to hear a sound icon for after a period of inactivity. -Example if the word "Chrys" appears after 120 Seconds of inactivity: - [promote] - enabled=True - inactive_timeout_sec=120 - list=Chrys -See section [[#Promote|Promote]] in ''settings.conf'' for more information. ==== Punctuation ==== Fenrir handles punctuation levels and names for you with several provided dictionaries. @@ -1199,23 +1190,6 @@ Values: on=''True'', off=''False'' Leave the review mode when changing the screen (From TTY3 to TTY4): leave_review_on_screen_change=True Values: on=''True'', off=''False'' -==== Promote ==== -"Promoted Lists" are configured in the section ''[promote]''. -Turn Promoted Lists" on or off: - enabled=True -Values: on=''True'', off=''False'' - -The minimum time interval of inactivity to activate promoting. -By default it promotes after 120 Seconds inactivity: - inactive_timeout_sec=120 -Values: in Seconds - -Define a list of promoted words comma seperated: - list= -Values: text (comma seperated) -Example to promote the word "nickname" or a bash prompt: - list=nickname,$:,#: - ==== Time ==== The automated time announcement is configured in the section ''[time]''. Time announcement is disabled by default. diff --git a/src/fenrirscreenreader/commands/onScreenUpdate/75000-incoming_promote.py b/src/fenrirscreenreader/commands/onScreenUpdate/75000-incoming_promote.py deleted file mode 100644 index 51585b1f..00000000 --- a/src/fenrirscreenreader/commands/onScreenUpdate/75000-incoming_promote.py +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/env python3 - -import time - -from fenrirscreenreader.core.i18n import _ - -# -*- coding: utf-8 -*- - -# Fenrir TTY screen reader -# By Chrys, Storm Dragon, and contributors. - - -class command: - def __init__(self): - pass - - def initialize(self, environment): - self.env = environment - - def shutdown(self): - pass - - def get_description(self): - return "No Description found" - - def run(self): - if not self.env["runtime"]["SettingsManager"].get_setting_as_bool( - "promote", "enabled" - ): - return - if ( - self.env["runtime"]["SettingsManager"] - .get_setting("promote", "list") - .strip(" \t\n") - == "" - ): - return - if int(time.time() - self.env["input"]["last_input_time"]) < self.env[ - "runtime" - ]["SettingsManager"].get_setting_as_int( - "promote", "inactive_timeout_sec" - ): - return - if ( - len( - self.env["runtime"]["SettingsManager"].get_setting( - "promote", "list" - ) - ) - == 0 - ): - return - for promote in ( - self.env["runtime"]["SettingsManager"] - .get_setting("promote", "list") - .split(",") - ): - if promote in self.env["screen"]["new_delta"]: - self.env["runtime"]["OutputManager"].play_sound_icon( - "PromotedText" - ) - self.env["input"]["last_input_time"] = time.time() - return - - def set_callback(self, callback): - pass diff --git a/src/fenrirscreenreader/core/eventManager.py b/src/fenrirscreenreader/core/eventManager.py index a42919c3..68b3f48e 100644 --- a/src/fenrirscreenreader/core/eventManager.py +++ b/src/fenrirscreenreader/core/eventManager.py @@ -17,8 +17,7 @@ from fenrirscreenreader.core.eventData import FenrirEventType class EventManager: def __init__(self): self.running = Value(c_bool, True) - # Bounded queue to prevent memory exhaustion - self._eventQueue = Queue(maxsize=100) + self._eventQueue = Queue() self.clean_event_queue() def initialize(self, environment): @@ -107,23 +106,5 @@ class EventManager: return False if event == FenrirEventType.ignore: return False - # Use bounded queue - if full, this will block briefly or drop older - # events - try: - self._eventQueue.put({"Type": event, "data": data}, timeout=0.1) - except Exception as e: - # Queue full - drop oldest event and add new one for critical - # events - if event in [ - FenrirEventType.screen_update, - FenrirEventType.keyboard_input, - ]: - try: - self._eventQueue.get_nowait() # Remove oldest - self._eventQueue.put( - {"Type": event, "data": data}, timeout=0.1 - ) - except BaseException: - pass # If still can't add, drop the event - # For non-critical events, just drop them if queue is full + self._eventQueue.put({"Type": event, "data": data}) return True diff --git a/src/fenrirscreenreader/core/outputManager.py b/src/fenrirscreenreader/core/outputManager.py index 0ff8887d..a0269dea 100644 --- a/src/fenrirscreenreader/core/outputManager.py +++ b/src/fenrirscreenreader/core/outputManager.py @@ -65,13 +65,31 @@ class OutputManager: return if (len(text) > 1) and (text.strip(string.whitespace) == ""): return - to_announce_capital = announce_capital and text[0].isupper() - if to_announce_capital: - if self.play_sound_icon("capital", False): - to_announce_capital = False + is_capital = announce_capital and text[0].isupper() + use_pitch_for_capital = False + + if is_capital: + indicator = self.env["runtime"]["SettingsManager"].get_setting( + "speech", "capital_indicator" + ).lower() + + if indicator == "none": + pass # No indication + elif indicator == "beep": + # Play beep with interrupt=True to fix stacking + self.play_sound_icon("capital", True) + elif indicator == "pitch": + use_pitch_for_capital = True + elif indicator == "both": + self.play_sound_icon("capital", True) + use_pitch_for_capital = True + else: + # Default to pitch for unknown values + use_pitch_for_capital = True + self.last_echo = text self.speak_text( - text, interrupt, ignore_punctuation, to_announce_capital, flush + text, interrupt, ignore_punctuation, use_pitch_for_capital, flush ) def get_last_echo(self): diff --git a/src/fenrirscreenreader/core/settingsData.py b/src/fenrirscreenreader/core/settingsData.py index 8604faab..f0d4b85c 100644 --- a/src/fenrirscreenreader/core/settingsData.py +++ b/src/fenrirscreenreader/core/settingsData.py @@ -23,6 +23,7 @@ settings_data = { "rate": 0.75, "pitch": 0.5, "capital_pitch": 0.8, + "capital_indicator": "pitch", "volume": 1.0, "module": "", "voice": "en-us", @@ -97,11 +98,6 @@ settings_data = { "vmenu_path": "", "quick_menu": "speech#rate;speech#pitch;speech#volume", }, - "promote": { - "enabled": True, - "inactive_timeout_sec": 120, - "list": "", - }, "time": { "enabled": False, "present_time": True, diff --git a/src/fenrirscreenreader/fenrirVersion.py b/src/fenrirscreenreader/fenrirVersion.py index f82eeb8b..2b0249f6 100644 --- a/src/fenrirscreenreader/fenrirVersion.py +++ b/src/fenrirscreenreader/fenrirVersion.py @@ -4,5 +4,5 @@ # Fenrir TTY screen reader # By Chrys, Storm Dragon, and contributors. -version = "2025.12.20" +version = "2025.12.30" code_name = "master"