summaryrefslogtreecommitdiffstats
path: root/abs/core/LinHES-system/LinHES-session
diff options
context:
space:
mode:
Diffstat (limited to 'abs/core/LinHES-system/LinHES-session')
-rwxr-xr-xabs/core/LinHES-system/LinHES-session199
1 files changed, 154 insertions, 45 deletions
diff --git a/abs/core/LinHES-system/LinHES-session b/abs/core/LinHES-system/LinHES-session
index 918406d..61405db 100755
--- a/abs/core/LinHES-system/LinHES-session
+++ b/abs/core/LinHES-system/LinHES-session
@@ -1,7 +1,15 @@
#!/bin/bash
+MYTH_RUN_STATUS="1"
. /etc/profile
. /etc/systemconfig
+
+#set some defaults, then override from /etc/X11/WINDOWMANAGER
+configdir="/usr/share/wm_data"
+WM="e16 -P $configdir/e16_config_dir/"
+STARTUP_STYLE=enhanced
+
+
if [ -e /etc/X11/WINDOWMANAGER ]
then
. /etc/X11/WINDOWMANAGER
@@ -13,6 +21,9 @@ xset -dpms s off
export MALLOC_CHECK_=0
+MYTH_ARGS="-d --syslog local6"
+[ -f /etc/conf.d/mythfrontend ] && . /etc/conf.d/mythfrontend
+
# # Run any scripting that applies to special hardware. These brand-specific commands that run
@@ -46,25 +57,25 @@ export MALLOC_CHECK_=0
# font="-adobe-helvetica-bold-*-*-*-34-*-*-*-*-*-*-*"
# }
#
-function delay_osd(){
- if [ x$STARTUP_STYLE = xmythvantage ]
- then
- cmd="ps -ef | grep -v grep | grep -q xmsg.py"
- else
- cmd="ps -ef | grep -v grep | grep -q osd_cat"
- fi
-
- eval $cmd
-
- rc=$?
- while [ $rc = 0 ]
- do
- eval $cmd
- rc=$?
- done
-
-
- }
+# function delay_osd(){
+# if [ x$STARTUP_STYLE = xenhanced ]
+# then
+# cmd="ps -ef | grep -v grep | grep -q xmsg.py"
+# else
+# cmd="ps -ef | grep -v grep | grep -q osd_cat"
+# fi
+#
+# eval $cmd
+#
+# rc=$?
+# while [ $rc = 0 ]
+# do
+# eval $cmd
+# rc=$?
+# done
+#
+#
+# }
#
# function msg_osd(){
# echo -e "$1" | osd_cat --pos=middle --align=center --offset=200 --delay=5 --color=$color --outline=$outline --outlinecolour=$outlinecolour --shadow=$shadow --shadowcolour=$shadowcolour --font=$font
@@ -75,18 +86,13 @@ function delay_osd(){
# }
function msg(){
-# if [ x$STARTUP_STYLE = xmythvantage ]
-# then
-# msg_pyosd "$1"
-# else
-# msg_osd "$1"
-# fi
- /usr/LH/bin/lh_message.sh "$1"
+ #/usr/LH/bin/lh_message.sh "$1"
+ /usr/LH/bin/msg_client.py --msg "$1"
}
function unclutter(){
- if [ -e /etc/unclutter ]
+ if [ -e /etc/unclutter.cfg ]
then
. /etc/unclutter.cfg
else
@@ -94,7 +100,7 @@ function unclutter(){
jitter=200
fi
- /usr/X11R6/bin/unclutter -root -idle $idle -jitter $jitter -noevents &
+ /usr/bin/unclutter -root -idle $idle -jitter $jitter -noevents &
}
function keylaunch(){
@@ -111,6 +117,31 @@ function keylaunch(){
}
+function start_x11vnc(){
+ if [ x$xvncenable = "x1" ]
+ then
+ if [ -e /etc/x11vnc.cfg ]
+ then
+ . /etc/x11vnc.cfg
+ x11vnc $x11vnc_options
+ else
+ x11vnc -rfbport 5902 --passwd $xvncpassword
+ fi
+ fi
+}
+
+
+function fluxbox_settings(){
+ if [ ! -e $HOME/.fluxbox ]
+ then
+ echo "setting symlink fluxbox"
+ configdir=/usr/share/fluxbox_settings
+ ln -s $configdir $HOME/.fluxbox
+ fi
+
+}
+
+
function load_nvidia_settings(){
lsmod |cut -f1 -d" " |grep -q nvidia
@@ -180,12 +211,11 @@ function show_help_tip(){
if [ x$ShowTips = "x1" ]
then
- msg "Alt+h for help" &
+ msg "Alt+h for help"
fi
}
function notify_scan(){
- delay_osd
if [ -e /tmp/scan_report ]
then
msg "\nNew storage found. \nRun add_storage.py for details"
@@ -193,6 +223,17 @@ function notify_scan(){
}
+function auto_start(){
+ asdir="/etc/X11/autostart"
+ for i in `ls $asdir/*`
+ do
+ if [ -x $i ]
+ then
+ echo "Starting $i"
+ $i &
+ fi
+ done
+ }
function update_apple_trailers(){
#update apple trailers
@@ -204,7 +245,7 @@ function update_apple_trailers(){
function first_configure(){
- if [ x$STARTUP_STYLE = xmythvantage ]
+ if [ ! x$STARTUP_STYLE = xlegacy ]
then
first_configure_mv
else
@@ -231,7 +272,6 @@ function first_configure_default(){
fi
sudo sv stop mythbackend
- /usr/LH/bin/dtheme.sh
xterm -fn *18* -e sudo taskset -c 0 /usr/bin/mythtv-setup
sudo sv start mythbackend
sudo chown -R mythtv.mythtv /home/mythtv
@@ -239,7 +279,13 @@ function first_configure_default(){
msg "Guide data is being loaded. \n Until this completes\n some shows will appear as unknown \n in the program guide."
rm ~/.configure
fi
+ else
+ if [ -f ~/.configure ]
+ then
+ rm -f ~/.configure
+ fi
fi
+
}
@@ -248,18 +294,24 @@ function first_configure_mv(){
then
if [ -f ~/.configure ]
then
- msg "This is the first time starting MythTV.\nThe MythTV backend process will be stopped for setup."
+ msg "New install of LinHES; starting setup."
#for now skip these
#autocard.py -g &
#MythVantage -b
#0 yes
#1 yes/autodetech
#2 no
+ while [ -e '/var/run/autocard.lock' ]
+ do
+ msg "Waiting for capture card detection to complete"
+ sleep 5
+ done
STATUS=$?
if [ ! $STATUS = 2 ]
then
/usr/MythVantage/bin/backend_control.sh stop BE 127.0.0.1
msg "MythTV setup is starting.\nPlease follow the steps for adding tuners and guide data."
+ run_wmctrl &
/usr/bin/taskset -c 0 /usr/bin/mythtv-setup
/usr/MythVantage/bin/backend_control.sh start BE 127.0.0.1
fi
@@ -267,6 +319,11 @@ function first_configure_mv(){
msg "Guide data is being loaded. \nUntil this completes \nsome shows will appear as "unknown" \nin the program guide."
rm -f ~/.configure
fi
+ else
+ if [ -f ~/.configure ]
+ then
+ rm -f ~/.configure
+ fi
fi
}
@@ -280,17 +337,28 @@ function start_myth() {
then
STARTCMD="/usr/bin/mythfrontend -d -l /var/log/mythtv/mythfrontend.log"
else
- STARTCMD="/usr/bin/mythfrontend -d --syslog local6"
+ STARTCMD="/usr/bin/mythfrontend $MYTH_ARGS"
fi
fi
echo "====================================================================="
echo "Starting $STARTCMD"
- firstboot.sh &
+ if [ "x$bewait" = "x1" ]
+ then
+ #do init check
+ /usr/LH/bin/be_check.py
+ rc=$?
+ while [ $rc -ne 0 ]
+ do
+ msg "Waiting for connection to MythBackend"
+ /usr/LH/bin/be_check.py
+ rc=$?
+ sleep 6
+ done
+ fi
#continue on with starting mythtv
-
- if [ x$STARTUP_STYLE = xmythvantage ]
+ if [ ! x$STARTUP_STYLE = xlegacy ]
then
start_myth_mv
else
@@ -299,6 +367,28 @@ function start_myth() {
}
+function run_wmctrl(){
+ done="False"
+ for i in `seq 60`
+ do
+ for name in "MythTV Frontend" "MythTV Setup" "mythwelcome"
+ do
+ xwininfo -name "$name" >/dev/null
+ rcx=$?
+ if [ $rcx = 0 ]
+ then
+ wmctrl -r "$name" -b remove,fullscreen
+ done="True"
+ fi
+ done
+ if [ $done = "True" ]
+ then
+ break
+ fi
+ sleep 5
+ done
+
+}
function run_myth(){
if [ -f /tmp/nomfe ]
@@ -315,8 +405,10 @@ function run_myth(){
killall -9 irexec
/usr/bin/irexec -d
- if [ x$STARTUP_STYLE = xmythvantage ]
+ if [ ! x$STARTUP_STYLE = xlegacy ]
then
+
+ run_wmctrl &
$STARTCMD 2>&1
else
$STARTCMD 2>&1 &
@@ -340,39 +432,56 @@ function set_background()
{
echo "Setting the background"
- }
+}
+# if [ x"$WM" = "xdefault" ]
+# then
+# # fluxbox > /var/log/fluxbox.log 2>&1
+# WM=fluxbox
+# fi
+#
+#
+# if [ x"$WM" = "x" ]
+# then
+# # fluxbox > /var/log/fluxbox.log 2>&1
+# WM=fluxbox
+# fi
+#
-if [ x$WM = "x" ]
+if [ $WM = "fluxbox" ]
then
-# fluxbox > /var/log/fluxbox.log 2>&1
- WM=fluxbox
+ fluxbox_settings
fi
+
+
#if using mythvantage style, start the WM right away
# this is done so that starting mythtv can loop.
$WM &
pid=$!
mouse_move
keylaunch
-set_background
+start_x11vnc &
+#set_background
unclutter
load_nvidia_settings
run_tilda
start_screensaver
-show_help_tip
notify_scan &
+auto_start &
update_apple_trailers
first_configure
+show_help_tip
start_myth
# wait for the windowmanger
#This will make the session wait on the WM to exit.
-if [ x$STARTUP_STYLE != xmythvantage ]
+if [ x$STARTUP_STYLE = xlegacy ]
then
wait $pid
fi
+wmctrl -r "MythTV Frontend" -b remove,fullscreen