1 Theme Files
liquibyte edited this page 2026-11-19 16:23:31 -06:00

Theme Files

Palette reads and writes the real files each toolkit and window manager uses. A theme is a folder, laid out like the themes in /usr/share/themes, so what you save is ready to install. This page describes the File menu, the file dialog, the theme folder, what each toolkit saves, and how Palette keeps the themes you open safe.

1. The File menu

The File menu

The File menu.

Command Key What it does
Open... Ctrl+O Opens a theme file into its toolkit and shows that toolkit (see the list of files below). A Kvantum .kvconfig opens its theme folder in the Qt 6 preview, with the Kvantum style. A Qt .qss style sheet is not a theme of its own: its rules are added to the Qt theme shown, as one Undo step; they are unsaved changes until you save. TQt 3 has no style sheets: while it is shown, the rules go to Qt 6, which is then shown.
Open Theme Folder... Ctrl+Shift+O Opens every toolkit's file found in a theme folder at once, its Kvantum/ theme too. A Kvantum theme's own folder opens as the Qt 6 theme, with the Kvantum style, in its own colors.
Import As... Reads the colors of another theme file into the toolkit shown: a GTK2 theme's colors into the Qt 5 palette, a KDE scheme into GTK3, and so on. It reads a gtkrc, a gtk.css, a qt5ct or qt6ct .conf or a KDE .colors file, and takes its eight base colors (the window, fields, buttons and the selection, each with its text). The toolkit's theme is then yours, no longer the file it was opened from. It is one Undo step, and undoing it brings back the file it was opened from too.
Save Ctrl+S Saves the toolkit shown where it was saved last, after asking. A theme that was never saved, or whose file is gone, goes to Save As instead.
Save As... Ctrl+Shift+S Saves the toolkit shown into a theme folder: you choose a folder and the theme's name (below).
Save All Saves every toolkit into the theme folder Save All or Save All As wrote last (or a folder Palette wrote that you opened with Open Theme Folder), after asking. Without one, it is Save All As.
Save All As... Saves every toolkit into a theme folder you choose.
Exit Quits, asking first about unsaved changes.

The Theme list in the Mockup header also opens the themes installed on your system; see The Mockup Preview. After each of these commands the status bar says what was opened or saved, and where, or why it was not.

The files Open reads

File Toolkit
gtkrc (or a .rc file) GTK2
gtk.css GTK3 or GTK4, by its folder (gtk-3.x or gtk-4.x); otherwise GTK4 when GTK4 is shown, else GTK3
TQt's qtrc, a TDE color scheme (.kcsrc) TQt 3
Trolltech.conf Qt 4
A qt5ct or qt6ct palette (.conf) Qt 5 or Qt 6, by its folder or by how many colors it lists
A KDE color scheme (.colors), a Qt style sheet (.qss) The Qt 4 or Qt 5 shown, else Qt 6
An xtk theme (.conf with a [colors] or [theme] section) xtk
An Openbox themerc, a Fluxbox theme.cfg or style, a Blackbox style Window Manager, with the Engine set to that window manager
A Kvantum .kvconfig in its theme's folder Qt 6, with Kvantum

A file with another name is recognized by what is in it. A file that is none of these is refused, and the status bar says so.

2. The file dialog

Every file dialog in Palette is the same: a sidebar of places on the left, the path as clickable parts along the top, and the folder's files in columns.

  • The sidebar lists Home, Desktop, Documents, Downloads, Music, Pictures, Videos and File System, and your favorites under them. A right-click in the file list offers Add to Favorites, which adds the folder shown; a right-click on a favorite offers Remove from Favorites. Up to 8 favorites are kept.
  • A right-click in the file list also offers Show Hidden Files and the Size Column, Type Column and Modified Column to show or hide. A click on a column's header sorts by it; a second click reverses the order.
  • The file type drop-down chooses which files are shown: All Files, or one kind of theme file. Open starts with Theme files, which shows every file it reads by its name: gtkrc, .rc, .css, .conf, .colors, .kvconfig, .qss, .kcsrc, qtrc, themerc and theme.cfg files. A Blackbox or Fluxbox style can have any name: to open one, choose All Files. Import As starts with the files it reads: gtkrc, .rc, .css, .conf and .colors.
  • New Folder (or Ctrl+Shift+N) makes a folder where you are: type its name and press Enter, or Escape to give up.
  • Double-click a folder to go into it, or a file to choose it. A folder that cannot be opened is not entered: the dialog stays where it was and says "Couldn't open" with the reason.
  • OK with no file chosen leaves the dialog open and says "Select a file".
