Remove more unused scripts

This commit is contained in:
斟酌 鵬兄 2022-08-15 20:37:03 +08:00
parent 824fcee942
commit 4f8e48cea3
21 changed files with 22 additions and 179 deletions

View File

@ -1,16 +0,0 @@
#!/bin/bash
function blog () {
if [[ -z `command -v cj` ]]; then
echo "Cannot find cj"
return 1
fi
if [[ -z "$1" ]]; then
__func_head "CONTENT(CJ)"
echo
else
FILE=$(date +%Y%m%d)
echo "$1 " | xargs -d' ' cj >> ~/blog/$FILE
fi
}

View File

@ -1,21 +0,0 @@
#!/bin/bash
function catlog () {
if [[ -z "$1" ]]; then
__func_head "FILE"
echo " Will exclude:"
cat ~/.settings/checklog_exclude | awk '{ print " "$1 }'
echo
else
GZIP=
file "$1" | grep gzip > /dev/null && GZIP=true
EXCLUDE=$(awk '{ printf("(%s)|", $1) }' ~/.settings/checklog_exclude | sed 's/|$//')
if [ $GZIP ]; then
gunzip -c $1 | egrep -v $EXCLUDE
else
egrep -v $EXCLUDE $1
fi
fi
}

View File

@ -1,32 +0,0 @@
! Common
#define S_yellow #b58900
#define S_orange #cb4b16
#define S_red #dc322f
#define S_magenta #d33682
#define S_violet #6c71c4
#define S_blue #268bd2
#define S_cyan #2aa198
#define S_green #859900
! Dark
#define S_base03 #222222
#define S_base02 #073642
#define S_base01 #586e75
#define S_base00 #657b83
#define S_base0 #839496
#define S_base1 #93a1a1
#define S_base2 #eee8d5
#define S_base3 #fdf6e3
! Light
! #define S_base03 #fdf6e3
! #define S_base02 #eee8d5
! #define S_base01 #93a1a1
! #define S_base00 #839496
! #define S_base0 #657b83
! #define S_base1 #586e75
! #define S_base2 #073642
! #define S_base3 #002b36

View File

@ -1,3 +0,0 @@
XTerm*font: 9x15
XTerm*saveLines: 1000
XTerm*geometry: 145x35

View File

@ -1,80 +0,0 @@
#!/bin/bash
CONF_FILE=$1
TARGET_X=~/.Xdefaults
[ ! -f $CONF_FILE ] && exit;
function getColor() {
if [[ -n "$1" ]]; then
grep -E "^[ ]*#define.+S_$1[ ]+" $CONF_FILE | awk '{print $3}'
fi
}
X_BEGIN_STR="!! ~~~~ BEGIN COLOR SETTINGS ~~~~ !!"
X_END_STR="!! ~~~~ END COLOR SETTINGS ~~~~ !!"
ORIGX=""
if [ -f $TARGET_X ]; then
SKIP=false
while read line;
do
if [ "$line" = "$X_BEGIN_STR" ]; then
SKIP=true
continue
elif [ "$line" = "$X_END_STR" ]; then
SKIP=false
continue
fi
if [ $SKIP = false ] && [ -n "$line" ]; then
ORIGX="$ORIGX$line\n"
fi
done < $TARGET_X
fi
CNAMES=( yellow orange red magenta violet blue cyan green base0 base1 base2 base3 base00 base01 base02 base03 )
declare -A COLORS=()
for i in "${CNAMES[@]}"
do
COLORS[$i]=$( getColor $i )
done
SETTINGS=""
function push_val() {
SETTINGS=$SETTINGS"$1\n"
}
push_val
push_val "$X_BEGIN_STR"
push_val "*VT100*background: ${COLORS['base03']}"
push_val "*VT100*foreground: ${COLORS['base0']}"
push_val "*VT100*fading: 40"
push_val "*VT100*fadeColor: ${COLORS['base08']}"
push_val "*VT100*cursorColor: ${COLORS['base1']}"
push_val "*VT100*pointerColorBackground: ${COLORS['base01']}"
push_val "*VT100*pointerColorForeground: ${COLORS['base1']}"
push_val "*VT100*color0: ${COLORS['base02']}"
push_val "*VT100*color1: ${COLORS['red']}"
push_val "*VT100*color2: ${COLORS['green']}"
push_val "*VT100*color3: ${COLORS['yellow']}"
push_val "*VT100*color4: ${COLORS['blue']}"
push_val "*VT100*color5: ${COLORS['magenta']}"
push_val "*VT100*color6: ${COLORS['cyan']}"
push_val "*VT100*color7: ${COLORS['base2']}"
push_val "*VT100*color8: ${COLORS['base03']}"
push_val "*VT100*color9: ${COLORS['orange']}"
push_val "*VT100*color10: ${COLORS['base01']}"
push_val "*VT100*color11: ${COLORS['base00']}"
push_val "*VT100*color12: ${COLORS['base0']}"
push_val "*VT100*color13: ${COLORS['violet']}"
push_val "*VT100*color14: ${COLORS['base1']}"
push_val "*VT100*color15: ${COLORS['base3']}"
push_val "$X_END_STR"
echo -e "$ORIGX\n$SETTINGS" > $TARGET_X

