summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorknittl <knittl@b9310e46-f624-0410-8ea1-cfbb3a30dc96>2008-10-03 11:01:39 +0000
committerknittl <knittl@b9310e46-f624-0410-8ea1-cfbb3a30dc96>2008-10-03 11:01:39 +0000
commitbc9410c557506fa9f497c4e7d5c0b3a87e5002ae (patch)
tree955be62074f19039f7912b86764a8d483158d23e
parentb47d95c18037e1f930332748e1a37422634f54ac (diff)
neo.conf ins (richtige) verzeichnis etc verschoben
patch von bernd für num und neo eingespielt git-svn-id: https://svn.neo-layout.org@931 b9310e46-f624-0410-8ea1-cfbb3a30dc96
-rwxr-xr-xlinux/bin/neo17
-rwxr-xr-xlinux/bin/num17
-rw-r--r--linux/etc/neo.conf (renamed from linux/bin/neo.conf)0
3 files changed, 26 insertions, 8 deletions
diff --git a/linux/bin/neo b/linux/bin/neo
index 8923706..2753971 100755
--- a/linux/bin/neo
+++ b/linux/bin/neo
@@ -1,14 +1,23 @@
#!/bin/sh
-# Verzeichnis muss eventuell an den Ort der neo20.txt angepasst werden:
-NEO_TXT=$HOME/neo/A-REFERENZ-A/neo20.txt
+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
+
+NEO_REFERENCE=${NEO_REFERENCE:-/usr/share/neo-layout/neo20-reference.txt}
if [ 0 = $# ]; then
- grep -m 1 -B 15 "┴──────┘" $NEO_TXT
+ grep -m 1 -B 15 "┴──────┘" "${NEO_REFERENCE}"
else
for NUM in $@; do
if [ $(($NUM)) -ge 1 -a $(($NUM)) -le 6 ]; then
- grep -B 11 -m "$NUM" "└───┴──┴──┴───────────┴──┴──┴──┴───┘" $NEO_TXT | tail -n 12
+ grep -B 11 -m "$NUM" "└───┴──┴──┴───────────┴──┴──┴──┴───┘" "${NEO_REFERENCE}" | tail -n 12
else
echo "Benutzung: `basename $0` [1-6]"
echo " Wenn der Aufruf ohne Zahl erfolgt, werden alle Ebenen ausgegeben."
diff --git a/linux/bin/num b/linux/bin/num
index 371feb5..16ed8e9 100755
--- a/linux/bin/num
+++ b/linux/bin/num
@@ -1,14 +1,23 @@
#!/bin/sh
-# Verzeichnis muss eventuell an den Ort der neo20.txt angepasst werden:
-NEO_TXT=$HOME/neo/A-REFERENZ-A/neo20.txt
+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}/neo.conf"
+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
+
+NEO_REFERENCE=${NEO_REFERENCE:-/usr/share/neo-layout/neo20-reference.txt}
if [ 0 = $# ]; then
- grep -m 1 -B 15 "┴───────┘" $NEO_TXT
+ grep -m 1 -B 15 "┴───────┘" "${NEO_REFERENCE}"
else
for NUM in $@; do
if [ $(($NUM)) -ge 1 -a $(($NUM)) -le 6 ]; then
- grep -B 11 -m "$NUM" "└───────┴───┴───┘" $NEO_TXT | tail -n 12
+ grep -B 11 -m "$NUM" "└───────┴───┴───┘" "${NEO_REFERENCE}" | tail -n 12
else
echo "Benutzung: `basename $0` [1-6]"
echo " Wenn der Aufruf ohne Zahl erfolgt, werden alle Ebenen ausgegeben."
diff --git a/linux/bin/neo.conf b/linux/etc/neo.conf
index 23959f6..23959f6 100644
--- a/linux/bin/neo.conf
+++ b/linux/etc/neo.conf