summaryrefslogtreecommitdiffstats
path: root/abs/core-testing/tweaker/bin/twk_keymap.sh
blob: 7e4ef8b304ac6158b54200d9ae9e6e949031b257 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/bin/bash

# Copyright 2007-2009 Robert ("Bob") Igo of StormLogic, LLC and mythic.tv.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

# This script is called from twk_general.pl to implement keymap standardization in KnoppMyth

#KNOPPMYTH_SHARE=/usr/local/share/knoppmyth

####################
# Unify key mappings
####################

# Universal keybindings:
# Function	Remote Key	Keyboard Key
# ------------------------------------------
# Skip Back	<<		PgUp
# Skip Forward	>>		PgDn
# Play		|>		l
# Pause		||		p
# Stop		[]		ESC

#Make xine use keymappings that get along with mplayer, MythMusic, and ATI remote button mappings.
#NOTE: "Prior" is PageUp and "Next" is PageDown
#if [[ -f $MYTH_HOME/.xine/keymap ]]; then
#    sed -i "/Mute {$/{N; s/key = .*/key = VOID/; }" $MYTH_HOME/.xine/keymap
#    sed -i "/MrlBrowser {$/{N; s/key = .*/key = VOID/; }" $MYTH_HOME/.xine/keymap
#    sed -i "/NextMrl {$/{N; s/key = .*/key = VOID/; }" $MYTH_HOME/.xine/keymap
#    sed -i "/PriorMrl {$/{N; s/key = .*/key = VOID/; }" $MYTH_HOME/.xine/keymap
#    sed -i "/AudioVideoDecay+ {$/{N; s/key = .*/key = VOID/; }" $MYTH_HOME/.xine/keymap
#    sed -i "/ToggleLoopMode {$/{N; s/key = .*/key = VOID/; }" $MYTH_HOME/.xine/keymap
#    sed -i "/PlaylistStop {$/{N; s/key = .*/key = VOID/; }" $MYTH_HOME/.xine/keymap
#    sed -i "/Mute {$/{N; N; s/modifier = .*/modifier = none/; }" $MYTH_HOME/.xine/keymap
#    sed -i "/Quit {$/{N; s/key = .*/key = Escape/; }" $MYTH_HOME/.xine/keymap
#    sed -i "/^Menu {$/{N; s/key = .*/key = m/; }" $MYTH_HOME/.xine/keymap
#    sed -i "/Play {$/{N; s/key = .*/key = l/; }" $MYTH_HOME/.xine/keymap
#    sed -i "/Pause {$/{N; s/key = .*/key = p/; }" $MYTH_HOME/.xine/keymap
#    sed -i "/SeekRelative+60 {$/{N; s/key = .*/key = Next/; }" $MYTH_HOME/.xine/keymap
#    sed -i "/SeekRelative-60 {$/{N; s/key = .*/key = Prior/; }" $MYTH_HOME/.xine/keymap
#    sed -i "/Volume+ {$/{N; s/key = .*/key = ]/; }" $MYTH_HOME/.xine/keymap
#    sed -i "/Volume- {$/{N; s/key = .*/key = [/; }" $MYTH_HOME/.xine/keymap
#else
#    mkdir -p $MYTH_HOME/.xine/
#    /bin/cp $KNOPPMYTH_SHARE/xine_keymap $MYTH_HOME/.xine/keymap
#fi    
#chown -fR mythtv:mythtv $MYTH_HOME/.xine


#Make mplayer use keymappings that get along with xine, MythMusic, and ATI remote button mappings.
#NOTE: PGUP is PageUp and PGDWN is PageDown
if [[ -f /etc/mplayer/input.conf ]]; then
    sed -i "s/^PGUP .*/PGUP seek -60/" /etc/mplayer/input.conf
    sed -i "s/^PGDWN .*/PGDWN seek +60/" /etc/mplayer/input.conf
    sed -i "s/^p .*/p pause/" /etc/mplayer/input.conf
    sed -i "s/^l .*/l pause/" /etc/mplayer/input.conf
else
    echo "ERROR: /etc/mplayer/input.conf is missing, which is unexpected."
    exit -1
fi

echo "Tweaked keymap"