summaryrefslogtreecommitdiffstats
path: root/linux/bin
diff options
context:
space:
mode:
Diffstat (limited to 'linux/bin')
-rwxr-xr-xlinux/bin/neo17
-rw-r--r--linux/bin/neo.conf49
-rwxr-xr-xlinux/bin/num17
3 files changed, 26 insertions, 57 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/neo.conf b/linux/bin/neo.conf
deleted file mode 100644
index 23959f6..0000000
--- a/linux/bin/neo.conf
+++ /dev/null
@@ -1,49 +0,0 @@
-# This files contains the configuration for the Neo scripts
-
-# Select the neo Variant to be used when using an X Server
-# Values are "xkbmap" and "xmodmap", default is xkbmap, this variable should
-# always be set
-NEO_X_VARIANTE="xkbmap"
-
-# When using xkbmap, you may specify which xkbmap should be used, the default
-# is "de" (This is useful if you installed the symbols file under a different
-# name):
-#NEO_XKBMAP=de
-
-# You can also specify the xkbmap variant to be used, the default is "neo":
-#NEO_XKBVARIANT=neo
-
-# When using xmodmap, you may specify the full path to the xmodmap to be used.
-# Default:
-#NEO_XMODMAP="/usr/share/neo-layout/xmodmap/neo_de.xmodmap"
-# Other examples might be:
-#NEO_XMODMAP="path/to/xmodmap/neo_de_x-prog.xmodmap"
-#NEO_XMODMAP="path/to/xmodmap/neo_de_evdev.xmodmap"
-#NEO_XMODMAP="path/to/xmodmap/neo_de_alternative.xmodmap"
-
-# Standard keyboard layout to switch back to when executing "uiae":
-#STD_XKBMAP=de
-
-# Standard layout variant to switch back to when executing "uiae":
-#STD_XKBVARIANT=nodeadkeys
-
-# Numlock status when switching to standard keyboard layout using "uiae",
-# values are "on" and "off":
-#NUM_LOCK_STATUS=on
-
-# For Neo without an X System set the path to the console keymap
-#NEO_CONSOLE_KEYMAP="/usr/share/keymaps/i386/neo/neo.map"
-
-# Set the standard console keymap to switch back to
-#STD_CONSOLE_KEYMAP="/usr/share/keymaps/i386/qwertz/de-latin1-nodeadkeys.map.gz"
-
-# If you installed one of these programs in a non-standard path you may,
-# uncomment the variable and change the path to the executable:
-#PATH_XMODMAP=/usr/bin/xmodmap
-#PATH_SETXKBMAP=/usr/bin/setxkbmap
-#PATH_LOADKEYS=/usr/bin/loadkeys
-#PATH_SUDO=/usr/bin/sudo
-#PATH_SETLEDS=/usr/bin/setleds
-#PATH_NUMLOCKX=/usr/bin/numlockx
-#PATH_XSET=/usr/bin/xset
-
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."