From 601dac8f5a0a4b88b37ee06eb8ffcc82a99c44f6 Mon Sep 17 00:00:00 2001 From: chrys Date: Fri, 8 Jun 2018 23:44:07 +0200 Subject: [PATCH 1/3] add toggle sink-a --- .../change pulseaudio sink__-__key_s.sh | 26 +++ play zone/pdmenurc | 154 ++++++++++++++++++ .../commands/onScreenUpdate/60000-history.py | 2 + 3 files changed, 182 insertions(+) create mode 100755 config/scripts/change pulseaudio sink__-__key_s.sh create mode 100644 play zone/pdmenurc diff --git a/config/scripts/change pulseaudio sink__-__key_s.sh b/config/scripts/change pulseaudio sink__-__key_s.sh new file mode 100755 index 00000000..c897426c --- /dev/null +++ b/config/scripts/change pulseaudio sink__-__key_s.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +sinks=(`pacmd list-sinks | sed -n -e 's/\**[[:space:]]index:[[:space:]]\([[:digit:]]\)/\1/p'`) +sinks_count=${#sinks[@]} +active_sink_index=`pacmd list-sinks | sed -n -e 's/\*[[:space:]]index:[[:space:]]\([[:digit:]]\)/\1/p'` +newSink=${sinks[0]} +ord=0 + +while [ $ord -lt $sinks_count ]; +do + echo ${sinks[$ord]} + if [ ${sinks[$ord]} -gt $active_sink_index ] ; then + newSink=${sinks[$ord]} + break + fi + let ord++ +done + +pactl list short sink-inputs|while read stream; do + streamId=$(echo $stream|cut '-d ' -f1) + echo "moving stream $streamId" + pactl move-sink-input "$streamId" "$newSink" +done +pacmd set-default-sink "$newSink" + +#https://unix.stackexchange.com/questions/65246/change-pulseaudio-input-output-from-shell diff --git a/play zone/pdmenurc b/play zone/pdmenurc new file mode 100644 index 00000000..7f00595c --- /dev/null +++ b/play zone/pdmenurc @@ -0,0 +1,154 @@ +#!/usr/bin/pdmenu +# +# Note that the above bang-path isn't required, but it lets you run this +# file directly as a sort of pdmenu script. + +# F123 menu + +title:Welcome to F123 + +# Define the main menu. +menu:main:F123 Main Menu:Please make a selection + show:_Games Menu..::games + show:_Internet menu..::internet + show:_Media menu..::media + show:_Office menu..::office + show:_System Configuration Menu..::configuration + show:_Tools Menu..::tools + nop + show:_Power Options..::power + nop + exit:_Exit + + +# Submenu for games. +menu:games:Games:Command line games + exec:_Adventure::clear;adventure + exec:_Arithmetic::clear;arithmetic + exec:_Air Traffic Controler (Not screen reader friendly)::clear;atc + exec:_Backgammon (Not screen reader friendly)::clear;backgammon + exec:_Battlestar::clear;battlestar + exec:_Boggle (Not screen reader friendly)::clear;boggle + exec:_Canfield (Not screen reader friendly)::clear;canfield + exec:_Cribbage (Not screen reader friendly)::clear;cribbage + exec:_Go Fish:pause:clear;go-fish + exec:_Gomoku::clear;gomoku + exec:_Hangman::clear;hangman + exec:_Hunt (Not screen reader friendly)::clear;hunt + exec:_Mille Bornes::clear;mille + exec:_Number::clear;number + exec:_Phantasia::clear;phantasia + exec:_Phase of the Moon:pause:clear;pom + exec:_Primes::clear;primes + exec:_Robots (Not screen reader friendly)::clear;robots + exec:_Sail::clear;sail + exec:_Snake (Not screen reader friendly)::clear;snake + exec:_Tetris (Not screen reader friendly)::clear;tetris-bsd + exec:_Trek::clear;trek + exec:_Worm (Not screen reader friendly)::clear;worm + exec:_Wumpus::clear;wump + + nop + exit:_Main menu.. + +# submenu for internet applications. +menu:internet:Internet:Internet programs + exec:_E-Mail::clear;mutt + exec:_Basic Web Browser (W3M)::clear;w3m -v + group:Full _Web browser (Firefox) + exec:::clear + exec:::python /usr/share/fenrirscreenreader/tools/fenrir-ignore-screen + exec:::startx /usr/lib/F123-wrappers/xlauncher firefox + exec:::python /usr/share/fenrirscreenreader/tools/fenrir-unignore-screen + endgroup + group:_Mumble Voice Chat + exec:::clear + exec:::python /usr/share/fenrirscreenreader/tools/fenrir-ignore-screen + exec:::startx /usr/lib/F123-wrappers/xlauncher mumble + exec:::python /usr/share/fenrirscreenreader/tools/fenrir-unignore-screen + endgroup + nop + exit:_Main menu.. + +menu:media:Media:Multi-media applications + exec:_CD Audio Ripper (ripit)::ripit + exec:_Music Player (cmus)::cmus + exec:_Youtube (audio only)::youtube-viewer -novideo + group:Youtube (full _video) + exec:::clear + exec:::python /usr/share/fenrirscreenreader/tools/fenrir-ignore-screen + exec:::startx /usr/lib/F123-wrappers/xlauncher lxterminal -e youtube-viewer + exec:::python /usr/share/fenrirscreenreader/tools/fenrir-unignore-screen + endgroup + nop + exit:_Main menu.. + +menu:office:Office:Word processing, calendar, etc + exec:_Month Calendar:pause:clear;ncal + exec:_Year Calendar:pause:clear;ncal -y + exec:Text Editor::clear;${EDITOR:-nano} + nop:Office Suite + group:Database + exec:::clear + exec:::python /usr/share/fenrirscreenreader/tools/fenrir-ignore-screen + exec:::startx /usr/lib/F123-wrappers/xlauncher lobase + exec:::python /usr/share/fenrirscreenreader/tools/fenrir-unignore-screen + endgroup + group:Diagrams + exec:::clear + exec:::python /usr/share/fenrirscreenreader/tools/fenrir-ignore-screen + exec:::startx /usr/lib/F123-wrappers/xlauncher lodraw + exec:::python /usr/share/fenrirscreenreader/tools/fenrir-unignore-screen + endgroup + group:Formula Editor + exec:::clear + exec:::python /usr/share/fenrirscreenreader/tools/fenrir-ignore-screen + exec:::startx /usr/lib/F123-wrappers/xlauncher lomath + exec:::python /usr/share/fenrirscreenreader/tools/fenrir-unignore-screen + endgroup + group:Presentation + exec:::clear + exec:::python /usr/share/fenrirscreenreader/tools/fenrir-ignore-screen + exec:::startx /usr/lib/F123-wrappers/xlauncher loimpress + exec:::python /usr/share/fenrirscreenreader/tools/fenrir-unignore-screen + endgroup + group:Spreadsheet + exec:::clear + exec:::python /usr/share/fenrirscreenreader/tools/fenrir-ignore-screen + exec:::startx /usr/lib/F123-wrappers/xlauncher localc + exec:::python /usr/share/fenrirscreenreader/tools/fenrir-unignore-screen + endgroup + group:Word Processor + exec:::clear + exec:::python /usr/share/fenrirscreenreader/tools/fenrir-ignore-screen + exec:::startx /usr/lib/F123-wrappers/xlauncher lowriter + exec:::python /usr/share/fenrirscreenreader/tools/fenrir-unignore-screen + endgroup + nop + exit:_Main menu.. + +# submenu for configuring the computer. +menu:configuration:Configuration:System Configuration + exec:_Change Passwords::clear;/usr/lib/F123-wrappers/configure-passwords + exec:_Email Configuration::clear;fleacollar + exec:_Security Configuration::clear;/usr/lib/F123-wrappers/configure-security + exec:_Wireless Internet Connection::clear;sudo configure-wifi + nop + exit:_Main menu.. + +menu:tools:Tools:System Tools + group:Bluetooth manager + exec:::clear + exec:::python /usr/share/fenrirscreenreader/tools/fenrir-ignore-screen + exec:::startx /usr/lib/F123-wrappers/xlauncher blueman-assistant + exec:::python /usr/share/fenrirscreenreader/tools/fenrir-unignore-screen + endgroup +exec:_Search:edit,pause:recoll -t ~Search for what? :~ + nop + exit:_Main menu.. + +menu:power:Shutdown or Restart Your Computer:Shutdown or restart your computer + exec:_Power Off::poweroff + exec:_Restart::reboot + nop + exit:_Main menu.. diff --git a/src/fenrirscreenreader/commands/onScreenUpdate/60000-history.py b/src/fenrirscreenreader/commands/onScreenUpdate/60000-history.py index dd97d9b2..97bf9b36 100644 --- a/src/fenrirscreenreader/commands/onScreenUpdate/60000-history.py +++ b/src/fenrirscreenreader/commands/onScreenUpdate/60000-history.py @@ -22,6 +22,8 @@ class command(): return if self.env['runtime']['cursorManager'].isCursorVerticalMove(): return + # hack for pdmenu and maybe other dialog apps that place the cursor at last cell/row + # this is not to be identified as history if self.env['screen']['newCursor']['x'] == == self.env['runtime']['screenManager'].getColums() - 1 and\ self.env['screen']['newCursor']['y'] == self.env['runtime']['screenManager'].getRows() - 1): return From 523303ff5b21d87fb231fd179e1389a733bdebf2 Mon Sep 17 00:00:00 2001 From: chrys Date: Fri, 8 Jun 2018 23:46:09 +0200 Subject: [PATCH 2/3] add toggle sink-a --- .../cycle-pulseaudio-sink.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename config/scripts/change pulseaudio sink__-__key_s.sh => tools/cycle-pulseaudio-sink.sh (100%) diff --git a/config/scripts/change pulseaudio sink__-__key_s.sh b/tools/cycle-pulseaudio-sink.sh similarity index 100% rename from config/scripts/change pulseaudio sink__-__key_s.sh rename to tools/cycle-pulseaudio-sink.sh From 547c9302b0737add62a88819f0fe6791be81cf6a Mon Sep 17 00:00:00 2001 From: chrys Date: Fri, 8 Jun 2018 23:53:52 +0200 Subject: [PATCH 3/3] fix dependency check --- check-dependencies.py | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/check-dependencies.py b/check-dependencies.py index 9a37ae75..9c75faf4 100755 --- a/check-dependencies.py +++ b/check-dependencies.py @@ -6,7 +6,7 @@ import os, sys # speech: speech-dispatcher # sound: sox # braille: brltty: -defaultInstallation = ['FenrirCore','vcsaDriver','brlapiDriver','evdevDriver','speechdDriver', 'genericDriver'] +defaultInstallation = ['FenrirCore','vcsaDriver','brlapiDriver','evdevDriver','genericDriver (speech)', 'genericDriver (sound)'] currentInstallation = [] print('checking dependencys...') @@ -32,7 +32,7 @@ if available: currentInstallation.append('FenrirCore') # SCREEN -print('') +print('--------------------') print('screen driver') # VCSA (screen driver) print('vcsaDriver') @@ -50,6 +50,7 @@ else: available = available and False if available: currentInstallation.append('vcsaDriver') +print('') # pty emulation (screen driver) print('ptyDriver') available = True @@ -63,7 +64,7 @@ if available: currentInstallation.append('ptyDriver (screen)') # BRAILLE -print('') +print('--------------------') print('braille driver') # brltty (braille driver) print('brlapiDriver') @@ -78,7 +79,7 @@ except: if available: currentInstallation.append('brlapiDriver') # INPUT -print('') +print('--------------------') print('input driver') # evdev (input driver) print('evdevDriver') @@ -99,6 +100,7 @@ except: if available: currentInstallation.append('evdevDriver') # pty emulation (input driver) +print('') print('ptyDriver') available = True try: @@ -110,7 +112,7 @@ except: if available: currentInstallation.append('ptyDriver (Input)') # SOUND -print('') +print('--------------------') print('sound driver') print('genericDriver (uses sox by default)') available = True @@ -120,7 +122,8 @@ else: print('sox: FAIL') available = available and False if available: - currentInstallation.append('genericDriver') + currentInstallation.append('genericDriver (sound)') +print('') # gstreamer (sound driver) print('gstreamerDriver') available = True @@ -147,7 +150,7 @@ if available: currentInstallation.append('gstreamerDriver') # SPEECH -print('') +print('--------------------') print('speech driver') # speechd (speech driver) print('speechdDriver') @@ -160,6 +163,7 @@ except: available = available and False if available: currentInstallation.append('speechdDriver') +print('') # espeak (speech driver) print('espeakDriver') available = True @@ -171,9 +175,18 @@ except: available = available and False if available: currentInstallation.append('espeakDriver') +print('genericDriver (uses espeak by default)') +available = True +if os.path.exists('/usr/bin/espeak') or os.path.exists('/bin/espeak'): + print('espeak: OK') +else: + print('espeak: FAIL') + available = available and False +if available: + currentInstallation.append('genericDriver (speech)') # SUMMERY -print('') +print('====================') available = True missing = [] for element in defaultInstallation: