Matching Linux OS appearance themes

Organizing tasks to work on, New Features Ideas, Building LCS & LCB Libraries & Widgets, Redecorating and Modifying the IDE, Hacking / Editing Tools, Compiling the Engine from Source, etc.
Post Reply
User avatar
Posts: 1871
Joined: Sat Sep 11, 2021 4:19 pm

Matching Linux OS appearance themes

Post by OpenXTalkPaul »

Been do some casual researching on the system appearance theming aspects of the Linuxsphere lately.
I love that there are still OS'es that allow users to completely change the look and feel of the OS.
That said there are an insane amount of options for doing that with the many Linux distributions and UI packages available.
This makes it a real pain from a OXT dev perspective as there's no single reliable method for getting information about the current appearance.

Has no one written a library that supports them all in a way that abstracts all of the different settings file locations and various config tools that they all come with?
And how hard could it be to write such a library for use in OXT?

I just think we should have the ability to get some basic theme info, so we know what we're running on.
At a minmum I'd like to retrieve the following from the theme/appearance settings in use:
The default foregroundColor/textColor,
the default window or text area background color,
The text selection color,
and the focus border color.

I asked ChatGPT for help getting it started:

Code: Select all

Linux appearance themes

Linux offers a wide range of appearance themes, allowing users to customize their desktop environments to suit their preferences. Here are some popular themes and tools for tweaking the appearance on Linux:

GTK Themes: These themes affect the appearance of applications using the GTK toolkit. Popular GTK themes include Adwaita, Arc, Numix, and Breeze.
Icon Themes: Icon themes change the icons used throughout the desktop environment. Papirus, Numix Circle, and Adwaita are some well-known icon themes.
Desktop Environment Themes:
GNOME: GNOME Shell can be customized using extensions like Dash to Panel, Dash to Dock, and Arc Menu. offers various themes and extensions.
KDE Plasma: KDE offers extensive customization options. Users can change the theme, icons, widgets, and effects from the System Settings.
XFCE: XFCE allows customization through its Settings Manager. Users can change themes, icons, fonts, and more.
Window Managers:
Compiz: Known for its effects and window management options, Compiz Fusion provides themes and plugins for advanced desktop customization.
Openbox: This lightweight window manager allows extensive theming through XML-based configuration files.
Terminal Emulator Themes: Terminal appearance can be customized using tools like Oh My Zsh, Powerline, and various color schemes.
Cursor Themes: Users can change the mouse cursor theme using tools like xcursor-themes package and the cursor settings in their desktop environment.
Wallpapers: Linux distributions come with default wallpapers, but users can download and set custom wallpapers to personalize their desktops.
Customization Tools:
GNOME Tweaks: Allows fine-grained customization of GNOME Shell including themes, fonts, icons, and extensions.
KDE System Settings: Provides extensive customization options for KDE Plasma desktop.
lxappearance: A tool for setting GTK themes, icon themes, and font settings in LXDE and LXQt desktop environments.
Package Managers:
APT/DNF/Pacman: These package managers allow users to install themes and icon packs from repositories.
Flatpak/Snap: Some themes are available as Flatpak or Snap packages, making installation and management easier.
When installing themes or making significant changes to your desktop environment, it's a good idea to back up important files and configurations to avoid any potential issues.
I need a list of ALL of the file paths to all know Linux UI Widget kit's themes / appearance configuration files

Here are the common locations for Linux UI widget kit themes and appearance configuration files for various desktop environments:

GTK Themes:
Global Themes:
/usr/share/themes/: System-wide GTK themes installed for all users.
/usr/local/share/themes/: Locally installed GTK themes.
User-Specific Themes:
~/.themes/: GTK themes installed specifically for the current user.
Icon Themes:
Global Icon Themes:
/usr/share/icons/: System-wide icon themes installed for all users.
/usr/local/share/icons/: Locally installed icon themes.
User-Specific Icon Themes:
~/.icons/: Icon themes installed specifically for the current user.
GNOME Shell Themes:
Global GNOME Shell Themes:
/usr/share/gnome-shell/theme/: System-wide GNOME Shell themes.
User-Specific GNOME Shell Themes:
~/.local/share/themes/: GNOME Shell themes installed specifically for the current user.
KDE Plasma Themes:
Global KDE Plasma Themes:
/usr/share/plasma/look-and-feel/: System-wide KDE Plasma look and feel themes.
/usr/share/plasma/desktoptheme/: System-wide KDE Plasma desktop themes.
User-Specific KDE Plasma Themes:
~/.local/share/plasma/look-and-feel/: KDE Plasma look and feel themes for the current user.
~/.local/share/plasma/desktoptheme/: KDE Plasma desktop themes for the current user.
XFCE Themes:
Global XFCE Themes:
/usr/share/themes/: System-wide XFCE themes.
User-Specific XFCE Themes:
~/.themes/: XFCE themes installed specifically for the current user.
Cinnamon Themes:
Global Cinnamon Themes:
/usr/share/cinnamon/: System-wide Cinnamon themes.
User-Specific Cinnamon Themes:
~/.themes/: Cinnamon themes installed specifically for the current user.
MATE Themes:
Global MATE Themes:
/usr/share/themes/: System-wide MATE themes.
User-Specific MATE Themes:
~/.themes/: MATE themes installed specifically for the current user.
LXDE/LXQt Themes:
Global LXDE/LXQt Themes:
/usr/share/themes/: System-wide LXDE/LXQt themes.
User-Specific LXDE/LXQt Themes:
~/.themes/: LXDE/LXQt themes installed specifically for the current user.
Window Managers:
Compiz Themes:
/usr/share/compiz/: System-wide Compiz themes and configurations.
Openbox Themes:
~/.config/openbox/: Openbox themes and configurations for the current user.
Cursor Themes:
Global Cursor Themes:
/usr/share/icons/: System-wide cursor themes.
User-Specific Cursor Themes:
~/.icons/: Cursor themes installed specifically for the current user.
These paths may vary slightly depending on the Linux distribution and the version of the desktop environment. Always refer to the official documentation or community resources for precise details on theme installation and customization.
How can I programmatically get the OS selected theme on Linux 

