iankelling.org
/
git
/
distro-setup
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixes, improve host-info-update
[distro-setup]
/
brc
diff --git
a/brc
b/brc
index ad99e0ff360f5a7db129e0941a548c6ddcb54c75..2fbce5534d3f8b116fba0573d6c37742d7ca1e40 100644
(file)
--- a/
brc
+++ b/
brc
@@
-315,6
+315,7
@@
export PROFILE_TASKS_TASK_OUTPUT_LIMIT=100
export LESS=RXij12
export SYSTEMD_LESS=$LESS
export LESS=RXij12
export SYSTEMD_LESS=$LESS
+
export NNN_COLORS=2136
export SL_FILES_DIR=/b/ds/sl/.iank
export NNN_COLORS=2136
export SL_FILES_DIR=/b/ds/sl/.iank
@@
-878,14
+879,14
@@
_khfix-common() {
fi
ll ~/.ssh/known_hosts
}
fi
ll ~/.ssh/known_hosts
}
-khfix-r() { # known hosts fix
+ root
+khfix-r() { # known hosts fix
without syncing to root user
_khfix-common "$@" || return 1
ssh $1 :
_khfix-common "$@" || return 1
ssh $1 :
- rootsshsync
}
khfix() {
_khfix-common "$@" || return 1
ssh $1 :
}
khfix() {
_khfix-common "$@" || return 1
ssh $1 :
+ rootsshsync
}
# copy path into clipboard
}
# copy path into clipboard
@@
-2138,7
+2139,7
@@
pkx() { # package extract
c "$(mktemp -d)"
pkg=$1
# shellcheck disable=SC2012
c "$(mktemp -d)"
pkg=$1
# shellcheck disable=SC2012
- cached=$(ls -t /var/cache/apt/archives/${pkg}_* | tail -n1 2>/dev/null) ||:
+ cached=$(ls -t /var/cache/apt/archives/${pkg}_*
2>/dev/null
| tail -n1 2>/dev/null) ||:
if [[ $cached ]]; then
m cp $cached .
else
if [[ $cached ]]; then
m cp $cached .
else
@@
-2899,6
+2900,7
@@
nonet() {
}
m() { printf "%s\n" "$*"; "$@"; }
}
m() { printf "%s\n" "$*"; "$@"; }
+m2() { printf "%s\n" "$*" >&2; "$@"; }
# update file. note: duplicated in mail-setup.
# updates $ur u result to true or false
# update file. note: duplicated in mail-setup.
# updates $ur u result to true or false
@@
-3181,9
+3183,13
@@
if $use_color && type -p tput &>/dev/null; then
# https://github.com/trapd00r/LS_COLORS
# I would like if there was something similar for light.
# https://github.com/trapd00r/LS_COLORS
# I would like if there was something similar for light.
+ # https://www.bigsoft.co.uk/blog/2008/04/11/configuring-ls_colors
+ # change the hard to read turqouise.
+ # defaults dircolors --print-database.
+
# the default bold green is too light.
# this explains the codes: https://gist.github.com/thomd/7667642
# the default bold green is too light.
# this explains the codes: https://gist.github.com/thomd/7667642
- export LS_COLORS=
ex=1
+ export LS_COLORS=
"ex=1:ln=00;31"
term_bold="$(tput bold)"
term_red="$(tput setaf 1)"
term_bold="$(tput bold)"
term_red="$(tput setaf 1)"
@@
-3237,6
+3243,16
@@
if [[ $- == *i* ]]; then
# so I've thrown a bunch of things at the wall to speed it up.
prompt-command() {
local return=$? # this MUST COME FIRST
# so I've thrown a bunch of things at the wall to speed it up.
prompt-command() {
local return=$? # this MUST COME FIRST
+
+ # all usable colors:
+ # black
+ # green nonzero exit (pri 1)
+ # purple default
+ # purple bold
+ # red pwd different owner & group & not writable (pri 2)
+ # red bold pwd different owner & group & writable (pri 2)
+ # yellow
+
local ps_char ps_color
unset IFS
local ps_char ps_color
unset IFS
@@
-3244,22
+3260,21
@@
if [[ $- == *i* ]]; then
history -a # save history
fi
history -a # save history
fi
- case $return in
- 0) ps_color="$term_purple"
- ps_char='\$'
- ;;
- *) ps_color="$term_green"
- ps_char="$return \\$"
- ;;
- esac
+ ps_color="$term_purple"
+ ps_char='\$'
if [[ ! -O . ]]; then # not owner
if [[ -w . ]]; then # writable
ps_color="$term_bold$term_red"
else
if [[ ! -O . ]]; then # not owner
if [[ -w . ]]; then # writable
ps_color="$term_bold$term_red"
else
- ps_color="$term_
bold$term_green
"
+ ps_color="$term_
red
"
fi
fi
fi
fi
+ if [[ $return != 0 ]]; then
+ ps_color="$term_green"
+ ps_char="$return \\$"
+ fi
+
# faster than sourceing the file im guessing
if [[ -e /dev/shm/iank-status && ! -e /tmp/quiet-status ]]; then
eval "$(< /dev/shm/iank-status)"
# faster than sourceing the file im guessing
if [[ -e /dev/shm/iank-status && ! -e /tmp/quiet-status ]]; then
eval "$(< /dev/shm/iank-status)"