history - sob - simple output bar
HTML git clone git://git.codemadness.org/sob
DIR Log
DIR Files
DIR Refs
DIR README
DIR LICENSE
---
history (337B)
---
1 #!/bin/sh
2
3 file="$HISTORYFILE"
4 test -f "$file" || exit 1
5
6 xmenu() {
7 dmenu -l 20 -p 'History: '
8 }
9
10 climenu() {
11 slmenu -l 20 -p 'History: '
12 }
13
14 if test x"$DISPLAY" = x""; then
15 clear >&2
16 line=$(tail -n 100 "$file" | tac | climenu)
17 else
18 line=$(tail -n 100 "$file" | tac | xmenu)
19 fi
20
21 if test x"$line" != x""; then
22 printf '%s' "$line"
23 fi