Skip to content

Instantly share code, notes, and snippets.

@ironlungx
Created November 1, 2024 15:11
Show Gist options
  • Save ironlungx/06563b00a85d20bab91d1bf99934d038 to your computer and use it in GitHub Desktop.
Save ironlungx/06563b00a85d20bab91d1bf99934d038 to your computer and use it in GitHub Desktop.
X11 GTK Theme and Cursor Theme, in a window manager

I daily drive XMonad on my Arch linux distro. For like 7 months, I had no idea how to change the GTK themes & cursor themes without using programs like lxappearance Even when I used lxappearance, it was very buggy and a bad experience in general. I will be explaining how to do all that with minimal dependencies.

Set the GTK Theme

I am assumiming that you use .xinitrc to login, even if you don't you can still follow along. All GTK applications get their theme from an environment variable GTK_THEME. You can just add a line in your .xinitrc

export GTK_THEME=catppuccin-frappe-lavender-standard+default   # This is the line
exec xmonad

Now to get the theme name. Almost all thems you install with you package manager are in /usr/share/themes Each theme has it's own subfolder and an index.theme file in that folder

/usr/share/themes/
    |- Theme 1
        |- index.theme
    |- Theme 2
        |- index.theme

the index.theme looks like this:

[Desktop Entry]
Type=X-GNOME-Metatheme
Name=catppuccin-frappe-lavender-standard+default
Comment=An Flat Gtk+ theme based on Elegant Design
Encoding=UTF-8

[X-GNOME-Metatheme]
GtkTheme=catppuccin-frappe-lavender-standard+default
MetacityTheme=catppuccin-frappe-lavender-standard+default
IconTheme=Tela-circle-Dark
CursorTheme=Frappé-cursors
ButtonLayout=close,minimize,maximize:menu

We are interested in Desktop Entry.Name which is catppuccin-frappe-lavender-standard+default

Just put that as the value for the env. variable GTK_THEME

CursorTheme

To change the cursor theme, create a file ~/.Xresources with contents:

Xcursor.theme: Bibata-Modern-Ice
Xcursor.size: 22

All the cursor themes are stored in /usr/share/icons/ Each cursor has it's own subfolder

/usr/share/icons/
    |- CursorTheme 1
        |- index.theme
    |- CursorTheme 2
        |- index.theme

the index.theme file looks something like this:

[Icon Theme]
Name=Bibata-Modern-Ice
Comment=White and rounded edge Bibata (v2.0.6). XCursors
Inherits="hicolor"

We are interested in Icon Theme.Name which is Bibata-Modern-Ice in this case.

Just put that as the Xcursor.theme

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment