blob: 79a55543a91a33283b6c8825a79bb8358b496d0c (
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
|
#!/bin/bash
# This file is part of the german Neo keyboard layout
#
# GUI to combine several Compose modules written by Neo keyboard layout
# This file has been originally written by Pascal Hauck (neo@pascalhauck.de)
SRC=./src # Source directory
CONFFILE=.config
# colours in the Bash
normal="\033[0m"
red="\033[31m"
orange="\033[33m"
green="\033[32m"
if [ "X:$KDE_FULL_SESSION" = "X:true" ]; then
NL="<br>"
ADD_TO_LIST() {
list=("${list[@]}" "$1" "$2" "$3")
}
CHECKLIST() {
kdialog --title Compose-Module --checklist "$1" "${list[@]}"
}
MSGBOX() {
kdialog --title Compose-Module --msgbox "$1"
}
YESNO() {
kdialog --title Compose-Module --yesno "$1"
}
elif [ -n "`which zenity 2>/dev/null`" ] && [ ${DISPLAY} ]; then
NL="\n"
ADD_TO_LIST() {
list=("${list[@]}" "$1" "$2")
}
CHECKLIST() {
zenity --title Compose-Module --width=610 --height=320 --list --multiple --column Modulname --column Modulebeschreibung --separator=_ --text "$1${NL}$2" "${list[@]}"
}
MSGBOX() {
zenity --title Compose-Module --info --text "$1"
}
YESNO() {
zenity --title Compose-Module --question --text "$1"
}
elif [ -n "`which dialog 2>/dev/null`" ]; then
NL="\n"
ADD_TO_LIST() {
list=("${list[@]}" "$1" "$2" "$3")
}
CHECKLIST() {
dialog --title Compose-Module --checklist "$1" 20 70 10 "${list[@]}" 3>&1 1>&2 2>&3 3>&- || exit 1
clear
}
MSGBOX() {
dialog --title Compose-Module --msgbox "$1" 8 60
clear
}
YESNO() {
dialog --title Compose-Module --yesno "$1" 0 0 || exit 1
clear
}
else
echo -e ${red} "Es wurde weder kdialog noch zenity noch dialog gefunden." ${normal}
echo -e ${red} "Die graphische Konfiguration kann nicht verwendet werden." ${normal}
echo -e ${red} "Bitte benutzen Sie stattdessen ›make config && make install‹." ${normal}
exit 1
fi
while [ ! "$nohelp" ]; do
case ${1-" "} in
" ")
nohelp=ok
;;
*)
echo Aufruf: compose.sh
echo Mit »compose.sh« können die Compose-Module von Neo zusammengesetzt werden.
echo Folgende Module sind verfügbar:
for j in `ls $SRC/*.module`; do
i=$(basename $j .module)
if [ ! "$i" = "base" ] && [ ! "$i" = "enUS" ]; then
sed -n "
/^#configinfo[ \t]*/{
s///
b print
}
\$! b
s/.*/(ohne Beschreibung)/
: print
x
s/^/$i /
G
s/^\(.\{9\}\).*\n\(.\{1,69\}\).*/\1 \2/ # 80-Zeichen-Terminal-Grenze
p
q
" ${SRC}/${i}.module
fi
done
exit;;
esac
done
auswahl=XCompose_enUS_base
for i in src/*.module; do
name=$(basename $i .module) # name of modul
if [ ! "$name" = "base" -a ! "$name" = "enUS" ]; then
description=$(sed -n "
/^#configinfo[ \t]*/{
s///
b print
}
\$! b
s/.*/(ohne Beschreibung)/
: print
p
q
" $SRC/$name.module) # description of module
if grep -qs $name $CONFFILE; then
default=on # default value for this module
else
default=off
fi
ADD_TO_LIST "$name" "$description" "$default"
fi
done
if [ -f $HOME/.XCompose ]; then
YESNO "Es gibt bereits eine Compose-Datei (z.B. durch eine ältere Neo-Installation).\nSollten Sie eigene Definitionen in der Datei ~/.XCompose vorgenommen haben, dann brechen Sie jetzt ab und schreiben Ihre eigenen Definitionen in eine Datei (z.B. user.module) im Ordner src.\n\nAnderenfalls können Sie das Skript bedenkenlos fortsetzen.\nWollen Sie fortfahren?" || exit 1
fi
menu=`CHECKLIST "Die Neo-Tastaturbelegung hat etliche Erweiterungen für Compose (Mod3+Tab) erstellt,${NL}wodurch Zeichen wie ≙ έ ʒ ermöglicht werden.${NL}Wählen Sie die Compose-Module von Neo aus, die Sie verwenden möchten." "Für mehrere Module STRG bzw. CTRL gedrückt halten." | sed -e 's/\"//g' | sed -e 's/\ /_/g'`
if [ $menu ]; then
fertig="Die neue Compose-Datei wurde erfolgreich erstellt.\nSie wird für alle neu gestarteten Programme sowie nach dem nächsten Login wirksam."
echo "USER_XCOMPOSE = ${auswahl}_${menu}" > .config && make install && MSGBOX "$fertig"
fi
|