Created
December 1, 2025 16:27
-
-
Save bjarneo/d23d062983a068f5f15c7774adf28f48 to your computer and use it in GitHub Desktop.
Change your theme on hyprland workspace switch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for this Bjarne!