various improvements
[distro-setup] / brc
diff --git a/brc b/brc
index 9e9752c18d33c9da89120b008acbcd9892d82a1d..e1aa677c23ab4c4fe32a64ae7dd30c659d864e7d 100644 (file)
--- a/brc
+++ b/brc
@@ -61,7 +61,7 @@ shopt -s cmdhist
 shopt -s globstar
 
 
-# inside emcas fixes
+# inside emacs fixes
 if [[ $RLC_INSIDE_EMACS ]]; then
   # EMACS is used by bash on startup, but we dont need it anymore.
   # plus I hit a bug in a makefile which inherited it
@@ -96,6 +96,19 @@ if [[ $RLC_INSIDE_EMACS ]]; then
 
 fi
 
+# emacs has a different default search path than the info command. This
+# adds the info defaults to emacs, but not the reverse, because I dun
+# care much about the cli. The search path is only on the cli if you run
+# "info xxx", or in emacs if you run '(info xxx)', so not that
+# important, but might as well fix it.
+
+# info info says this path is what was compiled, and its not documented
+# anywhere. Through source grepping, i found it in filesys.h of the info
+# source in trisquel flidas.
+#
+# Traling : means for emacs to add its own stuff on to the end.
+
+export INFOPATH=$PATH:/usr/local/info:/usr/info:/usr/local/lib/info:/usr/lib/info:/usr/local/gnu/info:/usr/local/gnu/lib/info:/usr/gnu/info:/usr/gnu/lib/info:/opt/gnu/info:/usr/share/info:/usr/share/lib/info:/usr/local/share/info:/usr/local/share/lib/info:/usr/gnu/lib/emacs/info:/usr/local/gnu/lib/emacs/info:/usr/local/lib/emacs/info:/usr/local/emacs/info:.:
 
 if [[ $- == *i* ]]; then
   # for readline-complete.el
@@ -157,7 +170,7 @@ HISTCONTROL=ignoredups
 # works in addition to HISTCONTROL to do more flexible things
 # it could also do the same things as HISTCONTROL and thus replace it,
 # but meh. dunno why, but just " *" does glob expansion, so use [ ] to avoid it.
-HISTIGNORE='pass *:[ ]*:lom*:gram*'
+HISTIGNORE='pass *:[ ]*:otp *:oathtool *'
 
 export BC_LINE_LENGTH=0
 
@@ -371,19 +384,19 @@ b() {
 bbk() {
   c /
   local active=true
-  if systemctl is-active btrbk.service; then
-    echo "cron btrbk is already running"
-    return 1
-  fi
   systemctl is-active btrbk.timer || active=false
   if $active; then
     ser disable btrbk.timer
   fi
+  if systemctl is-active btrbk.service; then
+    $active && ser enable btrbk.timer
+    echo "cron btrbk is already running"
+    return 1
+  fi
   # run latest
   install-my-scripts
-  if ! btrbk-run "$@" && $active; then
-    ser enable btrbk.timer
-  fi
+  btrbk-run "$@"
+  $active && ser enable btrbk.timer
 }
 
 bfg() { java -jar /a/opt/bfg-1.12.14.jar "$@"; }
@@ -1713,6 +1726,9 @@ srun() {
   ssh $1 /tmp/${2##*/} "${@:2}"
 }
 
+ssh() {
+  BASH_LOGIN_SHELL=true command ssh "$@"
+}
 sss() { # ssh solo
   ssh -oControlMaster=no -oControlPath=/ "$@"
 }
@@ -1821,11 +1837,11 @@ _dosieve() {
 
 # always run this first, edit the test files, then run the following
 testsieve() {
-  _dosieve ~/sieve/maintest.sieve INBOX delete
+  _dosieve ~/sieve/maintest.sieve ${1:-INBOX} delete
 }
 runsieve() {
-  c ~/sieve; cp personal{test,}.sieve; cp lists{test,}.sieve
-  _dosieve ~/sieve/main.sieve -eW INBOX delete
+  c ~/sieve; cp personal{test,}.sieve; cp lists{test,}.sieve; cp personalend{test,}.sieve
+  _dosieve ~/sieve/main.sieve -eW ${1:-INBOX} delete
 }
 
 # mail related
@@ -2154,7 +2170,7 @@ if [[ $- == *i* ]]; then
 
 
     case $return in
-      0) ps_color="$(get_term_color blue)"
+      0) ps_color="$(get_term_color purple)"
          ps_char='\$'
          ;;
       1) ps_color="$(get_term_color green)"
@@ -2176,6 +2192,10 @@ if [[ $- == *i* ]]; then
     if [[ -e /nocow/btrfs-stale ]] && ((`command ls -AUq /nocow/btrfs-stale|wc -l`)); then
       ps_char="! $ps_char"
     fi
+    if [[ -e /nocow/mailtest-failure ]]; then
+      ps_char="@#$@#$ $ps_char"
+    fi
+    source /a/bin/bash_unpublished/source-state
     if [[ ! $SSH_CLIENT && $MAIL_HOST != $HOSTNAME ]]; then
       ps_char="@ $ps_char"
     fi