scripts/history: dont use histfile var (history for shells) - sob - simple output bar
(HTM) git clone git://git.codemadness.org/sob
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit 611985a88db127b299c44e334577c447457d4fd3
(DIR) parent 5155d5feca8a8c6b6045a8ec392d3fc300eac23f
(HTM) Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Fri, 24 Oct 2014 22:35:29 +0000
scripts/history: dont use histfile var (history for shells)
Diffstat:
M scripts/history | 21 ++++++++++++++-------
1 file changed, 14 insertions(+), 7 deletions(-)
---
(DIR) diff --git a/scripts/history b/scripts/history
@@ -1,15 +1,22 @@
#!/bin/sh
-file="$HISTFILE"
+file="$HISTORYFILE"
test -f "$file" || exit 1
-#if test x"$DISPLAY" = x""; then
-# line=$(tail -n 100 "$file" | slmenu -l 20)
-#else
-# line=$(tail -n 100 "$file" | dmenu -l 20)
-#fi
+xmenu() {
+ dmenu -l 20 -p 'History: '
+}
-line=$(tail -n 100 "$file" | dmenu -l 20)
+climenu() {
+ slmenu -l 20 -p 'History: '
+}
+
+if test x"$DISPLAY" = x""; then
+ clear >&2
+ line=$(tail -n 100 "$file" | climenu)
+else
+ line=$(tail -n 100 "$file" | xmenu)
+fi
if test x"$line" != x""; then
printf '%s' "$line"