summaryrefslogtreecommitdiffstats
path: root/abs/not_built/core/tweaker/bin/twk_keymap.sh
diff options
context:
space:
mode:
Diffstat (limited to 'abs/not_built/core/tweaker/bin/twk_keymap.sh')
-rwxr-xr-xabs/not_built/core/tweaker/bin/twk_keymap.sh66
1 files changed, 66 insertions, 0 deletions
diff --git a/abs/not_built/core/tweaker/bin/twk_keymap.sh b/abs/not_built/core/tweaker/bin/twk_keymap.sh
new file mode 100755
index 0000000..c7f4093
--- /dev/null
+++ b/abs/not_built/core/tweaker/bin/twk_keymap.sh
@@ -0,0 +1,66 @@
+#!/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 mplayer use keymappings that are compatible with other media player keymappings.
+#NOTE: PGUP is PageUp and PGDWN is PageDown
+MPLAYER_CONF=/etc/mplayer/input.conf
+if [[ -f $MPLAYER_CONF ]]; then
+ sed -i "s/^PGUP .*/PGUP seek -60/" $MPLAYER_CONF
+ sed -i "s/^PGDWN .*/PGDWN seek +60/" $MPLAYER_CONF
+ sed -i "s/^p .*/p pause/" $MPLAYER_CONF
+ sed -i "s/^l .*/l pause/" $MPLAYER_CONF
+else
+ echo "ERROR: $MPLAYER_CONF is missing, which is unexpected."
+ exit -1
+fi
+
+#Do the same for smplayer
+SMPLAYER_CONF=/home/mythtv/.config/smplayer/smplayer.ini
+if [[ -f $SMPLAYER_CONF ]]; then
+ echo "INFO: $SMPLAYER_CONF found; tweaking now"
+else
+ echo "INFO: $SMPLAYER_CONF is missing; installing full version, then (re-)tweaking"
+ sudo -u mythtv mkdir -p /home/mythtv/.config/smplayer/
+ /bin/cp $TWEAKER_ROOT/fs$SMPLAYER_CONF $SMPLAYER_CONF
+fi
+sed -i "s/rewind3=.*/rewind3=PgUp/" $SMPLAYER_CONF
+sed -i "s/forward3=.*/forward3=PgDown/" $SMPLAYER_CONF
+sed -i "s/quit=.*/quit=Esc/" $SMPLAYER_CONF
+sed -i "s/pause=.*/pause=P/" $SMPLAYER_CONF
+sed -i "s/play=.*/play=L/" $SMPLAYER_CONF
+# Remove conflicting keybindings
+sed -i "s/stop=.*/stop=/" $SMPLAYER_CONF
+sed -i "s/play_or_pause=.*/play_or_pause=/" $SMPLAYER_CONF
+sed -i "s/exit_fullscreen=.*/exit_fullscreen=/" $SMPLAYER_CONF
+sed -i "s/pl_play=.*/pl_play=/" $SMPLAYER_CONF