fix application detection, remove debugging print
This commit is contained in:
parent
1c2d0caa56
commit
90129d4161
@ -26,10 +26,10 @@ KEY_FENRIR,KEY_KPDOT=exit_review
|
|||||||
#KEY_FENRIR,KEY_KP5=curr_screen
|
#KEY_FENRIR,KEY_KP5=curr_screen
|
||||||
KEY_FENRIR,KEY_KP8=curr_screen_before_cursor
|
KEY_FENRIR,KEY_KP8=curr_screen_before_cursor
|
||||||
KEY_FENRIR,KEY_KP2=curr_screen_after_cursor
|
KEY_FENRIR,KEY_KP2=curr_screen_after_cursor
|
||||||
KEY_FENRIR,KEY_1=set_window_application
|
#KEY_FENRIR,KEY_1=set_window_application
|
||||||
KEY_FENRIR,KEY_3=clear_window_application
|
#KEY_FENRIR,KEY_3=clear_window_application
|
||||||
#KEY_FENRIR,KEY_3=clear_bookmark_1
|
KEY_FENRIR,KEY_3=clear_bookmark_1
|
||||||
#KEY_FENRIR,KEY_1=set_bookmark_1
|
KEY_FENRIR,KEY_1=set_bookmark_1
|
||||||
KEY_FENRIR,KEY_2=bookmark_1
|
KEY_FENRIR,KEY_2=bookmark_1
|
||||||
KEY_KPPLUS=last_incoming
|
KEY_KPPLUS=last_incoming
|
||||||
KEY_FENRIR,KEY_F2=toggle_braille
|
KEY_FENRIR,KEY_F2=toggle_braille
|
||||||
|
@ -57,7 +57,7 @@ module=espeak
|
|||||||
voice=
|
voice=
|
||||||
|
|
||||||
# Select the language you want fenrir to use.
|
# Select the language you want fenrir to use.
|
||||||
language=english-us
|
language=de
|
||||||
|
|
||||||
# Read new text as it happens?
|
# Read new text as it happens?
|
||||||
autoReadIncoming=True
|
autoReadIncoming=True
|
||||||
@ -82,7 +82,7 @@ device=AUTO
|
|||||||
grabDevices=True
|
grabDevices=True
|
||||||
ignoreShortcuts=False
|
ignoreShortcuts=False
|
||||||
# the current shortcut layout located in /etc/fenrir/keyboard
|
# the current shortcut layout located in /etc/fenrir/keyboard
|
||||||
keyboardLayout=desktop
|
keyboardLayout=test
|
||||||
# echo chars while typing.
|
# echo chars while typing.
|
||||||
charEcho=False
|
charEcho=False
|
||||||
# echo deleted chars
|
# echo deleted chars
|
||||||
@ -95,7 +95,7 @@ interruptOnKeyPress=False
|
|||||||
doubleTapDelay=0.2
|
doubleTapDelay=0.2
|
||||||
|
|
||||||
[general]
|
[general]
|
||||||
debugLevel=3
|
debugLevel=0
|
||||||
punctuationLevel=Some
|
punctuationLevel=Some
|
||||||
numberOfClipboards=10
|
numberOfClipboards=10
|
||||||
# define the current fenrir key
|
# define the current fenrir key
|
||||||
|
@ -29,7 +29,7 @@ class command():
|
|||||||
if not self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1']:
|
if not self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1']:
|
||||||
self.env['runtime']['outputManager'].presentText("Bookmark for application " + currApp + " not set", interrupt=True)
|
self.env['runtime']['outputManager'].presentText("Bookmark for application " + currApp + " not set", interrupt=True)
|
||||||
return
|
return
|
||||||
print('i',self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1'])
|
|
||||||
# set marks
|
# set marks
|
||||||
marked = ''
|
marked = ''
|
||||||
startMark = self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1'].copy()
|
startMark = self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1'].copy()
|
||||||
|
@ -29,7 +29,7 @@ class command():
|
|||||||
if not self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1']:
|
if not self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1']:
|
||||||
self.env['runtime']['outputManager'].presentText("Bookmark for application " + currApp + " not set", interrupt=True)
|
self.env['runtime']['outputManager'].presentText("Bookmark for application " + currApp + " not set", interrupt=True)
|
||||||
return
|
return
|
||||||
print('i',self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1'])
|
|
||||||
# set marks
|
# set marks
|
||||||
marked = ''
|
marked = ''
|
||||||
startMark = self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1'].copy()
|
startMark = self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1'].copy()
|
||||||
|
@ -29,7 +29,7 @@ class command():
|
|||||||
if not self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1']:
|
if not self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1']:
|
||||||
self.env['runtime']['outputManager'].presentText("Bookmark for application " + currApp + " not set", interrupt=True)
|
self.env['runtime']['outputManager'].presentText("Bookmark for application " + currApp + " not set", interrupt=True)
|
||||||
return
|
return
|
||||||
print('i',self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1'])
|
|
||||||
# set marks
|
# set marks
|
||||||
marked = ''
|
marked = ''
|
||||||
startMark = self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1'].copy()
|
startMark = self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1'].copy()
|
||||||
|
@ -29,7 +29,7 @@ class command():
|
|||||||
if not self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1']:
|
if not self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1']:
|
||||||
self.env['runtime']['outputManager'].presentText("Bookmark for application " + currApp + " not set", interrupt=True)
|
self.env['runtime']['outputManager'].presentText("Bookmark for application " + currApp + " not set", interrupt=True)
|
||||||
return
|
return
|
||||||
print('i',self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1'])
|
|
||||||
# set marks
|
# set marks
|
||||||
marked = ''
|
marked = ''
|
||||||
startMark = self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1'].copy()
|
startMark = self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1'].copy()
|
||||||
|
@ -29,7 +29,7 @@ class command():
|
|||||||
if not self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1']:
|
if not self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1']:
|
||||||
self.env['runtime']['outputManager'].presentText("Bookmark for application " + currApp + " not set", interrupt=True)
|
self.env['runtime']['outputManager'].presentText("Bookmark for application " + currApp + " not set", interrupt=True)
|
||||||
return
|
return
|
||||||
print('i',self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1'])
|
|
||||||
# set marks
|
# set marks
|
||||||
marked = ''
|
marked = ''
|
||||||
startMark = self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1'].copy()
|
startMark = self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1'].copy()
|
||||||
|
@ -29,7 +29,7 @@ class command():
|
|||||||
if not self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1']:
|
if not self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1']:
|
||||||
self.env['runtime']['outputManager'].presentText("Bookmark for application " + currApp + " not set", interrupt=True)
|
self.env['runtime']['outputManager'].presentText("Bookmark for application " + currApp + " not set", interrupt=True)
|
||||||
return
|
return
|
||||||
print('i',self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1'])
|
|
||||||
# set marks
|
# set marks
|
||||||
marked = ''
|
marked = ''
|
||||||
startMark = self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1'].copy()
|
startMark = self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1'].copy()
|
||||||
|
@ -29,7 +29,7 @@ class command():
|
|||||||
if not self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1']:
|
if not self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1']:
|
||||||
self.env['runtime']['outputManager'].presentText("Bookmark for application " + currApp + " not set", interrupt=True)
|
self.env['runtime']['outputManager'].presentText("Bookmark for application " + currApp + " not set", interrupt=True)
|
||||||
return
|
return
|
||||||
print('i',self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1'])
|
|
||||||
# set marks
|
# set marks
|
||||||
marked = ''
|
marked = ''
|
||||||
startMark = self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1'].copy()
|
startMark = self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1'].copy()
|
||||||
|
@ -29,7 +29,7 @@ class command():
|
|||||||
if not self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1']:
|
if not self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1']:
|
||||||
self.env['runtime']['outputManager'].presentText("Bookmark for application " + currApp + " not set", interrupt=True)
|
self.env['runtime']['outputManager'].presentText("Bookmark for application " + currApp + " not set", interrupt=True)
|
||||||
return
|
return
|
||||||
print('i',self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1'])
|
|
||||||
# set marks
|
# set marks
|
||||||
marked = ''
|
marked = ''
|
||||||
startMark = self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1'].copy()
|
startMark = self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1'].copy()
|
||||||
|
@ -29,7 +29,7 @@ class command():
|
|||||||
if not self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1']:
|
if not self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1']:
|
||||||
self.env['runtime']['outputManager'].presentText("Bookmark for application " + currApp + " not set", interrupt=True)
|
self.env['runtime']['outputManager'].presentText("Bookmark for application " + currApp + " not set", interrupt=True)
|
||||||
return
|
return
|
||||||
print('i',self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1'])
|
|
||||||
# set marks
|
# set marks
|
||||||
marked = ''
|
marked = ''
|
||||||
startMark = self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1'].copy()
|
startMark = self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1'].copy()
|
||||||
|
@ -29,7 +29,7 @@ class command():
|
|||||||
if not self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1']:
|
if not self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1']:
|
||||||
self.env['runtime']['outputManager'].presentText("Bookmark for application " + currApp + " not set", interrupt=True)
|
self.env['runtime']['outputManager'].presentText("Bookmark for application " + currApp + " not set", interrupt=True)
|
||||||
return
|
return
|
||||||
print('i',self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1'])
|
|
||||||
# set marks
|
# set marks
|
||||||
marked = ''
|
marked = ''
|
||||||
startMark = self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1'].copy()
|
startMark = self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1'].copy()
|
||||||
|
@ -18,7 +18,7 @@ class command():
|
|||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
currApp = self.env['runtime']['applicationManager'].getCurrentApplication()
|
currApp = self.env['runtime']['applicationManager'].getCurrentApplication()
|
||||||
|
|
||||||
del self.env['commandBuffer']['bookMarks'][self.ID][currApp]
|
del self.env['commandBuffer']['bookMarks'][self.ID][currApp]
|
||||||
|
|
||||||
self.env['runtime']['outputManager'].presentText('Bookmark ' + self.ID + " removed for application " + currApp, interrupt=True)
|
self.env['runtime']['outputManager'].presentText('Bookmark ' + self.ID + " removed for application " + currApp, interrupt=True)
|
||||||
|
@ -25,7 +25,7 @@ class screenManager():
|
|||||||
self.env['runtime']['screenDriver'].getCurrScreen()
|
self.env['runtime']['screenDriver'].getCurrScreen()
|
||||||
if not self.isSuspendingScreen():
|
if not self.isSuspendingScreen():
|
||||||
if trigger == 'onUpdate':
|
if trigger == 'onUpdate':
|
||||||
self.env['runtime']['applicationManager'].getCurrentApplication()
|
self.env['runtime']['screenDriver'].getCurrApplication()
|
||||||
self.env['runtime']['screenDriver'].update(trigger)
|
self.env['runtime']['screenDriver'].update(trigger)
|
||||||
self.env['screenData']['lastScreenUpdate'] = time.time()
|
self.env['screenData']['lastScreenUpdate'] = time.time()
|
||||||
|
|
||||||
|
@ -34,8 +34,8 @@ class driver():
|
|||||||
currScreen = self.env['screenData']['newTTY']
|
currScreen = self.env['screenData']['newTTY']
|
||||||
apps = subprocess.Popen('ps -t tty' + currScreen + ' -o comm,tty,stat', shell=True, stdout=subprocess.PIPE).stdout.read().decode()[:-1].split('\n')
|
apps = subprocess.Popen('ps -t tty' + currScreen + ' -o comm,tty,stat', shell=True, stdout=subprocess.PIPE).stdout.read().decode()[:-1].split('\n')
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
return ''
|
print(e)
|
||||||
|
return
|
||||||
try:
|
try:
|
||||||
for i in apps:
|
for i in apps:
|
||||||
i = i.upper()
|
i = i.upper()
|
||||||
@ -48,13 +48,14 @@ class driver():
|
|||||||
not "SH" == i[0] and \
|
not "SH" == i[0] and \
|
||||||
not "PS" == i[0]:
|
not "PS" == i[0]:
|
||||||
if "TTY"+currScreen in i[1]:
|
if "TTY"+currScreen in i[1]:
|
||||||
if self.env['runtime']['applicationManager'].isApplicationChange():
|
if self.env['screenData']['newApplication'] != i[0]:
|
||||||
self.env['screenData']['oldApplication'] = self.env['screenData']['newApplication']
|
self.env['screenData']['oldApplication'] = self.env['screenData']['newApplication']
|
||||||
self.env['screenData']['newApplication'] = i[0]
|
self.env['screenData']['newApplication'] = i[0]
|
||||||
return
|
return
|
||||||
except:
|
except Exception as e:
|
||||||
return ''
|
print(e)
|
||||||
return ''
|
return
|
||||||
|
return
|
||||||
|
|
||||||
def getIgnoreScreens(self):
|
def getIgnoreScreens(self):
|
||||||
xlist = []
|
xlist = []
|
||||||
|
Loading…
Reference in New Issue
Block a user