Change your desktop theme instantly with interactive or command-line tools
The Kanagawa dotfiles provide two scripts for switching themes: theme-selector for interactive selection and theme-switcher for the actual theme application.
The theme-selector script provides a graphical menu using Wofi (dmenu for Wayland):
#!/bin/bash# Definimos la lista de temas disponiblesTEMAS="kanagawa\ngruvbox\ncatppuccin\neverforest"# Lanzamos Wofi y guardamos la elecciΓ³n del usuario en una variableELECCION=$(echo -e "$TEMAS" | wofi --dmenu --prompt "π¨ Elige un tema:" --width 250 --height 350)# Si el usuario eligiΓ³ algo (es decir, no pulsΓ³ Escape), ejecutamos set-themeif [ -n "$ELECCION" ]; then ~/.local/bin/theme-switcher "$ELECCION"fi
What it does:
Defines available themes
Launches Wofi with a menu prompt
Passes the selected theme to theme-switcher
Does nothing if ESC is pressed
Bind this script to a keyboard shortcut in your Hyprland config for quick theme switching!
The theme-switcher script is the workhorse that actually applies themes across all applications. Hereβs how it works:
1
Validate theme input
Checks if a theme name was provided and validates it against known themes.
if [ -z "$THEME" ]; then echo "β Error: No has especificado ningΓΊn tema." echo "π‘ Uso: set-theme <kanagawa|gruvbox|catppuccin>" exit 1fi
2
Update CSS-based applications
Updates Waybar and Wofi by writing import statements with absolute paths.
# Usamos rutas absolutas para que GTK3 no se pierda nuncaecho "@import url(\"$HOME/.config/wofi/colors/custom/$THEME.css\");" >"$HOME/.config/wofi/colors/colors.css"echo "@import url(\"$HOME/.config/waybar/colors/custom/$THEME.css\");" >"$HOME/.config/waybar/colors/colors.css"
3
Update Hyprland colors
Creates a source directive pointing to the theme file.
Translates short theme names to full application-specific theme names.
case $THEME inkanagawa) VSCODIUM_THEME="Kanagawa Wave" NVIM_THEME="kanagawa" NOTIFY_ICON="π" ;;gruvbox) VSCODIUM_THEME="Gruvbox Dark Hard" NVIM_THEME="gruvbox" NOTIFY_ICON="π¦" ;;catppuccin) VSCODIUM_THEME="Catppuccin Mocha" NVIM_THEME="catppuccin" NOTIFY_ICON="β" ;;everforest) VSCODIUM_THEME="Everforest Night Hard" NVIM_THEME="everforest" NOTIFY_ICON="π²" ;;esac
6
Update VSCodium
Uses sed to replace the workbench.colorTheme in settings.json.
VSCODIUM_SETTINGS="$HOME/.config/VSCodium/User/settings.json"if [ -f "$VSCODIUM_SETTINGS" ]; then sed -i -E "s/\"workbench.colorTheme\": \".*\"/\"workbench.colorTheme\": \"$VSCODIUM_THEME\"/g" "$VSCODIUM_SETTINGS" echo "βοΈ Tema de VSCodium actualizado a $VSCODIUM_THEME"fi
7
Update Neovim
Creates a Lua bridge file that returns the theme name.