Skip to content

Instantly share code, notes, and snippets.

@bjarneo
Created December 1, 2025 16:27
Show Gist options
  • Select an option

  • Save bjarneo/d23d062983a068f5f15c7774adf28f48 to your computer and use it in GitHub Desktop.

Select an option

Save bjarneo/d23d062983a068f5f15c7774adf28f48 to your computer and use it in GitHub Desktop.
Change your theme on hyprland workspace switch
#!/bin/bash
# Map workspaces to omarchy themes
declare -A workspace_themes=(
[1]="catppuccin"
[2]="catppuccin-latte"
[3]="ethereal"
[4]="everforest"
[5]="flexoki-light"
[6]="gruvbox"
[7]="hackerman"
[8]="kanagawa"
[9]="nord"
[10]="tokyo-night"
)
# Listen to Hyprland workspace changes
nc -U /run/user/$(id -u)/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock | while read -r line; do
if [[ $line == workspace* ]]; then
workspace_id=$(echo "$line" | cut -d',' -f2)
echo "Switched to workspace: $workspace_id"
# Set theme based on workspace
if [[ -n "${workspace_themes[$workspace_id]}" ]]; then
theme="${workspace_themes[$workspace_id]}"
echo "Setting theme: $theme"
omarchy-theme-set "$theme"
fi
fi
done
@zigmoo
Copy link
Copy Markdown

zigmoo commented Dec 1, 2025

Thanks for this Bjarne!

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