summaryrefslogtreecommitdiffstats
path: root/accessibility/gnopernicus/files/gnopernicus-mag-config
blob: ae13fd323dcdc3aaaa03394c5b2196a6ac1327ad (plain) (blame)
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
#!/bin/sh

GNOPI_RES_X=`gconftool-2 --get /apps/gnopernicus/magnifier/schema1/generic_zoomer/display_size_x`
GNOPI_RES_Y=`gconftool-2 --get /apps/gnopernicus/magnifier/schema1/generic_zoomer/display_size_y`

OLD_SOURCE=`gconftool-2 --get /apps/gnopernicus/magnifier/schema1/generic_zoomer/source`
OLD_TARGET=`gconftool-2 --get /apps/gnopernicus/magnifier/schema1/generic_zoomer/target`

SPLITSCREEN_RES_X=`expr $GNOPI_RES_X / 2`


if test $# -eq 0; then
    echo "Usage: gnopernicus-magnifier [-s] [-t] [[-F] | [-S]]
    -s source_display  Sets the magnifier source display screen. Eg (:0.0)
    -t target_display  Sets the magnifier target display screen. Eg (:0.0)
    -F         Sets the magnifier placement so it will cover the 
           whole screen (Fullscreen).
    -S         Sets the magnifier placement so it will cover the right
               vertical half of the screen (Vertical Split Screen).
Note:  When doing a full scren magnification, the source/target screens 
       have to be set before the full-screen mode and their values have to be different"
exit 1
fi

while getopts ":FSs:at:b" Option

do
    case $Option in
    F)
        echo "FullScreen"
        if test "x$OLD_SOURCE" = "x$OLD_TARGET"; then
        echo "Source and target are the same.Please set them different first"
        exit 1
        fi
        echo "Setting fullscreen mode."
        gconftool-2 --set --type=int  /apps/gnopernicus/magnifier/schema1/generic_zoomer/zp_left 0
        gconftool-2 --set --type=int /apps/gnopernicus/magnifier/schema1/generic_zoomer/zp_top   0
        gconftool-2 --set --type=int /apps/gnopernicus/magnifier/schema1/generic_zoomer/zp_width  $GNOPI_RES_X
        gconftool-2 --set --type=int /apps/gnopernicus/magnifier/schema1/generic_zoomer/zp_height $GNOPI_RES_Y
        ;;
    S)  
        echo "Setting vertical split screen mode."
        gconftool-2 --set --type=int  /apps/gnopernicus/magnifier/schema1/generic_zoomer/zp_left  $SPLITSCREEN_RES_X
        gconftool-2 --set --type=int /apps/gnopernicus/magnifier/schema1/generic_zoomer/zp_top    0
        gconftool-2 --set --type=int /apps/gnopernicus/magnifier/schema1/generic_zoomer/zp_width  $GNOPI_RES_X
        gconftool-2 --set --type=int /apps/gnopernicus/magnifier/schema1/generic_zoomer/zp_height $GNOPI_RES_Y
        ;;
    s)
        
        echo "Setting magnifier source screen value from [$OLD_SOURCE] to [$OPTARG]"
        gconftool-2 --set --type=string /apps/gnopernicus/magnifier/schema1/generic_zoomer/source $OPTARG
        OLD_SOURCE=$OPTARG
        ;;
    t)
        
        echo "Setting magnifier target screen value from [$OLD_TARGET] to [$OPTARG]"
        gconftool-2 --set --type=string /apps/gnopernicus/magnifier/schema1/generic_zoomer/target $OPTARG
        OLD_TARGET=$OPTARG
        ;;
    *)
        echo "Not handled!"
        ;;
    esac
done
shift $(($OPTIND - 1))