summaryrefslogtreecommitdiffstats
path: root/abs/core/LinHES-system/lh_message.sh
blob: 203d12798e0d8e1a70d7bf8e4941c2a6c6f6f06e (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
#!/bin/bash
MYTH_RUN_STATUS="1"
. /etc/profile
. /etc/systemconfig


if [ -e /etc/X11/WINDOWMANAGER ]
then
    . /etc/X11/WINDOWMANAGER
fi


. /etc/osd_cat.cfg || {
        color=yellow
        outline=2
        outlinecolour=black
        shadow=0
        shadowcolour=black
        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 msg_osd(){
    DISPLAY=127.0.0.1:0   echo -e "$1"  | DISPLAY=127.0.0.1:0 osd_cat --pos=middle --align=center --offset=200 --delay=5 --color=$color --outline=$outline --outlinecolour=$outlinecolour --shadow=$shadow --shadowcolour=$shadowcolour --font=$font
}

function msg_pyosd(){
    DISPLAY=127.0.0.1:0 /usr/LH/bin/xmsg.py -m "$1"
}

function msg(){
    if [ x$STARTUP_STYLE = xmythvantage ]
    then
        msg_pyosd "$1"
    else
        msg_osd "$1"
    fi

}

if [ x"${@}" = x ]
then
    print "nothing to display"
else
    msg "${@}"
fi