If bash can, why not Speakup?

Janina Sajka janina at rednote.net
Tue Nov 23 18:12:51 EST 2010


pj at 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 at 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 at braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup

-- 

Janina Sajka,	Phone:	+1.443.300.2200
		sip:janina at asterisk.rednote.net

Chair, Open Accessibility	janina at a11y.org	
Linux Foundation		http://a11y.org

Chair, Protocols & Formats
Web Accessibility Initiative	http://www.w3.org/wai/pf
World Wide Web Consortium (W3C)




More information about the Speakup mailing list