]> git.mdlowis.com Git - projs/tide.git/commitdiff
Added tcmd bash script to setup tide command environment for running bash
authorMichael D. Lowis <mike@mdlowis.com>
Thu, 20 Jul 2017 01:31:02 +0000 (21:31 -0400)
committerMichael D. Lowis <mike@mdlowis.com>
Thu, 20 Jul 2017 01:31:02 +0000 (21:31 -0400)
tcmd [new file with mode: 0755]

diff --git a/tcmd b/tcmd
new file mode 100755 (executable)
index 0000000..38af1c9
--- /dev/null
+++ b/tcmd
@@ -0,0 +1,26 @@
+#!/bin/bash
+
+# setup editor env
+export PS1=":; "
+export PATH="$HOME/.config/tide/tools:$PATH"
+export EDITRCFILE="$HOME/.config/edit/editrc"
+export BASH_ENV="$EDITRCFILE"
+
+function cd(){
+    command cd "$@" && echo -en "\033P$PWD\0"
+}
+export -f cd
+
+edit(){
+    [[ -f "$EDITRCFILE" ]] && . "$EDITRCFILE"
+
+    # Now figure out the correct editor to execute
+    if [[ -z "$DISPLAY" ]]; then
+        "$EDITOR" "$@"
+    else
+        bkg tide "$@"
+    fi
+}
+export -f edit
+
+exec tide --