dots

git clone git://mattcarlson.org/repos/dots.git
Log | Files | Refs

commit 85347a9252c80428da515886c2d4574928e5ee46
parent 632dc7d0c9f2f5e3ec335bbeeb5372dfa6b67266
Author: Matthew Carlson <matt@mcarlson.xyz>
Date:   Mon,  2 Aug 2021 19:54:23 -0400

ansi instead of tput

Diffstat:
M.config/mksh/mkshrc | 39+++++++++++++++++++--------------------
M.config/sh/profile | 20+++++++++++---------
M.local/bin/lock.sh | 2++
3 files changed, 32 insertions(+), 29 deletions(-)

diff --git a/.config/mksh/mkshrc b/.config/mksh/mkshrc @@ -6,29 +6,28 @@ if ! command -v pfetch >/dev/null; then pfetch() { :; }; fi pfetch -# tput -COL0="$(tput setaf 0)" -COL1="$(tput setaf 1)" -COL2="$(tput setaf 2)" -COL3="$(tput setaf 3)" -COL4="$(tput setaf 4)" -COL5="$(tput setaf 5)" -COL6="$(tput setaf 6)" -COL7="$(tput setaf 7)" -COL8="$(tput setaf 8)" -COL9="$(tput setaf 9)" -COL10="$(tput setaf 10)" -COL11="$(tput setaf 11)" -COL12="$(tput setaf 12)" -COL13="$(tput setaf 13)" -COL14="$(tput setaf 14)" -COL15="$(tput setaf 15)" -BOLD="$(tput bold)" -NORMAL="$(tput sgr0)" +COL0='\x1b[0;30m' +COL1='\x1b[0;31m' +COL2='\x1b[0;32m' +COL3='\x1b[0;33m' +COL4='\x1b[0;34m' +COL5='\x1b[0;35m' +COL6='\x1b[0;36m' +COL7='\x1b[0;37m' +COL8='\x1b[1;30m' +COL9='\x1b[1;31m' +COL10='\x1b[1;32m' +COL11='\x1b[1;33m' +COL12='\x1b[1;34m' +COL13='\x1b[1;35m' +COL14='\x1b[1;36m' +COL15='\x1b[1;37m' +BOLD='\x1b[1m' +NORMAL='\x1b[0m' # prompt # bashism required b/c mksh doesn't support param expansion for PS1 -PS1='${BOLD}${COL2}${PWD} $ ${NORMAL}${COL7}' +PS1=$'$(printf '%b' "${COL10}${PWD} $ ${NORMAL}")' export PS1 # gpg tty diff --git a/.config/sh/profile b/.config/sh/profile @@ -50,23 +50,25 @@ export VIDEOS_DIR="${HOME}/vids/" export GNUPG="9CC4E75365C16465FFE752C94DDBF97211D4EA31" # colorful man pages -LESS_TERMCAP_mb=$(tput bold; tput setaf 2) + +# colorful man pages +LESS_TERMCAP_mb="$(printf '%b' '\x1b[1;32m')" export LESS_TERMCAP_mb -LESS_TERMCAP_md=$(tput bold; tput setaf 2) +LESS_TERMCAP_md="$(printf '%b' '\x1b[1;32m')" export LESS_TERMCAP_md -LESS_TERMCAP_me=$(tput sgr0) +LESS_TERMCAP_me="$(printf '%b' '\x1b[0m')" export LESS_TERMCAP_me -LESS_TERMCAP_so=$(tput bold; tput setaf 0; tput setab 2) +LESS_TERMCAP_so="$(printf '%b' '\x1b[1;30;42m')" export LESS_TERMCAP_so -LESS_TERMCAP_se=$(tput rmso; tput sgr0) +LESS_TERMCAP_se="$(printf '%b' '\x1b[23;0m')" export LESS_TERMCAP_se -LESS_TERMCAP_us=$(tput smul; tput bold; tput setaf 2) +LESS_TERMCAP_us="$(printf '%b' '\x1b[4;1;32m')" export LESS_TERMCAP_us -LESS_TERMCAP_ue=$(tput rmul; tput sgr0) +LESS_TERMCAP_ue="$(printf '%b' '\x1b[24;0m')" export LESS_TERMCAP_ue -LESS_TERMCAP_mr=$(tput rev) +LESS_TERMCAP_mr="$(printf '%b' '\x1b[7m')" export LESS_TERMCAP_mr -LESS_TERMCAP_mh=$(tput dim) +LESS_TERMCAP_mh="$(printf '%b' '\x1b[2m')" export LESS_TERMCAP_mh LESS_TERMCAP_ZN=$(tput ssubm) export LESS_TERMCAP_ZN diff --git a/.local/bin/lock.sh b/.local/bin/lock.sh @@ -4,6 +4,8 @@ SOCKETS_DIR="/tmp/mpv-sockets/" +mpc pause &>/dev/null; + for socket in "${SOCKETS_DIR}"/*; do [ -e "${socket}" ] || break printf 'set pause yes' | socat - "${socket}";