aboutsummaryrefslogtreecommitdiff
path: root/tmux-colortag-prompt.sh
diff options
context:
space:
mode:
authorDeterminant <tederminant@gmail.com>2020-05-22 13:07:33 -0400
committerDeterminant <tederminant@gmail.com>2020-05-22 13:07:33 -0400
commit59364ee5cba4a85e7ceb9318fb8745f2f250f8ff (patch)
tree385178fb895d67bb21701b9e3bc38d5e959d5a4c /tmux-colortag-prompt.sh
parentf762c7f81f0c093470be9ebe91dcfc08cb6fffe4 (diff)
add feature to allow manual coloring
Diffstat (limited to 'tmux-colortag-prompt.sh')
-rwxr-xr-xtmux-colortag-prompt.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/tmux-colortag-prompt.sh b/tmux-colortag-prompt.sh
new file mode 100755
index 0000000..74cfdf8
--- /dev/null
+++ b/tmux-colortag-prompt.sh
@@ -0,0 +1,24 @@
+#!/usr/bin/env bash
+
+CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+case "$1" in
+ prompt)
+ tmux command-prompt -p '[ColorTag]:' "run-shell 'idx=#I name=#W $CURRENT_DIR/tmux-colortag-prompt.sh %1'"
+ ;;
+ color-idx)
+ "$CURRENT_DIR/name2color.py" "$idx" "$name" --color-idx "$2" || echo "invalid argument"
+ ;;
+ color-name)
+ "$CURRENT_DIR/name2color.py" "$idx" "$name" --color-name "$2" || echo "invalid argument"
+ ;;
+ clear-idx)
+ "$CURRENT_DIR/name2color.py" "$idx" "$name" --clear-idx
+ ;;
+ clear-name)
+ "$CURRENT_DIR/name2color.py" "$idx" "$name" --clear-name
+ ;;
+ clear-all)
+ "$CURRENT_DIR/name2color.py" "$idx" "$name" --clear
+ ;;
+ *) echo "invalid ColorTag command"; exit 0;;
+esac