View File

@ -1,26 +0,0 @@
#!/bin/bash
#
# This file echoes a bunch of color codes to the
# terminal to demonstrate what's available. Each
# line is the color code of one forground color,
# out of 17 (default + 16 escapes), followed by a
# test use of that color on all nine background
# colors (default + 8 escapes).
#
T='gYw' # The test text
echo -e "\n 40m 41m 42m 43m\
44m 45m 46m 47m";
for FGs in ' m' ' 1m' ' 30m' '1;30m' ' 31m' '1;31m' ' 32m' \
'1;32m' ' 33m' '1;33m' ' 34m' '1;34m' ' 35m' '1;35m' \
' 36m' '1;36m' ' 37m' '1;37m';
do FG=${FGs// /}
echo -en " $FGs \033[$FG $T "
for BG in 40m 41m 42m 43m 44m 45m 46m 47m;
do echo -en "$EINS \033[$FG\033[$BG $T \033[0m";
done
echo;
done
echo

View File

@ -12,7 +12,7 @@ RBASH_SOURCES="$RBASH_HOME/sources"
RBASH_CONFIG="$RBASH_HOME/config" RBASH_CONFIG="$RBASH_HOME/config"
RBASH_REMOTE="https://git.k8s.astropenguin.net" RBASH_REMOTE="https://git.k8s.astropenguin.net"
RBASH_REPO="penguin/utils" RBASH_REPO="penguin/utils"
RBASH_PATH="bash/bashrc" RBASH_PATH="bash"
# Source global definitions # Source global definitions
if [ -f /etc/bashrc ]; then if [ -f /etc/bashrc ]; then

21
bash/sources/60_diagnostics Executable file
View File

@ -0,0 +1,21 @@
#!/bin/bash
function dumpcolors {
# Reference: https://tldp.org/HOWTO/Bash-Prompt-HOWTO/x329.html
T='gYw' # The test text
echo -e "\n 40m 41m 42m 43m\
44m 45m 46m 47m";
for FGs in ' m' ' 1m' ' 30m' '1;30m' ' 31m' '1;31m' ' 32m' \
'1;32m' ' 33m' '1;33m' ' 34m' '1;34m' ' 35m' '1;35m' \
' 36m' '1;36m' ' 37m' '1;37m';
do FG=${FGs// /}
echo -en " $FGs \033[$FG $T "
for BG in 40m 41m 42m 43m 44m 45m 46m 47m;
do echo -en "$EINS \033[$FG\033[$BG $T \033[0m";
done
echo;
done
echo
}