2

For general use of terminal, I use a transparent theme. But for some purpose, I have a shell script which I would like to run with different profile/theme ( I mean with different foreground and background colors and opacity).

Can I do anything (Maybe like adding some code to my shell script) , so that I may start the shell script with different profile.

PS: I'm on Ubuntu 15.04 and using bash, if that makes any difference.

3

Not by modifying your script, no. The script has no knowledge of the terminal, the terminal is just a graphical window that runs a shell. However, assuming you're using gnome-terminal, you can choose the profile on the commandline:

gnome-terminal --window-with-profile=PROFILENAME

So, if you profile's name is foo, you could write a wrapper script (script1.sh) that executes your script (script2.sh) in a window with that profile:

#!/usr/bin/env bash
gnome-terminal --window-with-profile=foo -x script2.sh

Now, if you run script1, it will open a new terminal with the right profile and run script2 in it.

  • Thank you very much. That's exactly what I was looking for . It did the trick. – kashish Oct 7 '15 at 16:14

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.