Цветовая схема терминала linux

179 Color Schemes For Your Gtk-Based Linux Terminal (Gnome Terminal, Tilix, Xfce Terminal, More)

Gogh is a set of Bash scripts that makes it easy to change the terminal color scheme on Linux and macOS. It currently offers 179 terminal color schemes (even though its website only lists 168 with previews), and it supports Gtk-based terminals like Gnome Terminal, Xfce Terminal, Mate Terminal, Pantheon Terminal, Tilix and Guake on Linux, and iTerm2 on Mac.

You can view most of the color schemes on the Gogh website.

This article will show you how to install and apply new terminal color schemes using Gogh, with the particularities this involves for each terminal application supported by Gogh (including workarounds, which are required in some cases).

Gogh installation and usage with each terminal it supports on Linux

The Gogh color scheme installation has some particularities with each terminal it supports. I tested it with the terminal it supports on Linux, but only on Ubuntu (including Xubuntu and Ubuntu Mate), Debian 10, and Elementary OS 5.0 Juno.

There might be even more particularities when using Gogh on other Linux distributions, but as you can imagine, I can’t test all possible combinations, and I’ve already spent half a day trying it on various Ubuntu (and flavors) versions, Debian and Elementary OS, so my instructions target these, along with other Debian or Ubuntu based Linux distributions, including Linux Mint, Pop!_OS, and so on.

Gogh should work on other Linux distributions as well, but I did not try it.

Before trying to use Gogh, you’ll need to install dconf-cli , uuid-runtime , and optionally wget (if you wish to use it as it’s mentioned on the Gogh website). Install these on Debian, Ubuntu, and any Linux distribution based on Debian or Ubuntu using:

sudo apt install dconf-cli uuid-runtime wget

Please read the Gogh particularities I encountered, for the terminal emulator you’re using, which is further down in this article! Only then install new color schemes using Gogh.

Gogh terminal color scheme installer

The official way of using Gogh on Linux is the following:

bash -c "$(wget -qO- https://git.io/vQgMr)"
bash -c "$(curl -sLo- https://git.io/vQgMr)"

This lists all available terminal color schemes in Gogh, and asks you to enter the number of the theme you wish to install. It also asks if you wish to apply it in some cases.

But using Gogh this way has some security concerns. You can check the script code today, but what if it changes tomorrow and it then contains some malicious code (e.g. if the repository is hacked)? This is why I prefer to clone the Gogh repository and use the script for a particular theme, this way checking the script code being a lot easier. This can be done by cloning the Gogh GitHub repository:

git clone https://github.com/Mayccoll/Gogh

And then apply a terminal color scheme, let’s say Zenburn, by going to the Gogh themes/ folder and running the zenburn.sh script:

cd Gogh/themes ./zenburn.sh #or whatever color scheme you want to use

Use whatever method suits you.

Читайте также:  Как проверить флешку линукс

Before using Gogh, you’ll need to create a new Gnome Terminal profile, or else you’ll get an error. From the Gnome Terminal Preferences, click the + button next to Profiles , enter a new profile name and click Create . After installing a new color scheme (which is added as a new profile for Gnome Terminal) using Gogh, you can delete this profile.

Since the color scheme is installed as a new profile by Gogh in Gnome Terminal’s case, you can change it temporarily by right clicking inside the terminal window and choosing the new profile from there. To make it permanent, open the Gnome Terminal Preferences and make the profile you want to use (which should have the name of the color scheme) default.

In the case of Tilix, Gogh will ask to use a color scheme instead of a profile. Enter y when asked, to accept this. Gogh will also prompt you to apply the new color profile but in my case that didn’t work. Instead, to apply the new color scheme, open the Tilix Preferences, select the Default profile, and from the Color tab choose the color scheme you installed using Gogh. You may also install the color scheme as a new profile if you wish.

I got an error trying to use Gogh to install new color schemes for Xfce Terminal: ERROR: config file not present or not writeable! .

Looking at the Gogh apply-colors.sh code, it looks like the script requires having an ~/.local/share/xfce4/terminal/colorschemes folder and an ~/.config/xfce4/terminal/terminalrc file, so I created those and Gogh worked.

Do note that this completely resets the Xfce Terminal default configuration, as it’s set by you or the Linux distribution you’re using (Xubuntu in the case of my testing, since Debian doesn’t customize this), and it can be reverted by deleting them. So for example on Xubuntu, the font was changed from DejaVu Sans Mono Book 9 to Monospace Regular 12, etc.

You can create these using:

mkdir -p ~/.local/share/xfce4/terminal/colorschemes mkdir -p ~/.config/xfce4/terminal/ touch ~/.config/xfce4/terminal/terminalrc

After this, close all Xfce Terminal instances, re-open it, and use Gogh to install a new color scheme.

In Xfce Terminal’s case, Gogh asks if it should apply the newly installed color scheme, but that did not work for me. Instead, to change the color scheme, go to the Xfce Terminal Preferences , on the Colors tab, and change the preset from the Presets option available at the bottom of the window. Edit: after installing Xfce Terminal on Ubuntu 19.04 (to take the screenshot you see at the top of the article), Gogh was able to apply the new color scheme automatically, even though it’s the same version of Xfce Terminal as in Xubuntu 18.04. In any case, I’ll leave this here so those for which the color scheme doesn’t change automatically have an alternative.

In the case of Guake, Gogh was able to install and apply the new color scheme (without prompting) without issues. However, the new color scheme was applied (you can change the color scheme from the Guake Preferences -> Appearance -> Palette ) as a custom scheme, so in case you install multiple color schemes using Gogh, you won’t be able to switch between them from the Guake Preferences, as there can only be one custom color scheme.

