107e7e768b
git-svn-id: https://svn.neo-layout.org@1232 b9310e46-f624-0410-8ea1-cfbb3a30dc96
49 lines
1.7 KiB
Bash
Executable file
49 lines
1.7 KiB
Bash
Executable file
#!/bin/sh
|
|
|
|
# Was hier passiert: Zusammenfügen der alten Compose und der Neo-Ergänzungen
|
|
# in die Datei ~/.XCompose, die normalerweise beim Starten der Desktopumgebung
|
|
# geladen wird.
|
|
# Der Pfad zu den Dateien wird in den Umgebungsvariablen $NEO_COMPOSE und
|
|
# $NEO_ORIG_COMPOSE festgelegt, wobei bei letzterer der Default-Pfad ausreichend
|
|
# sein sollte.
|
|
# In der Variablen $NEO_OWN_COMPOSE kann eine Datei definiert werden, in der
|
|
# man noch eigene Ergänzungen der Compose hinzufügen kann, falls einem die
|
|
# Erweiterungen durch Neo-Compose nicht ausreichen.
|
|
|
|
if [ -f "${NEO_CONFIG}" ]; then
|
|
. "${NEO_CONFIG}" || die "Failed to source ${NEO_CONFIG}"
|
|
elif [ -f "${HOME}"/.neorc ]; then
|
|
. "${HOME}"/.neorc || die "Failed to source ${HOME}/.neorc"
|
|
elif [ -f /etc/neo.conf ]; then
|
|
. /etc/neo.conf || die "Failed to source /etc/neo.conf"
|
|
else
|
|
echo "No configuration file found. Using default values, this might fail!"
|
|
fi
|
|
|
|
# Default values
|
|
NEO_COMPOSE=${NEO_COMPOSE:-$HOME/neo/Compose.neo}
|
|
NEO_ORIG_COMPOSE=${NEO_ORIG_COMPOSE:-/usr/share/X11/locale/en_US.UTF-8/Compose}
|
|
|
|
die() {
|
|
echo "$@" >&2
|
|
exit 1
|
|
}
|
|
|
|
|
|
if [ ! -f "${NEO_COMPOSE}" ]; then
|
|
die "Failed to read ${NEO_COMPOSE}. Check your configuration!"
|
|
elif [ ! -f "${NEO_ORIG_COMPOSE}" ]; then
|
|
die "Failed to read ${NEO_ORIG_COMPOSE}. Check your configuration!"
|
|
elif [ ! "a${NEO_OWN_COMPOSE}" = "a" ]; then
|
|
if [ ! -f "${NEO_OWN_COMPOSE}" ]; then
|
|
die "Failed to read ${NEO_OWN_COMPOSE}. Check your configuration!"
|
|
fi
|
|
fi
|
|
|
|
if [ ! "a${NEO_OWN_COMPOSE}" = "a" ]; then
|
|
cat "${NEO_ORIG_COMPOSE}" "${NEO_COMPOSE}" "${NEO_OWN_COMPOSE}" > ~/.XCompose
|
|
else
|
|
cat "${NEO_ORIG_COMPOSE}" "${NEO_COMPOSE}" > ~/.XCompose
|
|
fi
|
|
|
|
|