How can I change the font of the top bar without changing the shell theme?
You may create a custom css override in your home directory and load it from there (otherwise if you make any change in the theme's style sheet, any update of the theme will most probably overwrite it).
First you should know where the Adapta theme is located. If you have installed it from a .deb
package or a PPA it should be located at /usr/share/themes/Adapta
and there should be a gnome-shell.css
file in /usr/share/themes/Adapta/gnome-shell/
.
Now follow the steps below.
Create a directory, say
MyTheme
either in~/.themes
or in~/.local/share/themes
. (You may create~/.themes
or~/.local/share/themes
if they don't exist.)Create another directory inside
MyTheme
calledgnome-shell
.Create an empty document in this
gnome-shell
directory and name itgnome-shell.css
.Open this
gnome-shell.css
in a text editor and add the following lines@import url("/usr/share/themes/Adapta/gnome-shell/gnome-shell.css"); stage { font-family: FONT_NAME, Sans-Serif; font-size: 14pt; }
Change FONT_NAME
to a font of your choice (also you may change the font size) and save the file.
Open GNOME Tweak Tools and activate the User themes extension. (If the extension is not installed, you may install it from here.)
Go to Appearance section of Tweak Tools and click on the drop-down box next to "Shell theme". MyTheme should appear in the drop-down list. Select it.
Restart GNOME shell by typing alt+f2 then R+enter (works in an Xorg session, in Wayland logout and login again).
I have found the answer to my question! The most effective way to change the font of the top bar is to change the font families in the gnome-shell.css
file.
To do this, first use
sudo -H nautilus
to open a root version of Nautilus.
You will then want to navigate to /usr/share/themes/"THEME_NAME"/gnome-shell/gnome-shell.css/
.
Open the file and where it says something like
stage { font-size: 10pt; font-family: Roboto, Cantarell, Sans-Serif; font-weight: 400; color: #263238; }
change the first font to the name of your font. The result should be something like
stage { font-size: 10pt; font-family: Fira Sans, Cantarell, Sans-Serif; font-weight: 400; color: #263238; }
if you changed the font to Fira Sans.
Restart the shell using Alt+F2 and then type r
.
Doing this makes the themes you want have the fonts you want instead of changing to Adwaita.
Note: Updates to GTK Themes can mess up this configuration, so pomsky's answer has been marked as the best.