X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=brc;h=b8eb1201c21155043f505feb03a9350ebc37dcbf;hb=8052829d2babeda2fc639666cf6b1ee649f283a6;hp=00200fe01edb09c2899c7e0420f1f5ae2a2c7fd6;hpb=7c40848349654f32903ce11d14337b01e740ff89;p=distro-setup diff --git a/brc b/brc index 00200fe..b8eb120 100644 --- 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 "$@"; } @@ -735,7 +748,7 @@ fdup() { local p fdroidcl update if fdroidcl search -u | grep ^org.fdroid.fdroid; then - fdroidcl upgrade org.fdroid.fdroid + fdroidcl install org.fdroid.fdroid sleep 5 fdroidcl update fi @@ -754,7 +767,7 @@ fdup() { done for p in ${!installed[@]}; do if ! ${updated[$p]:-true}; then - fdroidcl upgrade $p + fdroidcl install $p sleep 5 fi done @@ -991,6 +1004,9 @@ grr() { # grep recursive grep --exclude-dir='*.emacs.d' --exclude-dir='*.git' -RiIP --color=auto "$@" fi } +rg() { + command rg -i -M 200 "$@" +} hstatus() { # do git status on published repos @@ -1276,6 +1292,20 @@ net-dev-info() { } +nk() { + ser stop NetworkManager + ser stop dnsmasq + s resolvconf -d NetworkManager + ser start dnsmasq + s ifup br0 +} +ngo() { + s ifdown br0 + ser start NetworkManager + sleep 4 + s nmtui-connect +} + nopanic() { sudo tee -a /var/log/exim4/paniclog-archive /tmp/testsieve.log 2> >(tail) && sed -rn '/^Performed actions:/{n;n;p}' /tmp/testsieve.log | sort -u +_dosieve() { + sieve-filter "$@" 2> >(head; tail) >/tmp/testsieve.log && sed -rn '/^Performed actions:/,/^[^ ]/{/^ /p}' /tmp/testsieve.log | sort | uniq -c } - -# mail related -# plain sieve +# always run this first, edit the test files, then run the following testsieve() { - sieve-filter ~/sieve/main.sieve "$@" + _dosieve ~/sieve/maintest.sieve ${1:-INBOX} delete +} +runsieve() { + c ~/sieve; cp personal{test,}.sieve; cp lists{test,}.sieve + _dosieve ~/sieve/main.sieve -eW ${1:-INBOX} delete } # mail related @@ -2003,23 +2032,6 @@ wian() { wtr() { curl wttr.in/boston; } -xl() { - if pgrep gnome-screensav &>/dev/null; then - # this command actually starts gnome-screensaver if it isn\'t running. - # lololol, what crap - gnome-screensaver-command --exit &>/dev/null - fi - mate-screensaver-command --exit &>/dev/null - if ! pidof xscreensaver; then - pushd / - xscreensaver & - popd - # 1 was not long enough - sleep 3 - fi - xscreensaver-command -activate -} - xevkb() { xev -event keyboard; } # * misc stuff @@ -2158,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)" @@ -2180,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 @@ -2298,8 +2314,12 @@ path_add /usr/local/go/bin # ARDUINO_PATH=/a/opt/Arduino/build/linux/work export ARDUINO_PATH=/a/opt/arduino-1.8.9 +# They want to be added to the start, but i think +# that should be avoided unless we really need it. path_add --end ~/.npm-global +path_add --end $HOME/.cargo/bin + # taken from default changes to bashrc and bash_profile path_add --end $HOME/.rvm/bin [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*