Despite "Preferably none that take long to implement as I'm just familiarizing myself with Xubuntu.", here's a longish multi-step procedure. The procedure assumes you know which theme you're currently using and, for the purpose at hand, let's assume its name is DefaultTheme.
The default location for themes is /usr/share/themes
. This folder and its contents are not owned by you. So, if you make changes here, they will be lost in case of an update. A preferable way to play with themes is to install them in your home directory if you're getting them from elsewhere or copy them over from /usr/share/themes
if they already exist there. To copy them over, here's what you do:
- Open a terminal by pressing
Ctrl+Alt+T. You should normally be placed in your home directory. Otherwise, type
cd
and press Enter to get there.
- Type
mkdir .themes
and press Enter. The .
signifies a hidden file and is required.
- Type
cp /usr/share/themes/DefaultTheme ~/.themes
and press
Enter.
Type ls ~/.themes
and press
Enter to confirm that you've copied over the entire DefaultTheme folder to ~/.themes. Here, ~
is a shortcut that Ubuntu understands for /home/YourName
.
- Close the terminal.
At this point you should look at the contents of ~/.themes/DefaultTheme
in your file manager, Thunar, the default, or Nautilus or whatever. Most themes provided by default are quite complete and should contain, among others, folders called gtk-2.0
and gtk-3.0
. (gtk-3.0
is newer and shinier but gtk-2.0
lives on.)
Now, gedit
is a gtk-3.0
app. To change the appearance of its tabs, we need to edit a file called gtk-widgets.css
located in ~/.themes/DefaultTheme/gtk-3.0
. In other words, we want to edit ~/.themes/DefaultTheme/gtk-3.0/gtk-widgets.css
.
To do so, open this file with your preferred text editor.
Look for a section named somewhat like .notebook tab
because there maybe differences from theme to theme. If you find such a section, look within it for something like:
background-image: -gtk-gradient (linear, left top, left bottom,
from (shade (@bg_color, 0.97)),
color-stop (0.80, shade (@bg_color, 0.95)),
to (shade (@bg_color, 0.92)));
If you find this content and you understand how gradients work you could edit the above to suit your needs.
A simpler, probably less aesthetic way is to just replace the entire content with the following code:
background-color: #bbb
Save the file and close gedit. Log out of your session. Log back in and open gedit and see if you have decent contrast now: you should now have dark gray text on a light grey background. If you want the background even lighter, try #ccc
or #ddd
or even #fff
(for pure white).
Notes:
I've provided a similar answer here: gnome-terminal tabs are very dark, difficult to tell which tab is in use.
I'm providing this answer based on my past usage. I no longer use Xfce or gedit. If you find this answer doesn't work for you, let me know and I'll ask for it to be deleted.
On my machine it seems gedit keeps its newly added themes at:
~/.gnome2/gedit/styles/
though I believe on some installations it is at:
$HOME/.local/share/gedit/styles/
The original themes are (on my machine) at:
/usr/share/gtksourceview-2.0/styles/
So the information below isn't particularly relevant, though I'll let it stay because it might help in some way.
From the documentation at:
https://wiki.gnome.org/Projects/GtkSourceView/StyleSchemes
To install a style just place its XML file into a folder of the style search path.
GtkSourceView 2
A typical search path for GtkSourceView version 2 looks like:
~/.local/share/gtksourceview-2.0/styles/
/usr/share/gnome/gtksourceview-2.0/styles/
/usr/local/share/gtksourceview-2.0/styles/
/usr/share/gtksourceview-2.0/styles/
If this does not work in your distribution you can find out your style search path with this python script. To run it you need the python bindings for GtkSourceView 2. In Debian-based distributions this is package python-gtksourceview2.
GtkSourceView 3
A typical search path for GtkSourceView version 3 looks like
~/.local/share/gtksourceview-3.0/styles/
/usr/share/gnome/gtksourceview-3.0/styles/
/usr/local/share/gtksourceview-3.0/styles/
/usr/share/gtksourceview-3.0/styles/
Best Answer
I don't know how gedit handles syntax highlighting of extension-less files (there are questions about that: Can Gedit default highlighting style be set for files without an extension?), but there definitely is a plugin that handles modelines:
So, if you have a comment of the form in the first (or last) few lines:
It will use shell syntax highlighting, and with
ft=perl
, Perl syntax highlighting and so on.