Key What it does
Ctrl+L Type a path. Enter goes to that folder; in an Open dialog, a file's full path chooses that file. Escape stops typing.
Ctrl+H Show or hide hidden files.
Up, Down, Home, End, Page Up, Page Down Move the selection in the file list.
Enter Go into the selected folder, or choose the selected file.
Escape Cancel the dialog.

The dialog remembers your favorites, whether hidden files are shown, which columns are shown and how wide they are, and the sort, in ~/.config/palette/file_dialog.txt. Every file dialog in Palette shares them, also after a restart. The next dialog starts in the folder the last one was in.

3. Save As: a folder and a name

Save As asks for two things in one dialog: a folder, and the theme's name, typed in Theme name. Palette then makes the theme's folder, <folder>/<Name>, unless the folder you chose already has the theme's name; then it uses that folder. In it go index.theme and the toolkit's own folder (gtk-3.0/gtk.css, qt5/<Name>.conf and so on). Another toolkit saved under the same name later adds its folder beside the others.

  • The dialog starts beside the theme folder you saved last, or in ~/.themes, or in your home folder when there is none. It never starts in a system folder such as /usr/share/themes, where you could not write.
  • The name it suggests is the theme's own name, or the Kvantum theme's, or "Palette".
  • Saving over a theme Palette saved before asks first (Replace or Cancel).
  • Palette never writes into a theme folder it did not make: it says so and asks you to choose another name.

Besides the toolkit's own file, Save As writes:

  • For a Qt toolkit showing a Kvantum theme, that Kvantum theme in Kvantum/.
  • For Qt 4, Qt 5 and Qt 6, the KDE color scheme color-schemes/<Name>.colors, when the theme has KDE color sets or came from a .colors file.
  • For Qt 4, Qt 5 and Qt 6, the Style panel's style sheet rules, when there are any, beside the Qt file with the same name and .qss (qt5/<Name>.qss, qt4/Trolltech.qss).
  • For GTK2, the images of gradient backgrounds, beside the gtkrc that names them.
  • For the Window Manager, the theme for all three window managers (see Window Manager Themes).

Save writes the same files again, into the same folder, after asking "Save over the ... theme saved in ...?".

4. The theme folder

Save All As into a folder named, say, MyTheme writes every toolkit:

The theme folder Save All As writes: index.theme, the GTK2, GTK3 and GTK4 folders, qt3, qt4, qt5 and qt6, color-schemes, Kvantum, xtk, and the Openbox, Blackbox and Fluxbox folders, each with the toolkit's file

The theme folder that Save All As writes. Save As writes index.theme and one toolkit's part of it.

The folder's name is the theme's name. A Qt theme's style sheet goes beside its file as .qss when the Style panel has set any rules. Save All writes the Kvantum theme of the Qt 6 preview, or else the Qt 5 preview's, or else the Qt 4 preview's, and the KDE color scheme from the Qt 6 theme, or from an older Qt version's when only that one was opened from a .colors file. Only the variant you worked on is saved: a Kvantum theme's dark variant (<Name>Dark.kvconfig) is not carried along.

When you edited an opened theme, the rest of that theme's folder, its images, included files, GNOME Shell theme and so on, is copied along into the new folder first, untouched.

Installing a saved theme

Palette does not install anything by itself. To use a theme saved in ~/.themes:

  • GTK2, GTK3, GTK4: the folder in ~/.themes is where GTK finds it; choose it in your desktop's appearance settings.
  • KDE: copy color-schemes/MyTheme.colors to ~/.local/share/color-schemes.
  • qt5ct, qt6ct: copy the .conf files to ~/.config/qt5ct/colors and ~/.config/qt6ct/colors.
  • Qt 4: qt4/Trolltech.conf is what qtconfig writes as ~/.config/Trolltech.conf.
  • TQt 3: qt3/qtrc is what TDE writes as ~/.qt/qtrc.
  • Kvantum finds a theme folder's Kvantum/ in ~/.themes by itself.
  • xtk: programs built on xtk find a theme folder's xtk/ in ~/.themes by themselves; see xtk Themes.
  • Openbox finds openbox-3/ in ~/.themes. Fluxbox and Blackbox styles go into ~/.fluxbox/styles and ~/.blackbox/styles; see Window Manager Themes.

5. Which folder, and bundled themes

A theme can have several GTK3 folders. Palette opens the one GTK itself uses: the newest of gtk-3.24, gtk-3.22 and so on down to gtk-3.14, then gtk-3.0. For GTK4 it is the newest of gtk-4.18 down to gtk-4.0.

Open Theme Folder also takes a toolkit's own folder chosen directly (a gtk-3.0 folder, a folder of .colors files, an openbox-3 folder, a Fluxbox style's folder). For Qt 5 and Qt 6 it takes qt5/ and qt6/, then qt5ct/colors/ and qt6ct/colors/, then color-schemes/; where a folder has several files, the first in alphabetical order.

