summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Vertes <mvertes@free.fr>2024-11-11 09:14:21 +0100
committerMarc Vertes <mvertes@free.fr>2024-11-11 09:14:21 +0100
commit4912d5f2c9f05b5839c8fcf514b4453f24669cbe (patch)
treee3cab100420062712f72c6f98ce73bb1ac0b067f
parent662f349e41b6c22b5c66467ede9c5535fd4ce26a (diff)
update
-rw-r--r--.bashrc6
-rwxr-xr-xbin/tc20
2 files changed, 21 insertions, 5 deletions
diff --git a/.bashrc b/.bashrc
index d375799..97d766f 100644
--- a/.bashrc
+++ b/.bashrc
@@ -84,7 +84,6 @@ alias ww='(cd ~/Wiki && vi home_page.md)'
alias s='(cd ~/Wiki && vi scratch.md)'
alias dotfiles='git --git-dir=$HOME/dotfiles --work-tree=$HOME'
alias pv='qlmanage -p'
-alias tc=termcolor
gtr() { go test -v -run "$@"; }
export -f gtr
@@ -108,6 +107,7 @@ alias y='rlwrap -pblue yaegi'
alias dy='YAEGI_AST_DOT=1 YAEGI_CFG_DOT=1 ./yaegi'
alias wai='~/go/src/github.co/traefik/whoami/whoami'
+alias ogc='open -a "Google Chrome" --args --silent-debugger-extension-api'
# yaegi debug
export YAEGI_DOT_CMD="dotty -"
export YAEGI_UNSAFE=1
@@ -183,7 +183,3 @@ export HOMEBREW_REPOSITORY=/opt/homebrew
# Added by Radicle.
export PATH="$PATH:/Users/marc/.radicle/bin"
-
-#case $TERM_PROGRAM in
-#Apple_Terminal) termcolor
-#esac
diff --git a/bin/tc b/bin/tc
new file mode 100755
index 0000000..f73d109
--- /dev/null
+++ b/bin/tc
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+# Set terminal color in xterm and compatibles.
+
+color() {
+ case $1 in
+ (0|w|white) bg='#ffffff' ;;
+ (1|g|gray) bg='#eeeeee' ;;
+ (2|b|blue) bg='#cfffff' ;;
+ (3|r|red) bg='#fff0ff' ;;
+ (4|y|yellow) bg='#ffffe0' ;;
+ (5|n|green) bg='#e0ffe0' ;;
+ (6|o|orange) bg='#fff0f4' ;;
+ (7|k|black) bg='#111111' fg='#eeeeee' ;;
+ esac
+}
+
+color ${1:-$((RANDOM % 7))}
+printf '\E]11;'$bg'\E\'
+printf '\E]10;'${fg:-#000000}'\E\'