I have changed the setting in my ubuntu desktop 16.04 to boot only on command line mode. Upon reboot, the interface that opened had black background, text in white, directories in blue and so on and so forth...normal terminal color options.

I am trying to change the background color to white and text to black so that the visibility of the content is better. I used the following code (taken from this post):

dconf write /org/gnome/terminal/legacy/profiles:/:b1dcc9dd-5262-4d8d-a863-c897e6d979b9/background-color "'rgb(0,0,255)'"

But got an error

error: Cannot autolaunch D-Bus without X11 display
    dconf write KEY VALUE

Write a new value to a key

    KEY   A key path (starting, but not ending with '/')
    VALUE The value to write (in GVariant format)

I understand the error related to X11 display. However, the rest I could not. How to I set the background to white / blue(in the above case it is blue) and text to black

  • Possible duplicate of How can I customize a full-screen console background (TTY)?
    – Olorin
    Jan 17, 2019 at 5:16
  • 1
    Booting to command-line only mode, you are not using GNOME Terminal (which this method is for), but the TTY (see dupe).
    – Olorin
    Jan 17, 2019 at 5:16
  • On second thought, a better dupe would be Changing colour of text and background of terminal?
    – Olorin
    Jan 17, 2019 at 5:26
  • @Olorin Thank you...I have already tried those links....esp the second one...the setterm works weirdly...when I set the background color to white...on keyboard enter, I get to see the white background...however if i type ls the contents gets displayed with black background only....hence the question. The gconftool is not working nor provides any output
    – Apricot
    Jan 17, 2019 at 5:53
  • 1
    Hmm, that would be because the escape sequences output by ls include code to reset the color. How about echo -en '\e]P0FFFFFF' '\e]PF000000'? This changes what the TTY "thinks" black and white are (the first sets black, aka colour 0 to FFFFFF, and the second sets white (colour F) to 000000. From askubuntu.com/a/153493/760903
    – Olorin
    Jan 17, 2019 at 6:14

1 Answer 1


One thing you can try is to change the palette of the terminal (i.e., change the definitions of the colours). For example:

echo -en '\e]P0FFFFFF' '\e]PF000000'

This changes what the TTY "thinks" black and white are (the first sets black, aka colour 0 to FFFFFF (hex for white), and the second sets white (colour F) to 000000 (hex for black). So when some command (like ls, for example), sends the escape code to set background to "white", it will actually be set to black, and so on.

See this answer for the full list of colours.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.