summaryrefslogtreecommitdiff
path: root/linux/bin/num
blob: 16ed8e9f5438a1e18b3d84632ff4e0ec457e9a5a (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
#!/bin/sh

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_REFERENCE}"
else 
	for NUM in $@; do
		if [ $(($NUM)) -ge 1  -a $(($NUM)) -le 6 ]; then
			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."
			echo "           Ansonsten werden nur die Ebenen ausgegeben, die angegeben sind."
			exit 1
		fi
	done
fi