diff --git a/config/keyboard/desktop.conf b/config/keyboard/desktop.conf index 0d5424f1..7d8ae132 100644 --- a/config/keyboard/desktop.conf +++ b/config/keyboard/desktop.conf @@ -21,6 +21,7 @@ #=toggle_autoRead #=quit_fenrir #=time +#=date #=foreward_keypress #=inc_speech_volume #=dec_speech_volume diff --git a/config/keyboard/test.conf b/config/keyboard/test.conf index 04388322..26bf5568 100644 --- a/config/keyboard/test.conf +++ b/config/keyboard/test.conf @@ -1,4 +1,4 @@ -#1-KEY_LEFTCTRL=shut_up +1-KEY_LEFTCTRL=shut_up 1-FENRIR,1-KEY_RIGHTCTRL=shut_up 1-FENRIR,1-KEY_KP8=curr_line 1-FENRIR,1-KEY_KP7=prev_line @@ -21,6 +21,7 @@ #=toggle_autoRead #=quit_fenrir 1-FENRIR,1-KEY_T=time +1-FENRIR,1-KEY_D=time 1-FENRIR,1-KEY_A=foreward_keypress #1-FENRIR,1-KEY_F2=inc_speech_volume #1-FENRIR,1-KEY_F3=dec_sound_volume diff --git a/config/settings/settings.conf b/config/settings/settings.conf deleted file mode 100644 index 49de4c77..00000000 --- a/config/settings/settings.conf +++ /dev/null @@ -1,89 +0,0 @@ -[sound] -# Turn sound on or off: -enabled=True - -# Select the driver used to play sounds, choices are sox and gstreamer. -# Sox is the default. -driver=sox - -# Sound themes. This is the pack of sounds used for sound alerts. -# Sound packs may be located at /usr/share/sounds -# For system wide availability, or ~/.local/share/fenrir/sounds -# For the current user. -theme=default - -# Sound volume controls how loud the sounds for your chosen soundpack are. -# 0 is quietest, 1.0 is loudest. -volume=1.0 - -[speech] -# Turn speech on or off: -enabled=True - -# Select speech driver, options are speechd (default) or espeak: -driver=speechd - -# The rate selects how fast fenrir will speak. Options range from 0, slowest, to 1.0, fastest. -rate=0.45 - -# Pitch controls the pitch of the voice, select from 0, lowest, to 1.0, highest. -pitch=0.5 - -# Volume controls the loudness of the voice, select from 0, quietest, to 1.0, loudest. -volume=1.0 - -# Module is used for speech-dispatcher, to select the speech module you want to use. -# Consult speech-dispatcher's configuration and help ti find out which modules are available. -# The default is espeak. -module=espeak - -# Voice selects the varient you want to use, for example, f5 will use the female voice #5 in espeak, -# or if using the espeak module in speech-dispatcher. To find out which voices are available, consult the documentation provided with your chosen synthesizer. -voice= - -# Select the language you want fenrir to use. -language=english-us - -# Read new text as it happens? -autoReadIncomming=True - -[braille] -#braille is not implemented yet -enabled=False -layout=en - -[screen] -driver=linux -encoding=cp850 -screenUpdateDelay=0.4 - -[keyboard] -device=all -# gives fenrir exclusive access to the keyboard and let consume keystrokes. just disable on problems. -grabDevices=True -ignoreShortcuts=False -# the current shortcut layout located in /etc/fenrir/keyboard -keyboardLayout=desktop -# echo chars while typing. -charEcho=False -# echo deleted chars -charDeleteEcho=True -# echo word after pressing space -wordEcho=True -# interrupt speech on any keypress -interruptOnKeyPress=False - -[general] -debugLevel=0 -punctuationLevel=1 -numberOfClipboards=10 -# define the current fenrir key -fenrirKeys=KEY_KP0 -timeFormat=%H:%M:%P - -[promote] -enabled=True -inactiveTimeoutSec=120 -list= - - diff --git a/config/settings/settings.conf.chrys b/config/settings/settings.conf.chrys index 0dd42e61..a7dd4295 100644 --- a/config/settings/settings.conf.chrys +++ b/config/settings/settings.conf.chrys @@ -40,6 +40,7 @@ punctuationLevel=1 numberOfClipboards=10 fenrirKeys=KEY_KP0 timeFormat=%H:%M:%P +dateFormat="%A, %B %d, %Y" [promote] enabled=True diff --git a/config/settings/settings.conf.orig b/config/settings/settings.conf.orig index 49de4c77..eb3a12f3 100644 --- a/config/settings/settings.conf.orig +++ b/config/settings/settings.conf.orig @@ -79,7 +79,8 @@ punctuationLevel=1 numberOfClipboards=10 # define the current fenrir key fenrirKeys=KEY_KP0 -timeFormat=%H:%M:%P +timeFormat=%H:%M%P +dateFormat="%A, %B %d, %Y" [promote] enabled=True diff --git a/config/settings/settings.conf.storm b/config/settings/settings.conf.storm index 5be517c6..838cfe2d 100644 --- a/config/settings/settings.conf.storm +++ b/config/settings/settings.conf.storm @@ -40,6 +40,7 @@ punctuationLevel=1 numberOfClipboards=10 fenrirKeys=KEY_KP0 timeFormat=%H:%M:%P +dateFormat="%A, %B %d, %Y" [promote] enabled=True diff --git a/src/fenrir-package/commands/commands/date.py b/src/fenrir-package/commands/commands/date.py new file mode 100644 index 00000000..8ea846c9 --- /dev/null +++ b/src/fenrir-package/commands/commands/date.py @@ -0,0 +1,28 @@ +#!/bin/python + +import datetime + +class command(): + def __init__(self): + pass + def run(self, environment): + #this is the way to load the settings: + # general is the section in the config file, timeFormat is the variable + # this has to been added to settings.conf in sectino [general] + # dateFormat="%A, %B %d, %Y" + # the following has to been added to core/settings.py to the key 'general' + # the settings.py is used for default values + # dateFormat="%A, %B %d, %Y" + dateFormat = environment['runtime']['settingsManager'].getSetting(environment,'general', 'dateFormat') + + # get the time formatted + dateString = datetime.datetime.strftime(datetime.datetime.now(), dateFormat) + + # present the time via speak and braile, there is no soundicon, interrupt the current speech + environment['runtime']['outputManager'].presentText(environment, dateString , soundIcon='', interrupt=True) + + return environment + def setCallback(self, callback): + pass + def shutdown(self): + pass diff --git a/src/fenrir-package/commands/commands/time.py b/src/fenrir-package/commands/commands/time.py index bbbf1094..a93a4769 100644 --- a/src/fenrir-package/commands/commands/time.py +++ b/src/fenrir-package/commands/commands/time.py @@ -9,10 +9,10 @@ class command(): #this is the way to load the settings: # general is the section in the config file, timeFormat is the variable # this has to been added to settings.conf in sectino [general] - # timeFormat=%H:%M;%P + # timeFormat=%I:%M%P # the following has to been added to core/settings.py to the key 'general' # the settings.py is used for default values - # 'timeFormat':"%H:%M;%P", + # 'timeFormat':"%I:%M%P", timeFormat = environment['runtime']['settingsManager'].getSetting(environment,'general', 'timeFormat') # get the time formatted diff --git a/src/fenrir-package/core/settings.py b/src/fenrir-package/core/settings.py index c26727d5..b49edaaa 100644 --- a/src/fenrir-package/core/settings.py +++ b/src/fenrir-package/core/settings.py @@ -35,7 +35,8 @@ settings = { 'punctuationLevel': 1, 'numberOfClipboards': 10, 'fenrirKeys':['82'], - 'timeFormat':'%H:%M:%P', + 'timeFormat':'%I:%M%P', + 'dateFormat':'%A, %B %d, %Y', }, 'promote':{ 'enabled': True,