diff --git a/README.md b/README.md index 588ef952..00a18f7f 100644 --- a/README.md +++ b/README.md @@ -1,29 +1,39 @@ # fenrir (Alfa) An TTY screenreader for Linux. -Its an early alpha version. You can test it. It is not recommended for production use. If you want to help just let me know. +Its an early alpha version. You can test it. It is not recommended for production use. In theorie its not limited to linux. but i currently only provide drivers for that because I have no ohter system here. If you want to help or write drivers to make it work on other systems, just let me know. -# requirements +# requirements (core) - linux - python3 -- python-espeak - python-evdev - loaded uinput kernel module -Read permission to the following files: -/sys/devices/virtual/tty/tty0/active -/dev/vcsa[1-64] -ReadWrite permission -/dev/input -/dev/uinput +- Read permission to the following files: + - /sys/devices/virtual/tty/tty0/active + - /dev/vcsa[1-64] +- ReadWrite permission + - /dev/input + - /dev/uinput +- speech, sound or braille drivers see "optional (features, drivers)". -# optional -- sox [its used by default in the generic sound driver for playing sound-icons] -- speech-dispatcher, python3-speechd [to use the speech-dispatcher driver] -- brltty, python-brlapi [using braille] # (not implemented yet) -- gstreamer [soundicons via gstreamer] -- GLib [soundicons via gstreamer] -- python-pyenchant [spell check functionality] -- aspell- [your languagedata for spellchecker, english support "aspell-en"] -- python-daemonize [use fenrir as background service on Unix like systems] +# optional (features, drivers) +- "espeak" speech driver: + - python-espeak +- "speechd" speech driver: + - speech-dispatcher + - python-speechd +- brltty braille driver (not implemented yet, WIP): + - brltty (configured and running) + - python-brlapi +- "generic" sound driver: + - sox +- "gstreamer" sound driver + - gstreamer 1.x + - GLib +- spellchecker + - python-pyenchant + - aspell-YourLanguageCode (example aspell-en for us english) +- unix daemon: + - python-daemonize # installation - Archlinux: PKGBUILD in AUR @@ -32,5 +42,9 @@ ReadWrite permission You can just run the following as root: cd src/fenrir-package/ sudo ./fenrir -Settings are located in the "config" directory. - +Settings "settings.conf" is located in the "config" directory. +Take care that the used drivers in the config matching your installed drivers. +By default it uses: +- sound driver: generic (via sox, could configured in settings.conf) +- speech driver: speechd +- braille driver: brltty (WIP) diff --git a/autostart/systemd/fenrir.service b/autostart/systemd/fenrir.service index 449e3155..92e704ee 100644 --- a/autostart/systemd/fenrir.service +++ b/autostart/systemd/fenrir.service @@ -5,7 +5,7 @@ After=systemd-udev-settle.service sound.target [Service] Type=forking PIDFile=/var/run/fenrir.pid -ExecStart=/usr/bin/fenrir +ExecStart=/usr/bin/fenrir-daemon ExecReload=/usr/bin/kill -HUP $MAINPID Restart=always #Group=fenrir diff --git a/config/settings/espeak.settings.conf b/config/settings/espeak.settings.conf index 76ea1f1a..593241ad 100644 --- a/config/settings/espeak.settings.conf +++ b/config/settings/espeak.settings.conf @@ -129,3 +129,8 @@ delaySec=0 # present time after to given minutes example every 15 minutes: 00,15,30,45 # if delaySec is >0 onMinutes is ignored onMinutes=00,30 +# announce via soundicon +announce=True +# interrupt current speech for time announcement +interrupt=False + diff --git a/config/settings/settings.conf b/config/settings/settings.conf index 9b8e7986..d7659dab 100644 --- a/config/settings/settings.conf +++ b/config/settings/settings.conf @@ -125,7 +125,7 @@ list= [time] # automatic time anouncement -enabled=False +enabled=True # present time presentTime=True # present date (on change) @@ -135,3 +135,7 @@ delaySec=0 # present time after to given minutes example every 15 minutes: 00,15,30,45 # if delaySec is >0 onMinutes is ignored onMinutes=00,30 +# announce via soundicon (not interrupting) +announce=True +# interrupt current speech for time announcement +interrupt=False diff --git a/config/settings/settings.conf.chrys b/config/settings/settings.conf.chrys index e348d363..ad61c76f 100644 --- a/config/settings/settings.conf.chrys +++ b/config/settings/settings.conf.chrys @@ -135,3 +135,7 @@ delaySec=0 # present time after to given minutes example every 15 minutes: 00,15,30,45 # if delaySec is >0 onMinutes is ignored onMinutes=00,30 +# announce via soundicon +announce=True +# interrupt current speech for time announcement +interrupt=False diff --git a/config/settings/settings.conf.storm b/config/settings/settings.conf.storm index 2714b2c2..864d672a 100644 --- a/config/settings/settings.conf.storm +++ b/config/settings/settings.conf.storm @@ -85,3 +85,7 @@ delaySec=0 # present time after to given minutes example every 15 minutes: 00,15,30,45 # if delaySec is >0 onMinutes is ignored onMinutes=00,30 +# announce via soundicon +announce=True +# interrupt current speech for time announcement +interrupt=False diff --git a/config/sound/default-wav/Announce.wav b/config/sound/default-wav/Announce.wav new file mode 100644 index 00000000..f817467e Binary files /dev/null and b/config/sound/default-wav/Announce.wav differ diff --git a/config/sound/default-wav/soundicons.conf b/config/sound/default-wav/soundicons.conf index 4e34285a..8f6bba93 100644 --- a/config/sound/default-wav/soundicons.conf +++ b/config/sound/default-wav/soundicons.conf @@ -48,3 +48,5 @@ PromotedText='PromotedText.wav' mispell='mispell.wav' # the for capital letter capital='Caps.wav' +# general announcement +announce="Announce.wav" diff --git a/config/sound/default/Announce.opus b/config/sound/default/Announce.opus new file mode 100644 index 00000000..0eea2d5f Binary files /dev/null and b/config/sound/default/Announce.opus differ diff --git a/config/sound/default/soundicons.conf b/config/sound/default/soundicons.conf index 53a4068e..3b11a371 100644 --- a/config/sound/default/soundicons.conf +++ b/config/sound/default/soundicons.conf @@ -48,3 +48,5 @@ PromotedText='PromotedText.opus' mispell='mispell.opus' # the for capital letter capital='Caps.opus' +# general announcement +announce="Announce.opus" diff --git a/config/sound/template/soundicons.conf b/config/sound/template/soundicons.conf index fadbbb0b..56242933 100644 --- a/config/sound/template/soundicons.conf +++ b/config/sound/template/soundicons.conf @@ -48,3 +48,5 @@ PromotedText='' mispell='' # the for capital letter: capital='' +# general announcement +announce="" diff --git a/setup.py b/setup.py index 258af8d3..5a47f695 100755 --- a/setup.py +++ b/setup.py @@ -20,7 +20,7 @@ setup( # Packages packages=find_packages('src/fenrir'), package_dir={'': 'src/fenrir'}, - scripts=['src/fenrir/fenrir'], + scripts=['src/fenrir/fenrir','src/fenrir/fenrir-daemon'], #entry_points = { # "console_scripts": ['fenrir = fenrir:main'] # }, diff --git a/src/fenrir/commands/onScreenUpdate/76000-time.py b/src/fenrir/commands/onScreenUpdate/76000-time.py index 20b2062d..4e9306df 100644 --- a/src/fenrir/commands/onScreenUpdate/76000-time.py +++ b/src/fenrir/commands/onScreenUpdate/76000-time.py @@ -44,18 +44,28 @@ class command(): if now.hour == self.lastTime.hour: if now.minute == self.lastTime.minute: return - + dateFormat = self.env['runtime']['settingsManager'].getSetting('general', 'dateFormat') + dateString = datetime.datetime.strftime(now, dateFormat) + + presentDate = self.env['runtime']['settingsManager'].getSettingAsBool('time', 'presentDate') and \ + self.lastDateString != dateString + presentTime = self.env['runtime']['settingsManager'].getSettingAsBool('time', 'presentTime') + # no changed value to announce + if not (presentDate or presentTime): + return timeFormat = self.env['runtime']['settingsManager'].getSetting('general', 'timeFormat') timeString = datetime.datetime.strftime(now, timeFormat) - dateFormat = self.env['runtime']['settingsManager'].getSetting('general', 'dateFormat') - dateString = datetime.datetime.strftime(now, dateFormat) - if self.env['runtime']['settingsManager'].getSettingAsBool('time', 'presentTime'): + if self.env['runtime']['settingsManager'].getSettingAsBool('time', 'interrupt'): + self.env['runtime']['outputManager'].interruptOutput() + if self.env['runtime']['settingsManager'].getSettingAsBool('time', 'announce'): + self.env['runtime']['outputManager'].playSoundIcon('announce') + + if presentTime: # present the time self.env['runtime']['outputManager'].presentText('Autotime: ' + timeString , soundIcon='', interrupt=False) # and date if changes - if self.env['runtime']['settingsManager'].getSettingAsBool('time', 'presentDate'): - if self.lastDateString != dateString: + if presentDate: self.env['runtime']['outputManager'].presentText(dateString , soundIcon='', interrupt=False) self.lastDateString = dateString self.lastTime = datetime.datetime.now() diff --git a/src/fenrir/core/settings.py b/src/fenrir/core/settings.py index c21aca01..d456dc05 100644 --- a/src/fenrir/core/settings.py +++ b/src/fenrir/core/settings.py @@ -70,6 +70,8 @@ settings = { 'presentDate': True, 'delaySec': 0, 'onMinutes': '00,30', + 'announce': True, + 'interrupt': False, }, 'keyboard':{ 'driver': 'evdev',