You can programmatically retrieve the currently selected theme on Linux using different methods depending on the desktop environment or toolkit you are targeting. Here are a few approaches:

1. Using the GTK Toolkit (GNOME, XFCE, etc.)
If your target desktop environment uses GTK (like GNOME, XFCE, Budgie, etc.), you can use the gsettings command to get the currently selected GTK theme:


gsettings get org.gnome.desktop.interface gtk-theme
This command will output the name of the currently selected GTK theme.

2. Using the Qt Toolkit (KDE Plasma, LXQt, etc.)
For desktop environments using the Qt toolkit (like KDE Plasma, LXQt), you can use the qt5ct tool to get the currently selected Qt theme:


qt5ct --print-platformtheme
This command will print the currently selected Qt theme.

3. Using Environment Variables
Some desktop environments set environment variables related to the theme. For example, KDE Plasma sets the KDE_SESSION_VERSION variable, which includes theme information:

Copy code
4. Python Script (GTK)
You can also use Python with GTK bindings to programmatically retrieve the currently selected GTK theme:


import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk

settings = Gtk.Settings.get_default()
gtk_theme = settings.get_property('gtk-theme-name')
5. Desktop Environment Specific API
Some desktop environments may provide APIs or command-line tools specifically for querying the current theme. For example, KDE Plasma has kreadconfig5 command-line tool:


kreadconfig5 --file kdeglobals --group General --key ColorScheme
These methods should cover a wide range of desktop environments. However, it's important to note that Linux desktop environments are diverse, and there may be variations in how themes are managed and accessed programmatically.

ChatGPT can make mistakes. Consider checking important information.

User avatar
Posts: 1871
Joined: Sat Sep 11, 2021 4:19 pm

Re: Matching Linux OS appearance themes

Post by OpenXTalkPaul » ... plications

There are so many options in Linux world, I propose that we pick a few Linux distros or common packages that we want to concentrate on supporting?

Maybe 'the top ten downloaded distros'?

Like say yes going to support Xubuntu, but 'officially' not gping to worry too much about running on "Damn Small Linux"?
(just an example, I have nothing against DSL)...or for Desktops / window manager packages let's say 'we're going to support LXQt but not OpenBox' ?

Which Distros and Desktops do YOU guys use the most?
(since we are basically our own target audience here)

Is this the one CLI appearance setting tool to rule them all? ... ec/latest/
User avatar
Posts: 1871
Joined: Sat Sep 11, 2021 4:19 pm

Re: Matching Linux OS appearance themes

Post by OpenXTalkPaul »

Here are some command-line configuration tools that come with popular Linux desktop environments:

gsettings: Command-line tool for querying and modifying application settings managed by dconf. For example:
gsettings get org.gnome.desktop.interface gtk-theme

KDE Plasma:
kwriteconfig5: Command-line tool for reading and writing KDE configuration files. For example:
kwriteconfig5 --file kdeglobals --group General --key ColorScheme

xfconf-query: Command-line tool for querying and modifying XFCE settings. For example:
xfconf-query -c xfwm4 -p /general/theme -s "NewTheme"

gsettings: Similar to GNOME, Cinnamon also uses gsettings for configuring settings managed by dconf.
gsettings get org.cinnamon.desktop.interface gtk-theme

gsettings: MATE desktop also uses gsettings for configuration.
gsettings get org.mate.interface gtk-theme

lxqt-config: Command-line tool for LXQt settings.
lxqt-config --list-plugins

Note that there's only 4 CLI tools being used in the list above but covers 6 Desktop Environments.

It's easy to check for the existence of and get the path to any command line tools in most Unix-like OS:

Code: Select all

shell("command -v 'lxqt-config'") -- should return the path to lxqt-config if it's available.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest