X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=brc2;h=d46028dfddb744c985d3b90658ea963047787180;hb=29e7420d5906c1e2068bb7546f5d4148e34e2423;hp=c857670bc64f937d381c42e6123a79ba8f480bcf;hpb=f27b67a1dfa58b5f101bba607b2f91a73e65299e;p=distro-setup diff --git a/brc2 b/brc2 index c857670..d46028d 100644 --- a/brc2 +++ b/brc2 @@ -925,7 +925,7 @@ beetag() { else pl_state_file=sorted fi - pl_state_dir=/i/info/pl-state + pl_state_dir=/b/data/pl-state if [[ $playlist ]]; then pl_state_dir=$pl_state_dir/$playlist else @@ -2012,6 +2012,10 @@ apache-apply-repo() { apache-apply() { for file; do + if [[ ! -e $file ]]; then + echo '#!/bin/bash' >$file + chmod +x $file + fi if head -n1 "$file"| grep -E '^#!/' &>/dev/null; then { head -n1 "$file" @@ -2878,8 +2882,8 @@ EOF tmpf=$(mktemp) { printf "%s" "Host * " - sed -n '/^Host /h;/^IdentityFile .*\/home/{g;s/^Host//;s/ / !/gp}' /p/c/subdir_files/.ssh/config-static | tr '\n' ' ' - echo + sed -n '/^Host /h;/^IdentityFile .*\/home/{g;s/^Host//;s/ / !/gp}' /p/c/subdir_files/.ssh/config-static | tr '\n' ' ' \ + | sed -r 's/ *$/\n/' echo "IdentityFile ~/.ssh/work" } >$tmpf cedit -e work-identity /p/c/subdir_files/.ssh/config-static <$tmpf @@ -4850,19 +4854,55 @@ klease() { } # ffs and switch the bash history on this terminal. -ffs() { - local last - last="${*: -1}" - if [[ $last && $last != -* && $last != sysops ]]; then - his - fi - command ffs "$@" -} +# disabled because I don't really need this and +# the history switching is annoying for debugging. +# +# ffs() { +# local last +# last="${*: -1}" +# if [[ $last && $last != -* && $last != sysops ]]; then +# his +# fi +# command ffs "$@" +# } i3gen() { /b/ds/i3-sway/gen } + +# insensitive find plus edit +ife() { + local tmps found_count i char file + local -a found_files + local -A button_file + tmps=$(ifn "$@") + mapfile -t found_files <<<"$tmps" + found_count=${#found_files[@]} + if (( ${#found_files[@]} == 1 )); then + m g ${found_files[0]} + else + i=0 + for button in {a..z}; do + button_file[$button]="${found_files[$i]}" + echo $button: ${found_files[$i]} + i=$(( i + 1 )) + if (( i >= found_count )); then + break + fi + done + read -rsN1 -t 5 char ||: + file="${button_file[$char]}" + + if [[ $file ]]; then + g "$file" + else + echo "no selection" + fi + fi +} + + export BASEFILE_DIR=/a/bin/fai-basefiles #export ANDROID_HOME=/a/opt/android-home