blob: 829ab4f3c2c52656caad4d61e72ab83db56dcfbf (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
#!/bin/sh
set -e
[ -n "$DEBUG" ] && set -x
# stolen from https://github.com/lemnos/theme.sh/blob/master/bin/theme.sh
awk '
BEGIN {
fgesc="\033]10;#%s\007"
bgesc="\033]11;#%s\007"
curesc="\033]12;#%s\007"
colesc="\033]4;%d;#%s\007"
}
/^foreground:/ { printf fgesc, substr($2, 2) > "/dev/tty" }
/^background:/ { printf bgesc, substr($2, 2) > "/dev/tty" }
/^cursor:/ { printf curesc, substr($2, 2) > "/dev/tty" }
/^[0-9]+:/ { printf colesc, $1, substr($2, 2) > "/dev/tty" }
'
|