22

I like ambiance but i find it a little too hard on the eyes to have to edit files on a pure white background, like gedit's.

Is there any way to modify my theme to make gedit's background color darker?

16

As wojox said, you can change Gedit's theme.

The gtksourceview page on the Gnome website has more information about gedit themes. (Gtksourceview is the name of the software component that displays text in gedit.)

Modifying Existing Themes

To modify the built-in themes, copy them from /usr/share/gtksourceview-2.0/styles/ to ~/.local/share/gtksourceview-2.0/styles/ and edit the text files.

Finding New Themes

You can find several themes in this git repository. It looks like you can install them with:

sudo apt-get install git-core
git clone https://github.com/mig/gedit-themes.git ~/.gnome2/gedit/styles

(This will allow you to run cd ~/.gnome2/gedit/styles ; git pull to get updates to these themes.)

Building Your Own

You can also try this online theme generator. I found that on this article about creating gtksourceview themes.

3
  • Thank you , I'll try the git repo and the generator asap
    – Chriskin
    May 8 '11 at 0:24
  • +1. Informative + bonus mention of the theme generator. Thanks :D Jan 15 '15 at 17:44
  • for completition; here in fedora i found an additionally gedit-plugin package "gedit-plugin-colorschemer" which lets me edit a color scheme directly in gedit Aug 26 '17 at 8:37
11

Here are a few steps to change the GEdit background color.

  1. Click on Text editor in the right-top corner.

    Reference Image

  2. Click on Preferences.
  3. Select Fonts & Colors.
  4. Make the right choice (Cobalt is my favorite).

Note: You can use Customized Color Schemes also.

10

Open gedit and go to Edit > Preferences > Font&Color. You can change it there. You may need gedit-plugins installed.

1
  • 2
    how can i create a color scheme using colors of my choice; it has too few (and too ugly) choices there.
    – Chriskin
    May 7 '11 at 23:23
1

Unfortunately, Gedit doesn't let you change its current colors and save them as a new theme. I don't know why, as it seems pretty basic... Maybe the developers wanted to keep it as small and simple as possible.

Using the online theme generator is quite easy, though:

  1. Go to the Scribes Theme Generator and pick the colors you want. The on-screen example shows how your choices look.

  2. Click the "Generate" button to save your theme as an .xml file.

  3. In Gedit's Edit menu, click Preferences; then on the Font & Colors tab, click the Add button. A file window appears. Select your .xml file and click "Add Scheme". Your new colors are immediately applied.

1

Open the document classic.xml:

gksudo gedit /usr/share/gtksourceview-3.0/styles/classic.xml

Then You put the following just.

<!-- Global Settings -->
<style name="text" foreground="#black" background="#white"/>
<style name="selection" foreground="#white" background="#black"/>
<style name="cursor" foreground="#black"/>
<style name="current-line" background="#grey"/>
<style name="line-numbers" foreground="#grey" background="#white"/>
<style name="draw-spaces" foreground="#grey"/>
5
  • One does not use sudo for graphical applications. This might mess up some file permissions in your home directory. Use gksudo instead. I edited your answer.
    – Byte Commander
    Oct 5 '15 at 8:17
  • @ByteCommander I think gksudo is deprecated, I cannot use it.
    – knoftrix
    Apr 29 '19 at 20:02
  • 1
    True, things changed since 2015. You should be able to use gedit admin:///usr/share/gtksourceview-3.0/styles/classic.xml now instead. Or edit in the terminal with sudo nano /usr/share/gtksourceview-3.0/styles/classic.xml
    – Byte Commander
    Apr 29 '19 at 20:47
  • @SauravSingh use sudo -H instead of gksudo, ie sudo -H gedit /path/to/root-owned-file Apr 30 '19 at 1:20
  • The good thing with gedit admin:///$PATH is that it works on Wayland too.
    – knoftrix
    Apr 30 '19 at 3:24

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.