Linux terminal config file

configure gnome-terminal using a configuration file rather than command line arguments

I’ve found in the gnome-terminal help documentation a really cool list of things you can configure in a file but absolutely no documentation of what the variables in the conf file are. I’ve googled a bunch for this and haven’t found anything useful. Can someone point me to something or even list the actual commands. Or maybe come out and sit here at my desk and pair on it. My google-fu has failed me this morning. thanks

3 Answers 3

Also, gconf-editor stores it’s configurations for gnome-terminal in ~/.gconf/apps/gnome-terminal

On my Ubuntu 16.04 installation, there is no gnome-terminal directory within ~/.gconf/apps , although I changed the settings

You’re not just talking about using gconf-editor (from the System menu usually) are you?

Actually, gconf-editor needs to be started from a terminal on my Ubuntu system here, but there are a bunch of settings under gnome-terminal there.

I don’t seem to have gconf-editor on my centos installation. I wishwishwish I’d gone the Ubuntu route in the first place. I’ll look for the tool and try and get it installed. thanks!

OK that got me a long way. I still need to find a list of valid key/values but I bet my googlish skills can handle that. thanks and have a green checkmark!

GNOME Terminal has since changed how it stores its configuration; it now uses dconf , at least as of gnome-terminal 3.28.2 .

You can query the dconf database for the UUIDs of available Profiles using:

gsettings get org.gnome.Terminal.ProfilesList list 
['b1dcc9dd-5262-4d8d-a863-c897e6d979b9'] 

You can view all per-Profile configurable settings (called «keys» in dconf ) and their current values using:

gsettings list-recursively "org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:/:b1dcc9dd-5262-4d8d-a863-c897e6d979b9/" 
org.gnome.Terminal.Legacy.Profile audible-bell false org.gnome.Terminal.Legacy.Profile cursor-shape 'block' org.gnome.Terminal.Legacy.Profile cursor-colors-set true org.gnome.Terminal.Legacy.Profile scroll-on-keystroke true org.gnome.Terminal.Legacy.Profile cjk-utf8-ambiguous-width 'narrow' org.gnome.Terminal.Legacy.Profile default-size-rows 24 org.gnome.Terminal.Legacy.Profile encoding 'UTF-8' org.gnome.Terminal.Legacy.Profile use-theme-colors false org.gnome.Terminal.Legacy.Profile custom-command '' org.gnome.Terminal.Legacy.Profile visible-name 'Unnamed' org.gnome.Terminal.Legacy.Profile text-blink-mode 'always' . lots more . 

(tip: you can sort alphabetically by key if you pipe to sort , so modify your command to gsettings list-recursively «org.gnome. » | sort -k2 )

Читайте также:  Bond interface linux bonding

To set a key (e.g. audible-bell ), use:

gsettings set \ "org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:/:b1dcc9dd-5262-4d8d-a863-c897e6d979b9/" \ "audible-bell" \ false 

Check out this script in my GitHub dotfiles repo for a practical example. In that script, I create a Profile of my own (if it does not already exist), set that Profile as the default, then configure the keys for that Profile as well as some global keys that apply to all profiles.

Источник

Edit “bashrc” on Linux for Color Prompt

The bashrc file in Linux is a configuration file containing configurations related to the system’s terminal. This file is executed whenever you log into your Linux system. By making different changes to this file, you can easily customize your Linux terminal within seconds. This includes changing the color of the prompt, playing around with the fonts, changing the user names that appear on the terminal, etc. For this particular discussion, we are interested in finding out the method of editing the bashrc file for changing the color of the prompt in a Ubuntu 20.04 system.

Method of Editing “bashrc” for Changing the Color of the Prompt in Ubuntu 20.04:

Along with offering multiple other terminal customization options, the bashrc file in Linux can also be edited to change the prompt’s color. For learning the method of doing so, you will have to go through the subsequent steps. However, we would like to mention beforehand that in this method, we will first teach you how to create a backup of the default settings so that you can always restore them whenever you want. After that, we will share with you the method of changing the color of the prompt, and for that, we have shared quite a few examples so that you can see how the prompt will look like after changing its colors. Finally, we have taught you the method of restoring the default prompt color in Ubuntu 20.04. So now, let us get started with the following steps:

