From 270699d4eb1f1d27e2d8905cfbbf0037f07609ed Mon Sep 17 00:00:00 2001 From: Marc Vertes Date: Mon, 6 Jan 2025 12:33:18 +0100 Subject: add cursor color management --- bin/cursor | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 bin/cursor (limited to 'bin/cursor') diff --git a/bin/cursor b/bin/cursor new file mode 100755 index 0000000..6fdbc12 --- /dev/null +++ b/bin/cursor @@ -0,0 +1,22 @@ +#!/bin/bash + +# Set cursor in xterm and compatibles. + +cursor() { + case $1 in + (r|red) cc='#f00' ;; + (n|green) cc='#5f5' ;; + (b|blue) cc='#55f' ;; + (c|cyan) cc='#0ff' ;; + (y|yellow) cc='#ff0' ;; + (m|magenta) cc='#f0f' ;; + (o|orange) cc='#f80' ;; + (k|black) cc='#111' ;; + (g|gr[ae]y) cc='#888' ;; + (w|white) cc='#eee' ;; + (*) cc=$1 ;; + esac +} + +cursor "${1:-red}" +printf '\e]12;'$cc'\e\' # set cursor color -- cgit v1.2.3