/[scripts]/trunk/play-toggle.sh
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /trunk/play-toggle.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 101 - (show annotations)
Thu Nov 20 21:26:04 2008 UTC (15 years, 4 months ago) by dpavlin
File MIME type: application/x-sh
File size: 807 byte(s)
fix esc

1 #!/bin/sh
2
3 # moc(p) support for audio transcribing
4 #
5 # 2008-11-20 Dobrica Pavlinusic <dpavlin@rot13.org>
6
7 cmd="--toggle-pause"
8
9 if echo "x$1x" | grep '^x-*[0-9][0-9]*x$' > /dev/null ; then
10 cmd="--seek $1"
11 elif [ ! -z "$1" ] ; then
12 mocp --info | grep "^$1: " | sed 's/^.*: //'
13 exit
14 fi
15
16 mocp $cmd
17 mocp --info |\
18 egrep '^(State|File|Title|CurrentTime|TotalTime)' |\
19 egrep '^(State|File|Title|CurrentTime|TotalTime)' | sed 's/^[^:]*: *//' |\
20 osd_cat -p bottom -A center -s 3 -f neep-24 -O 2 -d 1 -l 5
21
22 exit
23
24 # insert following in ~/.vimrc:
25
26 " play-pause
27 noremap <esc>[33~ :silent execute "! play-toggle.sh &"<cr>:redraw!<cr>
28 " seek 5 sec backward
29 noremap <esc>[34~ :silent execute "! play-toggle.sh -5 &"<cr>:redraw!<cr>
30 " CurrentTime from mocp --info
31 noremap <esc>[29~ :r !play-toggle.sh CurrentTime<cr>

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26