Читайте также:  Astra linux repository ubuntu

On a fresh Ubuntu Mate 18.04 installation, the first time trying to use Gogh results in an error saying that dconf dir must not contain two consecutive slashes . This only happens the first time though (this error no longer shows up on subsequent runs).

It should also be noted that you need to restart Mate Terminal after installing color schemes with Gogh, or else the profile names will not be shown correctly in the profiles list.

Since the color scheme is installed as a new profile by Gogh for Mate Terminal, you can change it temporarily by right clicking inside the terminal window and choosing the new profile from there. To make it permanent, you’ll need to go to Edit -> Profiles and change Profile used when launching a new terminal to the profile containing the name of the color scheme you want to use by default.

Gogh works out of the box with Pantheon Terminal on Elementary OS 5.0 Juno. It automatically (without prompting) changes the terminal color scheme to the theme you choose from the Gogh prompt.

Источник

My Linux terminal color scheme

In this post, you will learn how to add some colors to your terminal which is black and white by default in some distros such as Arch Linux. It is not pleasant to the eye especially to newcomers. It may not seem important, but adding some color to the terminal can greatly improve the user experience.

I will use Arch Linux as an example, and I will apply a color scheme in Bash environment, Pacman (the Arch Linux package manager), and Nano text editor. All settings except Pacman, should work in other Linux distros.

So, let’s start to add a Linux terminal color scheme. As usual, you can follow the video tutorial or continue reading below.

1. Enable colors in Bash

What is Bash?

Most of Linux distros use Bash shell, which stands for Bourne-again shell. The interface you see in the terminal is called Shell environment.

This is Shell

So, when I talk about making terminal colorful, I mean enabling colors in Bash.

By default, you Bash environment does not have any color. Everything is just black and white.

Just black and white Shell

Bash settings files

To make your Bash colorful in Arch Linux, you need to edit Bash setting files. There are two files you can edit. One is located in /etc/bash.bashrc , another is ~/.bashrc in your home folder. The file /etc/bash.bashrc defines the system-wide settings for all users and your root account, while ~/.bashrc is user specific. So, if you have several users, you need to edit this user specific file for every user. Also, if you edit .bashrc in your home, its setting will be prioritized over /etc/bash.bashrc .

I recommend you to edit only .bashrc . It is safer. But if you are a confident user, edit /etc/bash.bashrc , this will apply the settings system-wide and save your time in the future if you create several users.

Читайте также:  Linux kernel mitigations off

files that you can edit to add color to bash

Make a backup copy of the settings file:

sudo cp /etc/bash.bashrc /etc/bash.bashrc.backup 

Note: Regardless of which file you decide to edit, always it is a good idea back up the original file.

Now, it is safe to edit any of these files. So, If something goes wrong, you can simply restore the backup file.

Adding my Linux terminal color scheme

Normally, you would have to go through all the wiki pages of Arch Linux and configure your preferences.

Arch Linux Wiki

But you are lucky because I have done all that job already. You just need to download bash.bashrc, DIR_COLORS and .bashrc and move these files to the following places.

The bash.bashrc file to /etc/bash.bashrc

sudo mv bash.bashrc /etc/bash.bashrc 

The DIR_COLORS file move it to /etc.

Now, move .bashrc file to your home directory.

Then, restart the terminal and that is is. Now you have some color in your terminal.

Linux terminal color scheme example

2. Colorful output in Pacman

If you use Arch Linux, you can enable syntax highlighting for pacman . Its output is of the same color by default and it will be easier to read it when it is colorful.

As always, first back up your pacman.config file.

cp /etc/pacman.conf /etc/pacman.conf.backup 

And uncomment the word color in that file. The fastest way to do that is to run this command:

sed -i 's/#Color/Color/g' /etc/pacman.conf 

So, run the pacman update again.

Some color in pacman

Now, there is some color differentiation in the output.

When you open the manual of pacman , there is some syntax highlighting as well. It is much easier to read.

Pacman manual page in color

As I said before these are small changes but they make the terminal look more pleasant.

3. Syntax highlighting in Nano

Nano is a text editor in the terminal. Usually it does not have text highlighting by default. If you use the Nano text editor, as I do, you will benefit from enabling syntax highlighting in it.

For example, when you open, let say awk script, there is no syntax highlighting and this is how it looks.

No syntax highlight on nano

Let is enable syntax highlighting.

First, backup your nano config file. If something goes wrong, you will just have to restore the backup.

sudo cp /etc/nanorc /etc/nanorc.backup 

Next, activate color mode predefined in the files /usr/share/nano/*.nanorc .

List of color scheme available for nano

To enable these settings, you have to edit one of these ~/.nanorc or /etc/nanorc files. You already know the difference between those two files nanorc file is for user-specific, whereas /etc/nanorc is for system-wide settings. I will edit the system-wide settings.

And paste the following line in the end of the file.

include "/usr/share/nano/*.nanorc" 

Enabling the color schemes for nano

Press Ctrl+O to write the changes, and Ctrl+X to exit Nano.

Now, if open the awk script again, you will see some color.

nano with highlight enabled

Conclusion

Enabling the Linux terminal color scheme is a small thing to do but it will make your terminal more enjoyable to use.

Please, let me know on the comments section if you know more Linux terminal color schemes. Maybe I missed something.

Average Linux UserFollow I am the founder of the Average Linux User project, which is a hobby I work on at night. During the day I am a scientist who uses computers to analyze genetic data.

Источник

Оцените статью
Adblock
detector