summaryrefslogtreecommitdiff
path: root/bin/cursor
diff options
context:
space:
mode:
authorMarc Vertes <mvertes@free.fr>2025-01-06 12:33:18 +0100
committerMarc Vertes <mvertes@free.fr>2025-01-06 12:33:18 +0100
commit270699d4eb1f1d27e2d8905cfbbf0037f07609ed (patch)
tree4821b26edcb242f2d8710ea65043d4f7a12cad8f /bin/cursor
parent7138f485299e110f59bfea1bc0deda82750104e2 (diff)
add cursor color management
Diffstat (limited to 'bin/cursor')
-rwxr-xr-xbin/cursor22
1 files changed, 22 insertions, 0 deletions
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