summaryrefslogtreecommitdiffstats
path: root/bashrun.sh
diff options
context:
space:
mode:
authorFlorian Pritz <f-p@gmx.at>2009-02-24 20:23:55 +0100
committerFlorian Pritz <f-p@gmx.at>2009-02-24 20:23:55 +0100
commit1baaadfb504f16bea2ae9f9829c99892a8784192 (patch)
tree76b83058b83425d9bbc805984dd1bf5a2b849f6f /bashrun.sh
parentd5ee1a6157065363843e6367e932f7b11b17706c (diff)
downloadbin-1baaadfb504f16bea2ae9f9829c99892a8784192.tar.gz
bin-1baaadfb504f16bea2ae9f9829c99892a8784192.tar.xz
removed bashrun duplicate and symlinked
Diffstat (limited to 'bashrun.sh')
l---------[-rwxr-xr-x]bashrun.sh107
1 files changed, 1 insertions, 106 deletions
diff --git a/bashrun.sh b/bashrun.sh
index b571a52..b37f7f0 100755..120000
--- a/bashrun.sh
+++ b/bashrun.sh
@@ -1,106 +1 @@
-#!/bin/bash
-#
-# usage: bashrun [geometry] (default: 40x1)
-#
-# NOTE: commands entered will have an '&' appended before being run,
-# so don't append it yourself, it will fail silently.
-#
-# rcfile: $HOME/.bashrunrc
-#
-# ---------------------------------------------------------------------
-
-GEOM=${1:-40x1}
-
-# create .bashrunrc unless present
-BASHRUNRC=$HOME/.bashrunrc
-if [ ! -f $BASHRUNRC ]; then
-(
-cat <<'EOF'
-# which X terminal to use:
-# (xterm|rxvt|urxvt|mrxvt|aterm|mlterm)
-XTERM=urxvtc
-
-# history file and options:
-HISTFILE=$HOME/.bashrun_history
-HISTCONTROL=ignoredups:erasedups
-
-# bind <TAB> to menu-complete. Makes <TAB> cycle through completions on
-# the current line instead of paging all possible completions
-bind '"\t": menu-complete'
-
-# bind <C-g> to send ^D
-# (<C-g> is the default quit-chain-key in emacs, ratpoison, etc)
-bind '"\C-g"':"\"\x04\""
-
-# set a simple prompt
-PS1=">"
-
-# ***DO NOT EDIT BEYOND THIS LINE***
-#
-# bind ENTER to add ' &' to command
-bind '"\x0d"':"\" &\n\""
-EOF
-) > $BASHRUNRC
-fi
-
-. $BASHRUNRC
-
-error() {
- if [ `which zenity` ]; then
- zenity --title bashrun --error --text "$@"
- elif [ `which kdialog` ]; then
- kdialog --title bashrun --error "$@"
- elif [ `which xmessage` ]; then
- xmessage "$@"
- fi
- echo -en "\007"
- echo $@
-}
-
-# run bash terminal
-if [ "$XTERM" = "xterm" ]; then
- $XTERM -name 'bashrun' \
- -title 'bashrun' \
- -geometry $GEOM \
- -e "/bin/bash --rcfile $BASHRUNRC -i -t"
-
-elif [[ "$XTERM" = "aterm" || "$XTERM" = "mlterm" ]]; then
- $XTERM -name 'bashrun' \
- -title 'bashrun' \
- -geometry $GEOM +sb \
- -e /bin/bash --rcfile $BASHRUNRC -i -t
-
-elif [[ "$XTERM" = "urxvt" || "$XTERM" = "rxvt" ]] || [ "$XTERM" = "urxvtc" ]; then
- $XTERM -name 'bashrun' \
- -title 'bashrun' \
- -geometry $GEOM \
- -e sh -c "/bin/bash --rcfile $HOME/.bashrunrc -i -t"
-
-
-elif [ "$XTERM" = "mrxvt" ]; then
- $XTERM -name 'bashrun' \
- -title 'bashrun' \
- -geometry $GEOM +sb -ht \
- -e sh -c "/bin/bash --rcfile $BASHRUNRC -i -t"
-else
- error "$XTERM is not supported. Please check $BASHRUNRC"
- exit 1
-fi
-
-# history cleanup...
-# remove trailing whitespace and '&' from the last history line
-tac $HISTFILE | sed "1s/\&//;s/ *$//" | tac > $HISTFILE
-
-# HISTCONTROL won't work on its own because bash applies the
-# 'ignoredups' and 'erasedups' rules to 'command &'.
-
-# apply 'ignoredups' if set
-if [[ "$HISTCONTROL" =~ "ignoredups" || "$HISTCONTROL" =~ "ignoreboth" ]]; then
- uniq $HISTFILE $HISTFILE.tmp
- mv $HISTFILE.tmp $HISTFILE
-fi
-
-# apply 'erasedups' if set
-if [[ "$HISTCONTROL" =~ "erasedups" ]]; then
- tac $HISTFILE | gawk '!x[$0]++' - | tac > $HISTFILE
-fi
+bashrun \ No newline at end of file