3 # ucolour: Set urxvt (or terminal which understands the same escape sequences)
5 # Usage: ucolour option <colour> [option <colour> ...]
6 # Options: -b Set background.
7 # -B Set highlight background.
11 # -F Set highlight foreground.
14 # -p Set palette reference with -P.
15 # Notes: Border defaults to background.
16 # The -P and -p flags must be used together.
29 while getopts ":B:F:P:b:c:d:f:m:p:" opt; do
44 if [ -n "$pc" -o -n "$ps" ]; then
45 if [ -z "$pc" -o -z "$ps" ]; then
46 echo >&2 "$PROG: Must use -P and -p together."
50 [ -n "$bg" -a -z "$bd" ] && bd=$bg
51 if [ -z "$BG$FG$bd$bg$cu$fg$mo$pc" ]; then
52 echo >&2 "Usage: ucolour option <colour> [option <colour> ...]"
53 echo >&2 "Options: -b Set background."
54 echo >&2 " -B Set highlight background."
55 echo >&2 " -c Set cursor."
56 echo >&2 " -d Set border."
57 echo >&2 " -f Set foreground."
58 echo >&2 " -F Set highlight foreground."
59 echo >&2 " -m Set mouse."
60 echo >&2 " -P Palette index."
61 echo >&2 " -p Set palette reference with -P."
62 echo >&2 "Notes: Border defaults to background."
63 echo >&2 " The -P and -p flags must be used together."
67 [ -n "$TMUX" ] && tmux_prefix="\033Ptmux;\033"
68 [ -n "$BG" ] && echo -en "$tmux_prefix\033]17;$BG\007"
69 [ -n "$FG" ] && echo -en "$tmux_prefix\033]19;$FG\007"
70 [ -n "$bg" ] && echo -en "$tmux_prefix\033]11;$bg\007"
71 [ -n "$bd" ] && echo -en "$tmux_prefix\033]708;$bd\007"
72 [ -n "$cu" ] && echo -en "$tmux_prefix\033]12;$cu\007"
73 [ -n "$fg" ] && echo -en "$tmux_prefix\033]10;$fg\007"
74 [ -n "$mo" ] && echo -en "$tmux_prefix\033]13;$mo\007"
75 [ -n "$pc" ] && echo -en "$tmux_prefix\033]4;$pc;$ps\007"