omarchy icon indicating copy to clipboard operation
omarchy copied to clipboard

Automatically update Nautilus gtk.css on theme switch or installation

Open HANCORE-linux opened this issue 1 year ago • 4 comments

What do you need?

Description: Nautilus does not currently refresh its gtk.css automatically when a new theme is installed or when switching between themes. This enhancement proposes adding a small script integration to ensure that Nautilus always reflects the selected theme immediately

Suggested solution: Add a call to omarchy-theme-set-nautilus in:

~/.local/share/omarchy/bin/omarchy-theme-set
omarchy-theme-set-nautilus

Then add the script omarchy-theme-set-nautilus in:

~/.local/share/omarchy/bin/ 

Script:

#!/bin/bash

# This script applies the Omarchy GTK theme to Nautilus.

# Source and destination paths
SOURCE_THEME="$HOME/.config/omarchy/current/theme/gtk.css"
DEST_GTK4_DIR="$HOME/.config/gtk-4.0"
DEST_THEME="$DEST_GTK4_DIR/gtk.css"

# Create the GTK-4.0 directory if it doesn't exist
mkdir -p "$DEST_GTK4_DIR"

# Copy the theme file
if [ -f "$SOURCE_THEME" ]; then
    cp "$SOURCE_THEME" "$DEST_THEME"
    echo "Theme copied successfully."
else
    echo "Source theme file not found: $SOURCE_THEME"
    exit 1
fi

# Restart Nautilus to apply the changes
pkill nautilus
echo "Nautilus restarted."

This script makes sure Nautilus updates its gtk.css automatically after each theme switch or installation.

Credits: Solution tested and provided by Michael91 (Discord: Michael91#9276)

https://github.com/user-attachments/assets/e86293ff-abda-4294-be1f-2c932374d894

HANCORE-linux avatar Oct 25 '25 21:10 HANCORE-linux

is this only for nautilus

Rishabh-Sarang avatar Oct 30 '25 07:10 Rishabh-Sarang

Yes , it only changes gtk Theme

HANCORE-linux avatar Oct 30 '25 18:10 HANCORE-linux

You can close it since we have the theme-hook script from bypass

HANCORE-linux avatar Nov 21 '25 08:11 HANCORE-linux

do you have omarchy default theme for gtk?

Rishabh-Sarang avatar Nov 21 '25 09:11 Rishabh-Sarang