summaryrefslogtreecommitdiff
path: root/gui/greeter/gdmthemetester.in
blob: 139e1e0146155b43c753d13dfd625602ed2650a1 (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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#!/bin/sh

gdmwhich () {
  COMMAND="$1"
  OUTPUT=
  IFS=:
  for dir in $PATH
  do
    if test -x "$dir/$COMMAND" ; then
      if test "x$OUTPUT" = "x" ; then
        OUTPUT="$dir/$COMMAND"
      fi
    fi
  done
  IFS=$OLD_IFS
  echo "$OUTPUT"
}

echo
echo "GDM Theme Tester"
echo
echo "Be sure to test all the environments:"
echo " console, console-timed, flexi, remote-flexi, xdmcp"
echo "Also be sure to test using caps lock"
echo

XNEST=`gdmwhich Xnest`
GDMXNEST=`gdmwhich gdmXnest`
GDMGREETER="@libexecdir@/gdmgreeter"

if [ x$XNEST = x ]; then
	echo "ERROR: Xnest not found"
        echo ""
	exit 1
fi

if [ x$GDMXNEST = x ]; then
	echo "ERROR: gdmXnest not found"
        echo ""
	exit 1
fi

if [ x$GDMGREETER = x ]; then
	echo "ERROR: gdmgreeter not found"
        echo ""
	exit 1
fi

USAGE="
Usage: $0 <environment> <theme>
<environment> is one of: console, console-timed, flexi, remote-flexi, xdmcp
<theme> is either the path of the theme or the name of an installed theme

If you set the environment variable XNESTSIZE to <width>x<height> (e.g. 800x600)
you can test the greeter at that resolution
"
if [ "$#" != 2 ]; then
	echo "$USAGE"
	exit 1
fi

GDM_THEME="$2"
DOING_GDM_DEVELOPMENT=yes
GDM_PARENT_DISPLAY="$DISPLAY"
export GDM_THEME DOING_GDM_DEVELOPMENT GDM_PARENT_DISPLAY

case $1 in
console)
	GDM_IS_LOCAL=yes
	export GDM_IS_LOCAL
	;;
console-timed)
	GDM_IS_LOCAL=yes
	GDM_FAKE_TIMED=yes
	export GDM_IS_LOCAL GDM_FAKE_TIMED
	;;
flexi)
	GDM_IS_LOCAL=yes
	GDM_FLEXI_SERVER=yes
	export GDM_IS_LOCAL GDM_FLEXI_SERVER
	;;
remote-flexi)
	GDM_FLEXI_SERVER=yes
	export GDM_FLEXI_SERVER
	;;
xdmcp)
	;;
*)
	echo "$USAGE"
	exit 1
	;;
esac

if [ "x$XNESTSIZE" = x ] ; then
  eval `gdmXnest -b`
else
  eval `gdmXnest -b -o "-geometry $XNESTSIZE"`
fi
export DISPLAY

if [ "x$GDM_PARENT_DISPLAY" = "x$DISPLAY" ]; then
	echo "ERROR: Can't start the Xnest server"
	exit 1
fi

# This may not be necessary
sleep 1

@libexecdir@/gdmgreeter