From 72af673ffca743a6a66d3249b03458f34010557b Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Thu, 19 Jun 2025 08:10:36 -0400 Subject: [PATCH] Use current directory for gathering --- bin/omarchy-theme-next | 20 +++++++++----------- bin/swaybg-next | 4 ++-- config/alacritty/alacritty.toml | 2 +- config/swaync/style.css | 2 +- config/waybar/style.css | 2 +- install/theme.sh | 11 ++++++----- 6 files changed, 20 insertions(+), 21 deletions(-) diff --git a/bin/omarchy-theme-next b/bin/omarchy-theme-next index 12d39fa..ff6f545 100755 --- a/bin/omarchy-theme-next +++ b/bin/omarchy-theme-next @@ -1,7 +1,7 @@ #!/bin/bash THEMES_DIR="$HOME/.config/omarchy/themes/" -CURRENT_THEME_LINK="$HOME/.config/omarchy/current-theme" +CURRENT_THEME_LINK="$HOME/.config/omarchy/current/theme" THEMES=($(find "$THEMES_DIR" -mindepth 1 | sort)) TOTAL=${#THEMES[@]} @@ -28,17 +28,15 @@ NEXT_INDEX=$(((INDEX + 1) % TOTAL)) NEW_THEME=${THEMES[$NEXT_INDEX]} NEW_THEME_NAME=$(basename "$NEW_THEME") -# Install theme backgrounds -source ~/.config/omarchy/current-theme/backgrounds.sh -ln -nsf ~/.config/omarchy/backgrounds/$NEW_THEME_NAME ~/.config/omarchy/current-backgrounds - -# Set new theme -ln -nsf $NEW_THEME ~/.config/omarchy/current-theme +# Set current theme +ln -nsf "$HOME/.config/omarchy/backgrounds/$NEW_THEME_NAME" "$HOME/.config/omarchy/current/backgrounds" +ln -nsf "$NEW_THEME" "$HOME/.config/omarchy/current/theme" # Touch alacritty config to pickup the changed theme -touch ~/.config/alacritty/alacritty.toml +touch "$HOME/.config/alacritty/alacritty.toml" -# Restart apps for new theme -pkill waybar -setsid waybar & +# Restart waybar for new theme +pkill waybar && setsid waybar + +# Pick new background from theme set swaybg-next diff --git a/bin/swaybg-next b/bin/swaybg-next index 4c79473..6da354f 100755 --- a/bin/swaybg-next +++ b/bin/swaybg-next @@ -2,8 +2,8 @@ # Cycles through the background images available -BACKGROUNDS_DIR="$HOME/.config/omarchy/current-backgrounds/" -CURRENT_BACKGROUND_LINK="$HOME/.config/omarchy/current-background" +BACKGROUNDS_DIR="$HOME/.config/omarchy/current/backgrounds/" +CURRENT_BACKGROUND_LINK="$HOME/.config/omarchy/current/background" BACKGROUNDS=($(find "$BACKGROUNDS_DIR" -type f | sort)) TOTAL=${#BACKGROUNDS[@]} diff --git a/config/alacritty/alacritty.toml b/config/alacritty/alacritty.toml index e9f556f..05ec994 100644 --- a/config/alacritty/alacritty.toml +++ b/config/alacritty/alacritty.toml @@ -1,4 +1,4 @@ -general.import = [ "~/.config/omarchy/current-theme/alacritty.toml" ] +general.import = [ "~/.config/omarchy/current/theme/alacritty.toml" ] [env] TERM = "xterm-256color" diff --git a/config/swaync/style.css b/config/swaync/style.css index 5939af5..c8bec32 100644 --- a/config/swaync/style.css +++ b/config/swaync/style.css @@ -27,4 +27,4 @@ color: #a6adc8; } -@import "../omarchy/current-theme/swaync.css"; +@import "../omarchy/current/theme/swaync.css"; diff --git a/config/waybar/style.css b/config/waybar/style.css index 9fb8e8f..d4d2234 100644 --- a/config/waybar/style.css +++ b/config/waybar/style.css @@ -35,4 +35,4 @@ tooltip label { padding: 2px; } -@import "../omarchy/current-theme/waybar.css"; +@import "../omarchy/current/theme/waybar.css"; diff --git a/install/theme.sh b/install/theme.sh index b272362..4183b05 100644 --- a/install/theme.sh +++ b/install/theme.sh @@ -10,11 +10,12 @@ mkdir -p ~/.config/omarchy/themes for f in ~/.local/share/omarchy/themes/*; do ln -s "$f" ~/.config/omarchy/themes/; done # Set initial theme -ln -snf ~/.config/omarchy/themes/tokyo-night ~/.config/omarchy/current-theme +mkdir -p ~/.config/omarchy/current +ln -snf ~/.config/omarchy/themes/tokyo-night ~/.config/omarchy/current/theme source ~/.local/share/omarchy/themes/tokyo-night/backgrounds.sh -ln -snf ~/.config/omarchy/backgrounds/tokyo-night ~/.config/omarchy/current-backgrounds +ln -snf ~/.config/omarchy/backgrounds/tokyo-night ~/.config/omarchy/current/backgrounds # Set specific app links for current theme -ln -snf ~/.config/omarchy/current-theme/wofi.css ~/.config/wofi/style.css -ln -snf ~/.config/omarchy/current-theme/neovim.lua ~/.config/nvim/lua/plugins/theme.lua -ln -snf ~/.config/omarchy/current-theme/btop.theme ~/.config/btop/themes/current.theme +ln -snf ~/.config/omarchy/current/theme/wofi.css ~/.config/wofi/style.css +ln -snf ~/.config/omarchy/current/theme/neovim.lua ~/.config/nvim/lua/plugins/theme.lua +ln -snf ~/.config/omarchy/current/theme/btop.theme ~/.config/btop/themes/current.theme