From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from opera.rednote.net (opera.rednote.net [208.111.39.221]) by speech.braille.uwo.ca (Postfix) with ESMTP id 2F267C1A340 for ; Tue, 23 Nov 2010 18:12:56 -0500 (EST) Received: from sonata.rednote.net (sonata.rednote.net [IPv6:2001:470:8:4ef:216:d3ff:fecc:ec01]) by opera.rednote.net (8.14.4/8.14.3) with ESMTP id oANNCr5E025667 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 23 Nov 2010 23:12:53 GMT Received: from sonata.rednote.net (sonata.rednote.net [127.0.0.1]) by sonata.rednote.net (8.14.4/8.14.3) with ESMTP id oANNCqLE013241 for ; Tue, 23 Nov 2010 18:12:52 -0500 Received: (from janina@localhost) by sonata.rednote.net (8.14.4/8.14.4/Submit) id oANNCptt013240 for speakup@braille.uwo.ca; Tue, 23 Nov 2010 18:12:51 -0500 X-Authentication-Warning: sonata.rednote.net: janina set sender to janina@rednote.net using -f Date: Tue, 23 Nov 2010 18:12:51 -0500 From: Janina Sajka To: speakup@braille.uwo.ca Subject: Re: If bash can, why not Speakup? Message-ID: <20101123231251.GA2515@sonata.rednote.net> References: <98hbe0$4qqnq3@ipmail04.adl6.internode.on.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <98hbe0$4qqnq3@ipmail04.adl6.internode.on.net> X-Operating-System: Linux sonata.rednote.net 2.6.35.6-48.spk.fc14.x86_64 X-PGP-Key: http://rednote.net/JaninaSajka_gpg_key.html User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: speakup@braille.uwo.ca X-Mailman-Version: 2.1.13 Precedence: list Reply-To: "Speakup is a screen review system for Linux." List-Id: "Speakup is a screen review system for Linux." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Nov 2010 23:12:56 -0000 pj@pjb.com.au writes: > Janina Sajka wrote: > > to track whether I'm in insert or command mode, i.e. it would > > sure help if Speakup could give me a differently pitched voice > > Misunderstanding this to be about vim itself :-( , I wrote: > > Presumably by writing something to somewhere in > > /sys/accessibility/speakup/ (or /proc/speakup ?) > > ... It might be possible to do it with a vim script > > And it is possible :-) if you copy spokenmode.vim (after the .sig) > into your ~/.vim/plugin/ dir (you might have to mkdir it first) > then you should see the contents of /tmp/t change according to > the editing mode. > Oh, this is very very cool! Thank you. I'm still struggling to make it automatic, though. Some concerns ... * It's not autoloading. I haveI'm still struggling to make it * automatic, though. Some concerns ... * Placing the script in .vim/plugin/ isn't enough to get the functionality working. I have to: :source .vim/plugin/spokenmode.vim Of course, this can be dropped into ~.vimrc. > It just remains to find something in /sys/accessibility/speakup/ > which switches between two suitable voices... > So, where you have "low" and "high" I can substitute a value and direct it to /sys/accessibility/speakup/soft/pitch . However, this file is owned by root (and group root). So, is there a way to add sudo to the writefile command in vim scripts? Thank you, Peter. for this lovely gem. I can tell I'm going to use it constantly. Janina > Regards, Peter Billam > > http://www.pjb.com.au pj@pjb.com.au (03) 6278 9410 > "Was der Meister nicht kann, vermöcht es der Knabe, hätt er > ihm immer gehorcht?" Siegfried to Mime, from Act 1 Scene 2 > > -------------------------------------- > > " spokenmode.vim: cause Speakup to use a different tone of voice > " according to whether Vim is in insert mode or command mode > " 1.0, 2010.10.18 > " inherits much from obviousmode.vim, by Brian Lewis and Sergey Vlasov > " 1. Put spokenmode.vim in ~/.vim/plugins/ > > if &cp || exists('g:loaded_spokenmode') > finish > endif > > let s:isInsertMode = 0 > > function! s:InsertEnter() > let s:isInsertMode = 1 > call writefile(['low'], "/tmp/t") > endfunction > > function! s:InsertLeave() > let s:isInsertMode = 0 > call writefile(['high'], "/tmp/t") > endfunction > > au InsertEnter * call s:InsertEnter() > au InsertLeave * call s:InsertLeave() > > let g:loaded_spokenmode = 1 > > _______________________________________________ > Speakup mailing list > Speakup@braille.uwo.ca > http://speech.braille.uwo.ca/mailman/listinfo/speakup -- Janina Sajka, Phone: +1.443.300.2200 sip:janina@asterisk.rednote.net Chair, Open Accessibility janina@a11y.org Linux Foundation http://a11y.org Chair, Protocols & Formats Web Accessibility Initiative http://www.w3.org/wai/pf World Wide Web Consortium (W3C)