[SCM] Debian Live application startscripts branch, master, updated. 69b0a52352c0ce3dd2f9c3f9cc2facef3b421526
Daniel Baumann
daniel at debian.org
Sat Nov 29 23:19:58 UTC 2008
The following commit has been merged in the master branch:
commit 69b0a52352c0ce3dd2f9c3f9cc2facef3b421526
Author: Daniel Baumann <daniel at debian.org>
Date: Sun Nov 30 00:17:24 2008 +0100
Rewriting sed function.
diff --git a/contrib/live_bolzplatz b/contrib/live_bolzplatz
index eda08ba..b6836a8 100755
--- a/contrib/live_bolzplatz
+++ b/contrib/live_bolzplatz
@@ -1,7 +1,7 @@
. $(dirname $0)/start_tools.sh
-replace "<width>.*<\/width>" "<width>${RESX}<\/width>" /opt/bolzplatz2006/data/config/video.xml
-replace "<height>.*<\/height>" "<height>${RESY}<\/height>" /opt/bolzplatz2006/data/config/video.xml
+Replace "<width>.*<\/width>" "<width>${RESX}<\/width>" /opt/bolzplatz2006/data/config/video.xml
+Replace "<height>.*<\/height>" "<height>${RESY}<\/height>" /opt/bolzplatz2006/data/config/video.xml
cd /opt/bolzplatz2006/
./bolzplatz2006.sh
diff --git a/functions/sed.sh b/functions/sed.sh
new file mode 100755
index 0000000..027a4f5
--- /dev/null
+++ b/functions/sed.sh
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+Replace ()
+{
+ _REGEXP="${1}"
+ _REPLACEMENT="${2}"
+ _FILE="${3}"
+
+ sed -i -e "s|${_REGEXP}|${_REPLACEMENT}|g" "${_FILE}"
+}
diff --git a/functions/start_tools.sh b/functions/start_tools.sh
deleted file mode 100755
index 6ccd47f..0000000
--- a/functions/start_tools.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-replace() {
-sed -i -e "s/$1/$2/" $3
-}
diff --git a/scripts/live_armagetronad b/scripts/live_armagetronad
index 29cf36a..0970163 100755
--- a/scripts/live_armagetronad
+++ b/scripts/live_armagetronad
@@ -1,7 +1,7 @@
. $(dirname $0)/start_tools.sh
-replace "ARMAGETRON_SCREENMODE .*" "ARMAGETRON_SCREENMODE -1" ~/.armagetronad/var/user.cfg
-replace "ARMAGETRON_SCREENMODE_W .*" "ARMAGETRON_SCREENMODE_W ${RESX}" ~/.armagetronad/var/user.cfg
-replace "ARMAGETRON_SCREENMODE_H .*" "ARMAGETRON_SCREENMODE_H ${RESY}" ~/.armagetronad/var/user.cfg
+Replace "ARMAGETRON_SCREENMODE .*" "ARMAGETRON_SCREENMODE -1" ~/.armagetronad/var/user.cfg
+Replace "ARMAGETRON_SCREENMODE_W .*" "ARMAGETRON_SCREENMODE_W ${RESX}" ~/.armagetronad/var/user.cfg
+Replace "ARMAGETRON_SCREENMODE_H .*" "ARMAGETRON_SCREENMODE_H ${RESY}" ~/.armagetronad/var/user.cfg
armagetronad
diff --git a/scripts/live_chromium b/scripts/live_chromium
index a55b01e..1b82e98 100755
--- a/scripts/live_chromium
+++ b/scripts/live_chromium
@@ -5,7 +5,7 @@ SCREEN_SIZE=0
[ $RESX -ge 800 -a $RESY -ge 600 ] && SCREEN_SIZE=2
[ $RESX -ge 1024 -a $RESY -ge 768 ] && SCREEN_SIZE=3
[ $RESX -ge 1280 -a $RESY -ge 960 ] && SCREEN_SIZE=4
-replace "screenSize .*" "screenSize $SCREEN_SIZE" ~/.chromium
+Replace "screenSize .*" "screenSize $SCREEN_SIZE" ~/.chromium
chromium
diff --git a/scripts/live_enigma b/scripts/live_enigma
index e7778d4..6473de5 100755
--- a/scripts/live_enigma
+++ b/scripts/live_enigma
@@ -4,12 +4,12 @@
if [ $(($RESX*3/4)) -eq $RESY -o $(($RESX*4/5)) -eq $RESY ]; then
# we have a 4:3 or a 5:4 resolution
# we can go fullscreen
- replace "FullScreen\" value=\".*\"" "FullScreen\" value=\"1\"" ~/.enigmarc.xml
+ Replace "FullScreen\" value=\".*\"" "FullScreen\" value=\"1\"" ~/.enigmarc.xml
else
# no 4:3 resolution
# fullscreen would look horrible
# start in window mode
- replace "FullScreen\" value=\".*\"" "FullScreen\" value=\"0\"" ~/.enigmarc.xml
+ Replace "FullScreen\" value=\".*\"" "FullScreen\" value=\"0\"" ~/.enigmarc.xml
# leave some space for kicker and window decoration
RESY=$(($RESY-76))
fi
@@ -18,6 +18,6 @@ fi
SCREEN_SIZE=0
[ $RESX -ge 800 -a $RESY -ge 600 ] && SCREEN_SIZE=2
[ $RESX -ge 1024 -a $RESY -ge 768 ] && SCREEN_SIZE=3
-replace "VideoMode\" value=\".*\"" "VideoMode\" value=\"$SCREEN_SIZE\"" ~/.enigmarc.xml
+Replace "VideoMode\" value=\".*\"" "VideoMode\" value=\"$SCREEN_SIZE\"" ~/.enigmarc.xml
enigma
diff --git a/scripts/live_foobillard b/scripts/live_foobillard
index d11e697..d8d68d5 100755
--- a/scripts/live_foobillard
+++ b/scripts/live_foobillard
@@ -1,5 +1,5 @@
. $(dirname $0)/start_tools.sh
-replace "geometry=.*" "geometry=${RESX}x${RESY}" ~/.foobillardrc
+Replace "geometry=.*" "geometry=${RESX}x${RESY}" ~/.foobillardrc
foobillard
diff --git a/scripts/live_glest b/scripts/live_glest
index e734f87..e813224 100755
--- a/scripts/live_glest
+++ b/scripts/live_glest
@@ -1,6 +1,6 @@
. $(dirname $0)/start_tools.sh
-replace "ScreenWidth=.*" "ScreenWidth=${RESX}" ~/.glest/glest.ini
-replace "ScreenHeight=.*" "ScreenHeight=${RESY}" ~/.glest/glest.ini
+Replace "ScreenWidth=.*" "ScreenWidth=${RESX}" ~/.glest/glest.ini
+Replace "ScreenHeight=.*" "ScreenHeight=${RESY}" ~/.glest/glest.ini
glest
diff --git a/scripts/live_neverball b/scripts/live_neverball
index c31ede3..dd2008a 100755
--- a/scripts/live_neverball
+++ b/scripts/live_neverball
@@ -1,6 +1,6 @@
. $(dirname $0)/start_tools.sh
-replace "width .*" "width ${RESX}" ~/.neverball/neverballrc
-replace "height .*" "height ${RESY}" ~/.neverball/neverballrc
+Replace "width .*" "width ${RESX}" ~/.neverball/neverballrc
+Replace "height .*" "height ${RESY}" ~/.neverball/neverballrc
neverball
diff --git a/scripts/live_neverputt b/scripts/live_neverputt
index 9fa91da..cdc8b2d 100755
--- a/scripts/live_neverputt
+++ b/scripts/live_neverputt
@@ -1,6 +1,6 @@
. $(dirname $0)/start_tools.sh
-replace "width .*" "width ${RESX}" ~/.neverball/neverballrc
-replace "height .*" "height ${RESY}" ~/.neverball/neverballrc
+Replace "width .*" "width ${RESX}" ~/.neverball/neverballrc
+Replace "height .*" "height ${RESY}" ~/.neverball/neverballrc
neverputt
diff --git a/scripts/live_ppracer b/scripts/live_ppracer
index 850001b..25927e4 100755
--- a/scripts/live_ppracer
+++ b/scripts/live_ppracer
@@ -1,6 +1,6 @@
. $(dirname $0)/start_tools.sh
-replace "^set x_resolution .*" "set x_resolution ${RESX}" ~/.ppracer/options
-replace "^set y_resolution .*" "set y_resolution ${RESY}" ~/.ppracer/options
+Replace "^set x_resolution .*" "set x_resolution ${RESX}" ~/.ppracer/options
+Replace "^set y_resolution .*" "set y_resolution ${RESY}" ~/.ppracer/options
ppracer
diff --git a/scripts/live_tomatoes b/scripts/live_tomatoes
index 6a09a87..08d4822 100755
--- a/scripts/live_tomatoes
+++ b/scripts/live_tomatoes
@@ -1,5 +1,5 @@
. $(dirname $0)/start_tools.sh
-replace "video_mode .*" "video_mode = ${RESX} x ${RESY}" ~/.tomatoes/config.cfg
+Replace "video_mode .*" "video_mode = ${RESX} x ${RESY}" ~/.tomatoes/config.cfg
tomatoes
diff --git a/scripts/live_trigger b/scripts/live_trigger
index fc18a7f..fc8d221 100755
--- a/scripts/live_trigger
+++ b/scripts/live_trigger
@@ -1,6 +1,6 @@
. $(dirname $0)/start_tools.sh
-replace "width=.*" "width=\"${RESX}\"" ~/.trigger/trigger.config
-replace "height=.*" "height=\"${RESY}\"" ~/.trigger/trigger.config
+Replace "width=.*" "width=\"${RESX}\"" ~/.trigger/trigger.config
+Replace "height=.*" "height=\"${RESY}\"" ~/.trigger/trigger.config
trigger
diff --git a/scripts/live_wesnoth b/scripts/live_wesnoth
index 86816aa..b90ae43 100755
--- a/scripts/live_wesnoth
+++ b/scripts/live_wesnoth
@@ -1,6 +1,6 @@
. $(dirname $0)/start_tools.sh
-replace "xresolution=.*" "xresolution=\"${RESX}\"" ~/.wesnoth/preferences
-replace "yresolution=.*" "yresolution=\"${RESY}\"" ~/.wesnoth/preferences
+Replace "xresolution=.*" "xresolution=\"${RESX}\"" ~/.wesnoth/preferences
+Replace "yresolution=.*" "yresolution=\"${RESY}\"" ~/.wesnoth/preferences
wesnoth-nolog
diff --git a/scripts/live_xmoto b/scripts/live_xmoto
index 97be7dd..ab1a1fd 100755
--- a/scripts/live_xmoto
+++ b/scripts/live_xmoto
@@ -1,6 +1,6 @@
. $(dirname $0)/start_tools.sh
-replace "DisplayWidth.*" "DisplayWidth\" value=\"${RESX}\"\/\>" ~/.xmoto/config.dat
-replace "DisplayHeight.*" "DisplayHeight\" value=\"${RESY}\"\/\>" ~/.xmoto/config.dat
+Replace "DisplayWidth.*" "DisplayWidth\" value=\"${RESX}\"\/\>" ~/.xmoto/config.dat
+Replace "DisplayHeight.*" "DisplayHeight\" value=\"${RESY}\"\/\>" ~/.xmoto/config.dat
xmoto
--
Debian Live application startscripts
More information about the debian-live-changes
mailing list