change color palette dynamically

Asked by Jean-Pierre De Schacht on 2013-11-18

Hi,
I am a new terminator user.
I searched all questions but could not find an answer.

Is it possible to change the palette colors dynamically?
By sending an escape sequence from inside a running terminator window, and apply the palette 'on the fly'?

I could have swarn that echoing the new palette worked until recently. It does not work any more.
This worked:
echo -en #color1:#color2:#...

It does not work any more.
Not on debian jessy, nor debian sid based systems, both up-to-date.

Thanks

Question information

Language:
English Edit question
Status:
Solved
For:
Terminator Edit question
Assignee:
No assignee Edit question
Solved by:
Stephen Boddy
Solved:
2013-11-18
Last query:
2013-11-18
Last reply:
2013-11-18

Hi Jean-Pierre, can you point me to some reference that describes what you're trying to do as I don't know this ability? Your echo statement looks strange. No escape codes, and you don't say what "color1" should be (i.e. "white", "FFFFFF", "0xFFFFFF"). The first hash in your example will simply turn the rest of the line into a comment, resulting in an empty line with no line end being printed (in other words, nothing), followed by the prompt.

Hi Stephen,
No, I can not point you to a reference describing what I am trying to do, except this little script I found online:
[code]
#!/bin/bash
# takes an image and creates a color palette from it
# which gets echoed to the console.
#
# made by rhowaldt (fuck you)
# customized for terminator by fog
# depends: imagemagick

PALETTE=$(convert "$1" -colors 16 -format "%c" histogram:info:)
HEXLIST=$(echo "$PALETTE" | sed 's/^.*\#\(.*\) srgb.*/\1/g')
COL=("#" ":#" ":#" ":#" ":#" ":#" ":#" ":#" ":#" ":#" ":#" ":#" ":#" ":#" ":#" ":#");
x=0

while read line; do
      echo -en "${COL[$x]}$line";
      let x=x+1
done <<< "$HEXLIST"
clear
[/code]
I was under the impression that it would change the colour palette 'on the fly' but it is my undestanding now that this script was used to capture the output and use it to edit the terminator config file manually, not 'on the fly'.

So forget about the echo statement.

The question is now: Are there methods to change the terminator palette on the fly by running a script from the command line, and if so what escape codes should be generated by the script?

Thanks

Sorry about the offensive language in previous post.
I only noticed after sending the message and I cant seem to be able to change it any more.
My apologies.

Language is no problem for me, and it was obvious it wasn't yours.

I'm not aware of anything that would do what you want. We have profiles that can have different defined palettes, but I don't think there's even a scripted way to switch the profile, never mind a way to change a palette on the fly. It is possible, but would have to be coded and is probably quite tricky. I can only think right now of something that took the term environment, found an identifying var (i.e. all terms have a UUID, but it would need to be added to the environment of the shell) for the terminal, then call a DBUS function that could modify the palette for the matching terminal.

Thanks Stephen Boddy, that solved my question.