Step # 1: View the “bashrc” File on your Ubuntu 20.04 System:

The bashrc file can easily be viewed on a Ubuntu 20.04 system by using any text editor of your choice. Here, we are going to use the nano editor for this purpose, and we will open the bashrc file with the help of the command shown below:

The bashrc file of our Ubuntu 20.04 system is shown in the following image:

In this file, the section in which the attributes of the variable PS1 are defined is important for us. Basically, this variable allows you to customize your terminal in several different ways, along with changing the color of the prompt, which we will learn later in this article.

Читайте также:  Fsck astra linux восстановление

Step # 2: Take a Backup of the Relevant Variable of this File:

Now, for changing the color of the prompt in Ubuntu 20.04, we will be making some changes to the PS1 variable. However, before doing so, it is highly recommended that you take a backup of that variable so that if you mess up with anything during this whole process or even if you just want to go back to the default prompt color, you will easily be able to do that. For that, we will be copying the value of the PS1 variable to another variable. You can assign any name of your choice to this variable. The command shown below will serve this purpose:

This command will simply assign the default value of the PS1 variable to the TEMP variable, from where it can be restored later. This command will not generate any output upon successful execution.

Step # 3: Change the Color of your Ubuntu 20.04 Prompt from Green to Red:

Now, when we have taken a backup of our PS1 variable, we can easily change it to change the color of our Ubuntu 20.04 prompt. The default color of our Ubuntu 20.04 prompt is green. In this step, we will simply attempt to change this color to red. For that, we will execute the below-appended command:

Running this command in the Ubuntu 20.04 terminal will also reflect these changes in your bashrc file.

As soon as you hit the Enter key for running the command as mentioned above, you will notice the color of your system’s prompt changing from green to red, as shown in the image below:

Step # 4: Change the Color of your Ubuntu 20.04 Prompt from Red to Blue:

You have seen how you can change the color of your Ubuntu 20.04 system’s prompt from green to red. Now, you will see how you can change it from red to blue. For that, you will have to run the affixed command in your terminal:

Running this command in the Ubuntu 20.04 terminal will also reflect these changes in your bashrc file.

As soon as you hit the Enter key for running the command as mentioned above, you will notice the color of your system’s prompt changing from red to blue, as shown in the image below:

Step # 5: Change the Color of your Ubuntu 20.04 Prompt from Blue to White:

By now, you would have learned how to change the color of your Ubuntu 20.04 system’s prompt from green to red and red to blue. Now, you will see how you can change it from blue to white. For that, you will have to run the below-cited command in your terminal:

Читайте также:  X2go client astra linux

Running this command in the Ubuntu 20.04 terminal will also reflect these changes in your bashrc file.

As soon as you hit the Enter key for running the command as mentioned above, you will notice the color of your system’s prompt changing from blue to white, as shown in the image below:

Step # 6: Restore the Original Color of your Ubuntu 20.04 Prompt:

In the same manner, you can change the color of your prompt by using other different color codes too. So now, we will teach you how to restore the original color of your Ubuntu 20.04 prompt. You remember we saved the default value of the PS1 variable of our bashrc file to a variable named TEMP at the beginning of this method. The sole purpose of doing so was to create a backup of the default value of the PS1 variable so that it can be restored later. For doing that, you simply need to execute the below-appended command in the terminal:

Running this command in the Ubuntu 20.04 terminal will also reflect these changes in your bashrc file.

As soon as you hit the Enter key for running the command as mentioned above, you will notice the color of your system’s prompt changing from white to its default color, i.e., green, as shown in the image below:

Conclusion:

This article explained to you in detail how you can easily change the color of your Ubuntu 20.04 system’s prompt simply by making some minor changes to your bashrc file. By following the very same method, you can also experiment with different colors. However, the only thing you need to be careful about is before proceeding with changing the color of your prompt, and you must take a backup of the relevant variable of your bashrc file. This is done to ensure that you do not lose any important configurations, and you can always go back to the default configurations whenever you feel like it.

About the author

Aqsa Yasin

I am a self-motivated information technology professional with a passion for writing. I am a technical writer and love to write for all Linux flavors and Windows.

Источник

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