Gnome Terminal Switcher - manual
Setting Gnome Shell Colour Scheme in Night Theme Switcher
Description
Updating the Gnome Terminal Colour Scheme using a provided script.
Note: The script provided in these instructions modifies your Gnome Terminal Profile Settings. Especially the forground-color and the background-color settings
Introduction
As Night Theme Switcher only applies day/night theme switching on themes, as in Shell, GTH or Icons, Gnome Terminal Colour Scheme is an odd one, and therefore left out. Gnome Terminal can be instructed to follow the GTK theme colours, but that is mostly back/white.
As a regular Gnome Terminal user, I really like to have a colour scheme switched the same way as a GTK theme is switched with the help op Night Theme Switcher. And so I created a Bash Script and some instructions.
Installation
Requirements
- Bash (a fairly recent version)
- Gnome Desktop (Duh)
- Night Theme Switcher Extension (duh, duh)
- Script from here: set-gterm.sh
Steps
Copy the set-gterm.sh script to a directory that is in your PATH variable. Good places usually are:
- /usr/local/bin (requires root privileges)
- ~/bin (bin folder in your home directory, most of the time in PATH. sometimes needs to be created)
Make set-gterm.sh executable. Execute the following in the directory where you put set-gterm.sh. ``chmod +x set-germ.sh
Note: Depending on the path, you might need to become root again for this command.
Open the Settigns dialog of Night Theme Switcher and go to tab 'Command'. Enable the 'Run Commands' switch and set set-gterm.sh with correct parameters for sunrise and sunset. Parameters are in the following section.
Script Usage
The script has a fairly complete help function. Here is the most significant part:
set-gterm.sh - Set or switch colour scheme and variants for Gnome Terminal
Usage:
set-gterm.sh [-h] [-p] [-d|-l] [-i Profile ID] [-s GNOME|Tango|Solarized]
-h Show this help. All other options are ignored.
-p Print the list of profile IDs and names. All other options (except -h) are ignored.
-d Set Dark mode for colour scheme.
-l Set Light mode for colour scheme.
-i The profile ID to use.
-s The Colour Scheme to use.
The parameters itself are case sensitive, but the Profile ID and the Colour Scheme name are not.
You can choose between three colour schemes. Those are the Colour Schemes that are provided by default and have a dark and light variant.
You can select the dark -d, or light -l variant of the Colour Scheme, depending on the day or night. Omitting, or providing both the parameters, -d and -l, switches the Colour Scheme. When the background is fairly dark, it will set the light variant, otherwise the dark variant will be set.
The Profile ID normally doesn't have to be set. When it's omitted, the current default profile will be used.
Examples
To set a Solarized light Colour Scheme:
set-gterm.sh -ls Solarized
To set a Tango dark Colour Scheme:
set-gterm.sh -ds Tango