- How to change terminal background picture on Ubuntu 18.04?
- 2 Answers 2
- How to Change Color of Ubuntu Terminal
- Changing the color of your Ubuntu terminal
- Other ways to change the terminal color
- Change the theme
- Change terminal color based on your wallpaper
- More Customization Options for Your Terminal
- Change the background color in Gnome terminal through a command?
- 11 Answers 11
How to change terminal background picture on Ubuntu 18.04?
I want to change terminal background on my Ubuntu 18.04
There was an option in Ubuntu 14.04 where you can go to edit > profile preference where you can change the background picture of terminal. But I can’t find this on Ubuntu 18.04.
gnome-terminal no longer supports the background. However, I just looked at xfce4-terminal and it does support it. So, it all depends on what terminal you want to use for background support.
2 Answers 2
Sadly, this option no longer exists. See Bug 698544:
- Comment 1 (2013-04-22) is Christian Persch’s (rather incomplete) answer to the bug report.
I’ve spoken to Christian and he has filled me in on the background to this issue. The ability to set background transparency was removed as a part of a much larger clean up of the gnome-terminal code base. This modernisation effort is much needed and it should be remembered that the terminal has an old and complicated code base. Background transparency was also known to cause a range of performance issues, including slowness and memory leaks. Given the number of active terminal developers, the need to clean up the code base and known bugs with background transparency, it was decided that the resources were not available to maintain background transparency and keep the quality to the required level. We understand that some users are disappointed by the disappearance of this feature, and we hope that they understand that this decision was made to enable other improvements to the terminal code, and that it will lead to other improvements in the long run. While Christian’s initial response could have been better, he has responded in detail in private mail and I suspect that he was simply tired of the issue.
** This answer makes Persch sound like an arsehole, but that is not my intention. Read Day’s last sentence for context.
How to Change Color of Ubuntu Terminal
The default terminal looks good enough if you want to get things done.
But, if you want a unique terminal experience or something that suits your taste, you can also change the color of your Ubuntu terminal.
In this quick tutorial, I shall focus on tweaking the color scheme of the terminal in Ubuntu. Ubuntu uses GNOME Terminal so the steps should be valid for most other distributions using GNOME desktop environment.
Changing the color of your Ubuntu terminal
The steps are similar to how you change the font and size of the terminal. You have to find the option for customizing colors, that’s it.
Let me quickly highlight what you need to go through to find it:
Step 1. Open the terminal window in Ubuntu by pressing Ctrl+Alt+T.
Step 2. Head to the terminal preferences. You can click on the menu button to access the Preferences or right-click anywhere on the terminal screen.
It will be a good idea to create a separate profile for your customization so that the default settings do not change.
Step 3. Now, you can find the options to tweak the font size and style. But, here, you need to head to the “Colors” tab, as shown in the screenshot below.
Step 4. By default, you will notice that it uses colors from the system theme. If you want to blend in with your system theme, that should be the preferred choice.
But, if you want to customize, you need to deselect the option and then start choosing the colors.
As you can notice in the screenshot above, you can choose to use some of the built-in color schemes and also get to customize them to your liking by changing the default color option for the text and background.
You can customize every aspect of the terminal screen color, starting from the texts to the cursor, if you select a “custom” built-in scheme.
Again! Create separate profiles if you want to access different customized versions of the terminal quickly or else you will end up customizing every time you want a specific color combination.
Other ways to change the terminal color
Here are a couple of other ways to change the terminal color in Ubuntu:
Change the theme
Most Ubuntu themes have their own implementation of terminal colors and some of them actually look very nice. Here is how the terminal color scheme is changed for Ant and Orchis themes.
You choose a dark theme and your terminal turns black. No need to wonder about selecting color schemes.
Change terminal color based on your wallpaper
If you do not want to customize the colors of your terminal manually, you can utilize Pywal. With this handy Python tool, you can change the color scheme of your terminal as per your wallpaper.
It will automatically adapt to any of your active wallpapers. So, you do not have to bother customizing the terminal.
More Customization Options for Your Terminal
If you are more of a tinkerer, you would love to know that you have more options to customize the look of the terminal. You can read through our resource on different ways to tweak the look of the terminal to explore more about it.
How do you prefer to customize the terminal? Let me know your experiences in the comments below!
Change the background color in Gnome terminal through a command?
I’m using Gnome terminal and I want to change the background color or the profile through a command so I can group some commands in an alias to visually differentiate my windows when I run certain processes. I’m running Ubuntu, and bash is my shell. Are there commands in to do this?
11 Answers 11
you can use setterm like this
setterm -term linux -back blue -fore white -clear
This does not have the desired effect in bash. What happens is that the background color is temporarily set to blue and all text is cleared (not what I intended btw), but then as soon as you start to type something or a prompt is printed, the background color of the new text becomes whatever the background color was before running the command.
Assuming you know what profile you want before you open your terminal:
Right-click on your Panel and «Add to Panel» and add a custom application launcher
You can define position, size and profile (which takes care of colours, fonts, etc)
gnome-terminal --hide-menubar --geometry 115x40+0+0 gnome-terminal --window-with-profile=logs --hide-menubar --geometry=144x15+0-55
«man gnome-terminal» has lots of useful information
try the following command from a desktop launcher:
gnome-terminal --window-with-profile=site2 -x ssh site2
Using -x ssh means that the terminal will only be active on the remote site, so completely removing the possibility of typing a command on the wrong machine because you’ve exited from a terminal command line ssh.
In the gnome terminal on ubuntu 20lts you can run a command like:
where aa, bb, cc are hexadecimal numbers from 0 to 255.
If you wish to change the foreground color, use \e]10; instead of \e]11;
To get the correct color commands you can use the color pickers in the snippet below.
let bg = document.getElementById('bg'); let fg = document.getElementById('fg'); let binp = document.getElementById('numberbg'); let finp = document.getElementById('numberfg'); binp.addEventListener('input', (e) => < let val = spl(e); bg.innerText = "echo -e '\\e]11;rgb:"+val+"\\a'"; up(bg); up(fg); >); finp.addEventListener('input', (e) => < let val = spl(e);; fg.innerText = "echo -e '\\e]10;rgb:"+val+"\\a'"; up(bg); up(fg); >); function spl(e) < return e.target.value.substring(1).match(/./g).join('/'); > function up(i)
echo -e '\e]11;rgb:00/00/00\a'
echo -e '\e]10;rgb:ee/ee/ee\a'
You want to use gconftool.
Gnome holds its settings in a hierarchy similar to the Windows Registry. Once you know the path to the item you want to change you can set that item’s value with gconftool from the command line.
Use gconf-editor to browse through the Gnome settings.
Use gconftool to set the value of an item in your script.
In your case, you want to do the following:
gconftool --type string --set /desktop/gnome/background/primary_color "#dadab0b08282"
Obviously you’ll want to replace that color value with whatever color you want.
upvote for pointing me in the right direction, but OP is asking for the gnome terminal — gconftool —type bool —set /apps/gnome-terminal/profiles/Default/use_theme_colors false gets rid of the hideous purple background
1) Create a terminal profile with the color and settings you desire, and call it «myGterm»
2) Edit your .bashrc file.
3) Add the following line:
alias Gterm='gnome-terminal --window-with-profile=myGterm'
4) Save and close .bashrc
5) Open a terminal and type:
I looked into it and it turns out this is not possible. I filed bug: http://bugzilla.gnome.org/show_bug.cgi?id=569869
gconftool-2 can get/set profile properties, but there is no way to script an existing, open gnome-terminal.
To create 4 terminals with different backgrounds and titles you need to add the below lines to the .bashrc_profile file
add the below lines to file
alias term1='gnome-terminal –window-with-profile=term1' alias term2='gnome-terminal –window-with-profile=term2' alias term3='gnome-terminal –window-with-profile=term3' alias term4='gnome-terminal –window-with-profile=term4'
- Now edit / create your 4 terminal profiles
- open > terminal > edit > profiles > new > profile name = term1
- colors tab > choose your font and background colors
- Title and Command tab > initial title = term1
- repeat the above commands for 3 remaining terminals.
close any open terminals you may have then re-open a new terminal and type ‘term1’ hit enter and repeat for all 4 now you have 4 unique terminals open!
before the option «window-with-profile» there must be a double minus. For me it only works with: alias term1=’gnome-terminal —window-with-profile=term1′
You don’t have to do this via command you can go to Edit>>Preferences>>color to change it.
I used to do this with command line arguments to xterm. I set up my .olvwm (am I dating myself) to execute 4 xterms with different background colours.
i have created some functions, based on github code from other threads. Sorry i don’t remember.
You can put these functions in your ~/.bashrc file
As you can see, if you call «create_random_profile»,
First, it will check and delte any previous random profile you have created.
Second, it will create a random name profile in gnome terminals.
Third, it will set that name in an environment variable that you can use to change your color in predefined functions. See last function function setcolord().
This should be useful, to have many terminals with different colors. Besides, with predefined functions you can change these colors on the fly. Enjoy it!
function create_random_profile() < #delete previous profiles in case there were something #delete_one_random_profile prof="`mktemp -u HACK_PROFILE_XXXXXXXXXX`" gconftool-2 --type list --list-type string --set $prof_list "`gconftool-2 --get $prof_list | sed "s/]/,$prof]/"`" file="`mktemp`" gconftool-2 --dump "/apps/gnome-terminal/profiles/Default" | sed "s,profiles/$2,profiles/$prof,g" >"$file" gconftool-2 --load "$file" gconftool-2 --type string --set "/apps/gnome-terminal/profiles/$prof/visible_name" "$prof" gconftool-2 --set "/apps/gnome-terminal/profiles/$prof/use_theme_colors" --type bool false rm -f -- "$file" export __TERM_PROF=$prof > function delete_one_random_profile() < regular="HACK_PROFILE_" prof=$(gconftool-2 --get /apps/gnome-terminal/global/profile_list | sed -n "s/.*\(HACK_PROFILE_. \).*/\1/p") if [ ! -z "$prof"]; then echo "size $" echo "size of regular $" echo "DO DELETE of $prof" #if not empty gconftool-2 --type list --list-type string --set $prof_list "`gconftool-2 --get $prof_list | sed "s/$prof//;s/\[,/[/;s/,,/,/;s/,]/]/"`" gconftool-2 --unset "/apps/gnome-terminal/profiles/$prof" else echo "NOTHING TO DELETE" fi > function setcolord() < echo "Dont forget to change to Profile0 in the menu of your terminal->Change Profile->Profile_0" gconftool-2 --set "/apps/gnome-terminal/profiles/$__TERM_PROF/background_color" --type string white gconftool-2 --set "/apps/gnome-terminal/profiles/$__TERM_PROF/foreground_color" --type string black > function setcolor_cyan() < echo "Dont forget to change to $__TERM_PROF in the menu of your terminal->Change Profile->Profile_0" gconftool-2 --set "/apps/gnome-terminal/profiles/$__TERM_PROF/background_color" --type string "#8DCBCC" gconftool-2 --set "/apps/gnome-terminal/profiles/$__TERM_PROF/foreground_color" --type string black >
By the way you can save time if you create the terminal using already the random. You can do that calling:
gnome-terminal --working-directory=$HOME --window-with-profile="$prof"