Sample Header Ad - 728x90

How to dynamically switch terminal colors for all open terminals?

0 votes
2 answers
1683 views
I use gnome-terminal on Ubuntu / Fedora. For color schemes I use [base16-shell](https://github.com/chriskempson/base16-shell) , along with its corresponding settings for my editor vi. I have configured my .bashrc to set the base16 theme on start up. I sometimes switch between themes by changing this bashrc file. This works for occasional changes to my color scheme, as I can just my .bashrc once in a while and all future windows open with the correct color. **What I want?** I want to be able to change color scheme on all open gnome-terminal windows with a single click / command. Is there a way to do that? **About my Workflow** I usually have a bunch of terminal windows open with different settings on them. Some of them have text editors open, and some text editor program (vim) in the background, to allow multi-tasking with multiple text editors on the same terminal window. Depending on the lighting in the room, I feel it is better to switch between two color schemes - A light color scheme during the day / brightly lit room, and dark color scheme during the night, not so well lit room. I don't want to go and type a command to switch color schemes on each open terminal windows. Besides some may have a program running in the foreground printing, which I may not want to interrupt. Is there a way to "signal" the terminal to switch to a custom color scheme? I understand it might be difficult to do it on terminals that have a program running actively in the foreground. But at least can I do it for all other terminals which have programs in the background, or no command running. I am willing to explore other terminals if that would help. I have been thinking of using gnome-terminal profiles, but can't seem to figure out how to achieve exactly what I want. Thanks in advance!
Asked by Rohit Banga (111 rep)
Sep 19, 2021, 07:59 PM
Last activity: Feb 9, 2025, 05:58 AM