From 781a7888cb0b7c21348a23f03060c9e07e68eb32 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Wed, 16 Jul 2025 07:11:36 -0700 Subject: [PATCH] Move to fully user editable wofi styles Closes #190 --- bin/omarchy-power-menu | 2 +- bin/omarchy-refresh-wofi | 3 +- bin/omarchy-show-keybindings | 2 +- bin/omarchy-theme-menu | 2 +- {default => config}/wofi/select.css | 7 ++- config/wofi/style.css | 3 +- default/hypr/bindings/utilities.conf | 4 +- default/wofi/search.css | 73 ---------------------------- migrations/1752551006.sh | 1 + migrations/1752673060.sh | 2 + 10 files changed, 17 insertions(+), 82 deletions(-) rename {default => config}/wofi/select.css (50%) delete mode 100644 default/wofi/search.css create mode 100644 migrations/1752673060.sh diff --git a/bin/omarchy-power-menu b/bin/omarchy-power-menu index b9989e4..6ada228 100755 --- a/bin/omarchy-power-menu +++ b/bin/omarchy-power-menu @@ -10,7 +10,7 @@ show_power_menu() { \u200Dī™ Relaunch \u2060ķ°œ‰ Restart \u2063ķ°Ĩ Shutdown" - local selection=$(echo -e "$menu_options" | wofi --show dmenu --prompt "Power Options" --width 150 --height 195 -O alphabetical --style ~/.local/share/omarchy/default/wofi/select.css) + local selection=$(echo -e "$menu_options" | wofi --show dmenu --prompt "Power Options" --width 150 --height 195 -O alphabetical --style ~/.config/wofi/select.css) case "$selection" in *Lock*) hyprlock ;; diff --git a/bin/omarchy-refresh-wofi b/bin/omarchy-refresh-wofi index d6d359c..3f2f9e3 100755 --- a/bin/omarchy-refresh-wofi +++ b/bin/omarchy-refresh-wofi @@ -1,7 +1,8 @@ #!/bin/bash -if gum confirm "Refresh Wofi config? This will replace your current settings with Omarchy defaults."; then +if [[ "$1" == "-y" ]] || gum confirm "Refresh Wofi config? This will replace your current settings with Omarchy defaults."; then # Overwrite local waybar settings with the latest in Omarchy cp -f ~/.local/share/omarchy/config/wofi/config ~/.config/wofi/ 2>/dev/null cp -f ~/.local/share/omarchy/config/wofi/style.css ~/.config/wofi/ 2>/dev/null + cp -f ~/.local/share/omarchy/config/wofi/select.css ~/.config/wofi/ 2>/dev/null fi diff --git a/bin/omarchy-show-keybindings b/bin/omarchy-show-keybindings index 6124355..8750e76 100755 --- a/bin/omarchy-show-keybindings +++ b/bin/omarchy-show-keybindings @@ -56,4 +56,4 @@ grep -h '^[[:space:]]*bind' $USER_HYPRLAND_CONF $OMARCHY_BINDINGS_CONF | printf "%-35s → %s\n", key_combo, action; } }' | - flock --nonblock /tmp/.wofi.lock -c "wofi -dmenu -i --width 60% --height 70% -p 'Hyprland Keybindings' -O alphabetical --style=\"$HOME/.local/share/omarchy/default/wofi/search.css\"" + wofi -dmenu -i --width 60% --height 70% -p 'Hyprland Keybindings' -O alphabetical diff --git a/bin/omarchy-theme-menu b/bin/omarchy-theme-menu index c0b1e8f..70a32c6 100755 --- a/bin/omarchy-theme-menu +++ b/bin/omarchy-theme-menu @@ -25,7 +25,7 @@ selection=$(printf '%s\n' "${themes[@]}" | wofi \ --width 150 \ --height 300 \ -O alphabetical \ - --style ~/.local/share/omarchy/default/wofi/select.css 2>/dev/null) + --style ~/.config/wofi/select.css 2>/dev/null) # Remove any Pango markup before converting back to filename clean_selection=$(echo "$selection" | sed -E 's/<[^>]+>//g') diff --git a/default/wofi/select.css b/config/wofi/select.css similarity index 50% rename from default/wofi/select.css rename to config/wofi/select.css index 5f255c0..a55a7bb 100644 --- a/default/wofi/select.css +++ b/config/wofi/select.css @@ -1,8 +1,11 @@ -@import ".config/omarchy/current/theme/wofi.css"; -@import ".local/share/omarchy/default/wofi/search.css"; +/* Use by power menu, theme selector, and other menus without visible search bar */ + +@import ".config/wofi/style.css"; #input { display: none; opacity: 0; margin-top: -200px; } + +@import ".config/omarchy/current/theme/wofi.css"; diff --git a/config/wofi/style.css b/config/wofi/style.css index 97b3775..e6bb68f 100644 --- a/config/wofi/style.css +++ b/config/wofi/style.css @@ -1,4 +1,4 @@ -/* Colors are defined by theme files and can be referenced via @base, @text, @selected-text, and @border */ +/* Colors are defined by theme file and can be referenced via @base, @text, @selected-text, and @border */ * { font-family: 'CaskaydiaMono Nerd Font', monospace; @@ -71,3 +71,4 @@ window { -gtk-icon-transform: scale(0.7); } +@import ".config/omarchy/current/theme/wofi.css"; diff --git a/default/hypr/bindings/utilities.conf b/default/hypr/bindings/utilities.conf index 7b1ee18..e4c5f3a 100644 --- a/default/hypr/bindings/utilities.conf +++ b/default/hypr/bindings/utilities.conf @@ -1,6 +1,6 @@ # Launching -bind = SUPER, space, exec, pkill wofi || wofi --show drun --sort-order=alphabetical --style="$HOME/.local/share/omarchy/default/wofi/search.css" -bind = SUPER, K, exec, ~/.local/share/omarchy/bin/omarchy-show-keybindings +bind = SUPER, space, exec, pkill wofi || wofi --show drun -O alphabetical +bind = SUPER, K, exec, pkill wofi || ~/.local/share/omarchy/bin/omarchy-show-keybindings # Aesthetics bind = SUPER SHIFT, SPACE, exec, pkill -SIGUSR1 waybar diff --git a/default/wofi/search.css b/default/wofi/search.css deleted file mode 100644 index c6db56e..0000000 --- a/default/wofi/search.css +++ /dev/null @@ -1,73 +0,0 @@ -@import ".config/omarchy/current/theme/wofi.css"; -@import ".config/wofi/style.css"; - -* { - font-family: 'CaskaydiaMono Nerd Font', monospace; - font-size: 18px; -} - -window { - margin: 0px; - padding: 20px; - background-color: @base; - opacity: 0.95; -} - -#inner-box { - margin: 0; - padding: 0; - border: none; - background-color: @base; -} - -#outer-box { - margin: 0; - padding: 20px; - border: none; - background-color: @base; - border: 2px solid @border; -} - -#scroll { - margin: 0; - padding: 0; - border: none; - background-color: @base; -} - -#input { - margin: 0; - padding: 10px; - border: none; - background-color: @base; - color: @text; -} - -#input:focus { - outline: none; - box-shadow: none; - border: none; -} - -#text { - margin: 5px; - border: none; - color: @text; -} - -#entry { - background-color: @base; -} - -#entry:selected { - outline: none; - border: none; -} - -#entry:selected #text { - color: @selected-text; -} - -#entry image { - -gtk-icon-transform: scale(0.7); -} diff --git a/migrations/1752551006.sh b/migrations/1752551006.sh index b573001..efa955c 100644 --- a/migrations/1752551006.sh +++ b/migrations/1752551006.sh @@ -2,4 +2,5 @@ echo "Make wofi stylesheet user editable" if [[ -L "$HOME/.config/wofi/style.css" ]]; then rm "$HOME/.config/wofi/style.css" cp ~/.local/share/omarchy/config/wofi/style.css ~/.config/wofi/ + cp ~/.local/share/omarchy/config/wofi/search.css ~/.config/wofi/ fi diff --git a/migrations/1752673060.sh b/migrations/1752673060.sh new file mode 100644 index 0000000..4e2df85 --- /dev/null +++ b/migrations/1752673060.sh @@ -0,0 +1,2 @@ +echo "Make all wofi stylesheets user editable" +omarchy-refresh-wofi -y