Some themes keep their stylesheets in a gtk.gresource bundle, and their gtk.css only imports resource:///... paths. Palette unpacks the bundle into a plain copy of the folder in ~/.cache/palette/gresource/<Theme>/, with each reference made a relative path. The copy is what the preview shows and what Save As writes, so a saved theme is plain files. The installed theme is not touched. (GTK reads the plain files just as well; GLib's glib-compile-resources makes a bundle again if you want one.)

6. Kvantum themes

With Kvantum showing a theme, saving a Qt toolkit writes a Kvantum theme of your own into the theme folder's Kvantum/:

MyTheme/Kvantum/
  MyTheme.kvconfig   the theme's kvconfig, with your colors in their keys
  MyTheme.svg        the theme's SVG, with your colors in place of its own

Everything you did not change stays as the theme has it, byte for byte. Kvantum finds it in ~/.themes, and File > Open Theme Folder on MyTheme opens it again as the Qt theme's Kvantum theme. A Kvantum theme opened on its own (a .kvconfig or its folder) that Palette wrote is saved into its own folder again by Save; one Palette did not write is never written to.

A Qt theme saved by Save into a single file outside a theme folder does not carry its Kvantum colors; the status bar then says that Save As saves them too, in a theme folder.

7. Opened themes are never overwritten

A theme Palette did not write, an installed theme or one you downloaded, is never written to. It is loaded as it is, with your edits on top, and saving writes your own copy:

  • GTK2, GTK3 and GTK4: your file includes the original and adds only what you changed, so the theme's own look, its engine, images and every rule, stays.
  • KDE .colors: your changes are merged into a copy of the scheme, which keeps every set and key it has.
  • Kvantum: your copy is a new Kvantum theme, its kvconfig with your colors in their keys and its SVG with your colors in place.
  • Saving into the opened theme's own folder is refused, unless Palette wrote it.

Every file Palette writes, except an xtk theme and a .qss style sheet, ends with a small comment block that records your edits exactly, so that opening it again gives back exactly what you saved, and that marks it as Palette's own, which Save may write over. (An xtk theme holds every key itself, and counts as Palette's own when it is in a theme folder whose index.theme Palette wrote.) A Kvantum kvconfig Palette wrote ends with ; Written by palette.

8. Unsaved changes

Palette asks before it throws away edits: when you open another theme over them, choose a preset or an installed theme, use Import As or Apply To, or quit. Its question offers Save, Discard and Cancel. Only real edits count, the colors and every property set in the Style panel (effects, style sheet rules, a window manager's textures and fonts): choosing a preset, an engine or a style is not an edit, and undoing back to what was saved makes the theme count as saved again. The Theme list shows "(edited)" after the name of a theme with unsaved changes.

Undo (Ctrl+Z) and Redo (Ctrl+Shift+Z or Ctrl+Y) keep one history for all the toolkits together, 32 steps deep. Each step holds every toolkit's colors, so after you switch to another toolkit, Undo still takes back the last edit, even when you made it in the toolkit you left; that toolkit changes back without being shown. Undo and Redo never change the engine or style chosen. Undoing an Import As, a Reset or an Apply To gives back the colors and the theme file the toolkit was opened from, so Save writes where it did before.

9. What each toolkit saves

Toolkit File What is in it
GTK2 gtkrc The grid's colors, the engine and its settings, GTK2's style properties, widget class colors and background images.
GTK3, GTK4 gtk.css The theme's color variables, every zone colored on its own, the other properties (shadows, borders, filters and so on), GTK3's settings, the KDE effects, and the dark variant if it was chosen.
TQt 3 qtrc (or a .kcsrc Palette wrote) The full palette and the style.
Qt 4 Trolltech.conf The full palette and the style.
Qt 5, Qt 6 .conf The full palette, every group and role, in the qt5ct and qt6ct format.
KDE .colors Every color set, the effect colors, the window title colors, the frame contrast and the inactive and disabled effects.
Qt 4, Qt 5, Qt 6 .qss The style sheet rules set in the Style panel.
Kvantum .kvconfig, .svg The theme's own files, with the colors dropped on them.
xtk .conf The 17 roles and every widget key (those you colored on their own as you set them, the rest as the roles give them), gradients and bevels; see xtk Themes.
Window Manager themerc, a Blackbox style, theme.cfg Every part's colors and textures, the sizes, justify and fonts, and the theme's images; see Window Manager Themes.

10. Remembered between runs

Palette remembers the files you opened and saved, each toolkit's preset, engine and style with their settings, and your edits, so it starts where you left off. A theme whose file has gone since is still shown, as "(file gone)" in the Theme list; Save As writes it again. See Tips and Troubleshooting for where all this is kept.