joplin-notes/_resources/dark theme i3.md
2026-11-04 00:33:23 +05:30

4 KiB

To set a global dark theme preference that modern Linux applications (GTK, Qt, Flatpaks, and Electron apps) automatically detect, you need to configure a few specific system flags. [1] Since you are running Cinnamon's underlying services alongside i3, applications look for XDG Desktop Portals, gsettings, and GTK/Qt system overrides to determine if the system is in dark mode. Here is how to set the global dark theme flags so your apps automatically adjust:

1. Set the Global XDG Desktop Portal Flag (Most Important)

Modern apps (including Flatpaks, Snap packages, Firefox, Chrome, and Electron apps) check the XDG Desktop Portal to see if the system prefers a dark layout. [2] Create or edit your local configuration file:

nano ~/.config/xdg-desktop-portal/settings.ini

Add the following lines to globally request dark appearance:

[org.freedesktop.appearance] color-scheme=1

(Note: 0 means default/no preference, 1 means prefer dark, and 2 means prefer light). [3, 4]

2. Update the GSettings Framework

Cinnamon and GNOME applications rely heavily on gsettings. Run these commands in your terminal to tell the system you prefer a dark color scheme and a dark GTK theme: [5, 6, 7]

Tells modern apps to prefer dark layouts

gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark'

Sets the standard theme variant to dark

gsettings set org.gnome.desktop.interface gtk-theme 'Adwaita-dark'

3. Configure the GTK 3 & 4 Config Files

Some standalone applications bypass GSettings and check configuration files directly. Ensure your GTK files explicitly mandate the dark variant. [8, 9] Open or create the GTK 3 configuration file:

nano ~/.config/gtk-3.0/settings.ini

Ensure it contains these exact lines:

[Settings] gtk-theme-name=Adwaita-dark gtk-application-prefer-dark-theme=1

Repeat this process for GTK 4 applications:

nano ~/.config/gtk-4.0/settings.ini

Ensure it contains:

[Settings] gtk-theme-name=Adwaita-dark gtk-application-prefer-dark-theme=1

4. Force Qt Apps to Mimic GTK

Qt-based applications (like VLC, KeepassXC, or qBittorrent) ignore GTK configurations by default. To force them to use your global GTK theme settings, add environmental variables to your profile. [10] Open your environment configuration:

sudo nano /etc/environment

Add these lines at the bottom:

QT_QPA_PLATFORMTHEME=gtk2 QT_STYLE_OVERRIDE=adwaita-dark

5. Apply the Changes

For these global flags to take full effect across all running daemons, save your files and restart your i3 session (press Mod+Shift+R or log out and log back in). [11] Once you log back in, your apps will read the active global flags and auto-adjust to their dark variants. If any specific application still refuses to flip over, let me know the name of the app or if it is installed as a Flatpak/Snap, and I can give you the target command to fix it!

[1] https://www.baeldung.com [2] https://www.reddit.com [3] https://discussion.fedoraproject.org [4] https://github.com [5] https://blog.elementary.io [6] https://www.reddit.com [7] https://github.com [8] https://github.com [9] https://orioninsist.medium.com [10] https://www.reddit.com [11] https://forum.manjaro.org