summaryrefslogtreecommitdiff
path: root/Compose/compose_gui.sh
blob: 68a038aa4855a8bc2df0150af8816db67a700117 (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
#!/bin/sh

# 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
typeset -i anzahl


auswahl=XCompose_base

for i in src/*.module
do
	name=$(basename $i .module)					# name of modul
	if [ ! "$name" = "base" ]
	then
		anzahl=anzahl+1
		m[$anzahl]=$name
		b[$anzahl]=$(sed -n "
/^#configinfo[ \t]*/{
    s///
    s/^\(.\{10\}\) */\1/
    p;q
}

\${
    s/.*/ohne Beschreibung/
    s/^\(.\{10\}\) */\1/
    p
}" $SRC/$name.module)							# description of module
		if grep -q $name $CONFFILE
		then
			a[$anzahl]=on					# default value for this module
		else
			a[$anzahl]=off
		fi
	fi
	klist=$klist\ ${m[$anzahl]}\ ${b[$anzahl]}\ ${a[$anzahl]}
	glist=$glist\ ${m[$anzahl]}\ ${b[$anzahl]}
done


while [ ! "$module" ]
do
 case ${1-" "} in
  " ")
      module=ausgewählt
      ;;
  *)
      echo Aufruf: compose.sh
      echo Mit »compose.sh« können die Compose-Module von Neo zusammengesetzt werden.
      echo Folgende Module sind verfügbar:
      for i in $(seq 1 $anzahl)
      do
       echo -e "  ${m[$i]}\t\t${b[$i]}"
      done
      exit;;
 esac
done

text1="Die Neo-Tastaturbelegung hat etliche Erweiterungen für Compose (Mod3+Tab) erstellt,"
text2="wodurch Zeichen wie ∮ έ ʒ ermöglicht werden."
text3="Wählen Sie die Compose-Module von Neo aus, die Sie verwenden möchten."
text4="Für mehrere Module STRG bzw. CTRL gedrückt halten."
if [ $KDE_FULL_SESSION = true ]
then
	menu=`kdialog --title Compose-Module --checklist "$text1<br>$text2<br><br>$text3" $klist`
else
	menu=`zenity --title Compose-Module --width=480 --height=250 --list --multiple --column Modulname  --column Modulebeschreibung --separator=_ --text "$text\n$text2\n\n$text3\n$test4" $glist`
fi
menu=$(echo $menu | 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 = XCompose_$auswahl_$menu" > .config && make install && make clean && 
	$(if [ $KDE_FULL_SESSIO = true ]
	then
		kdialog --title Compose-Module --msgbox "$fertig"
	else
		zenity --title Compose-Module --width=480 --height=250 --info --text "$fertig"
	fi)
fi