Randomize GNOME-Terminal Color Scheme

https://t.co/M4kUzYVPMJ
opening a new terminal with a random color scheme so that I can better distinguish them in the taskbar pic.twitter.com/OWSfoSL2iZ

— LucidBrot (@LucidBrot) September 10, 2020

Please excuse the long whitespace. It's a hack to ensure the page content displays correctly despite this frame not having loaded.



















Too often I chose the wrong terminal window from the preview in the taskbar. So I searched for a good solution to randomize the colors, but found none. Which means I made my own.

  1. Create some Terminal Color Profiles in GNOME-Terminal as you would normally, using the GUI. Or grab some from Gogh. You can find a list of the Gogh color schemes I am using at the end of this page.

  2. You could use xdotool to simulate the keystrokes ShiftF10, r, number as I outlined here, but this introduces bugs if you're too fast at typing. We want a cleaner way, so we modify everything in a cleaner way as I explained there. This second approach works well when you open the terminal with a gnome shortcut, from the taskbar icon, or from the search!

    I have explained how to do this and what each step means in my askubuntu answer there. See the following steps for a shortened version.

  3. Add the following code to /usr/local/bin/gnome-terminal :

  4. If you ever need to open a new terminal without this script running, you'll have to use the full path to /usr/bin/gnome-terminal.