summarylogtreecommitdiffstats
path: root/Xsetup
blob: 4c72ee34f7aa679748e0a4205539ebc7c1e696c7 (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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
#!/bin/sh
source /etc/xdm-hallo/xdm-hallo.rc

function PopUp ()
{
	$XDM_HALLO_BUTTONS_PATH $XDM_HALLO_BUTTONS_ARGS $* "" &
	PID=$!
	echo $PID > $XDM_HALLO_BUTTONS_PID
	wait $PID
}

if [[ -v XDM_HALLO_KEYB_LED_PATH ]]; then
	$XDM_HALLO_KEYB_LED_PATH $XDM_HALLO_KEYB_LED_ARGS
fi

if [[ -v XDM_HALLO_BG_COLOR_PATH ]]; then
	$XDM_HALLO_BG_COLOR_PATH $XDM_HALLO_BG_COLOR_ARGS
fi

if [[ -v XDM_HALLO_BG_WALLPAPER_PATH ]]; then
	$XDM_HALLO_BG_WALLPAPER_PATH $XDM_HALLO_BG_WALLPAPER_ARGS
fi

if [[ -v XDM_HALLO_CLOCK_PATH ]]; then
	$XDM_HALLO_CLOCK_PATH $XDM_HALLO_CLOCK_ARGS & echo $! > $XDM_HALLO_CLOCK_PID
fi

if [[ -v XDM_HALLO_BUTTONS_PATH ]]; then
  (
    declare -i LOOP=1
    declare -i RC=0
    while (( LOOP == 1 ))
      do
	PopUp $XDM_HALLO_BUTTONS_MENU
	RC=$?
	case $RC in
	99)
		PopUp $XDM_HALLO_BUTTONS_SUBMENU
		RC=$?
		case $RC in
		11)
			if [[ -v XDM_HALLO_SCREENSHOT_PATH ]]; then
				$XDM_HALLO_SCREENSHOT_PATH $XDM_HALLO_SCREENSHOT_ARGS -e "$XDM_HALLO_NOTIFY_PATH $XDM_HALLO_NOTIFY_ARGS '' \$f" &
			fi
		;;
		20|21|22|23|24|25)
			TIMEOUT=${XDM_HALLO_SCREENSAVER[$(( $RC - 20 ))]}
			if [[ -v XDM_HALLO_SCREEN_SET_PATH ]]; then
				$XDM_HALLO_SCREEN_SET_PATH $XDM_HALLO_SCREEN_SET_ARGS $TIMEOUT $TIMEOUT $TIMEOUT
			fi
		;;
		*)
			if (( $RC > 128 )); then
				LOOP=0
			fi
		;;
		esac
	;;
	11)
		PopUp $XDM_HALLO_BUTTONS_PWROFF
		RC=$?
		case $RC in
		11)
			$XDM_HALLO_POWEROFF_CMD
		;;
		*)
			if (( $RC > 128 )); then
				LOOP=0
			fi
		;;
		esac
	;;
	12)
		PopUp $XDM_HALLO_BUTTONS_HALT
		RC=$?
		case $RC in
		11)
			$XDM_HALLO_HALT_CMD
		;;
		*)
			if (( $RC > 128 )); then
				LOOP=0
			fi
		;;
		esac
	;;
	13)
		PopUp $XDM_HALLO_BUTTONS_REBOOT
		RC=$?
		case $RC in
		11)
			$XDM_HALLO_REBOOT_CMD
		;;
		*)
			if (( $RC > 128 )); then
				LOOP=0
			fi
		;;
		esac
	;;
	14)
		$XDM_HALLO_SLEEP_CMD
	;;
	15)
		PopUp $XDM_HALLO_BUTTONS_RESCUE
		RC=$?
		case $RC in
		11)
			$XDM_HALLO_RESCUE_CMD
		;;
		*)
			if (( $RC > 128 )); then
				LOOP=0
			fi
		;;
		esac
	;;
        *)
		if (( $RC > 128 )); then
			LOOP=0
		fi
	;;
	esac
      done
  ) &
fi