Background selector (#4519)
* UPDATE: select background method * ADD: migration file for background selector * Add symlink for background selector in walker-elephant.sh Forgot about this file. Should be added to make sure the background selector feature available in the fresh install * clean up the code a bit Updated omarchy background selector to hide from provider list and removed subtext from entries. * Make the background selector the default * Fix migration * FIX: typo on background symlink target * UPDATE: add ~/.config/omarchy/backgrounds/theme.name * UPDATE: Cache = false * Fix escaping for all extensions * Extract omarchy-theme-bg-set --------- Co-authored-by: David Heinemeier Hansson <david@hey.com>
This commit is contained in:
co-authored by
David Heinemeier Hansson
parent
eec15803fc
commit
6b4109faba
+6
-1
@@ -181,7 +181,7 @@ show_style_menu() {
|
||||
case $(menu "Style" " Theme\n Font\n Background\n Hyprland\n Screensaver\n About") in
|
||||
*Theme*) show_theme_menu ;;
|
||||
*Font*) show_font_menu ;;
|
||||
*Background*) omarchy-theme-bg-next ;;
|
||||
*Background*) show_background_menu ;;
|
||||
*Hyprland*) open_in_editor ~/.config/hypr/looknfeel.conf ;;
|
||||
*Screensaver*) open_in_editor ~/.config/omarchy/branding/screensaver.txt ;;
|
||||
*About*) open_in_editor ~/.config/omarchy/branding/about.txt ;;
|
||||
@@ -193,6 +193,10 @@ show_theme_menu() {
|
||||
omarchy-launch-walker -m menus:omarchythemes --width 800 --minheight 400
|
||||
}
|
||||
|
||||
show_background_menu() {
|
||||
omarchy-launch-walker -m menus:omarchyBackgroundSelector
|
||||
}
|
||||
|
||||
show_font_menu() {
|
||||
theme=$(menu "Font" "$(omarchy-font-list)" "--width 350" "$(omarchy-font-current)")
|
||||
if [[ "$theme" == "CNCLD" || -z "$theme" ]]; then
|
||||
@@ -584,6 +588,7 @@ go_to_menu() {
|
||||
*learn*) show_learn_menu ;;
|
||||
*trigger*) show_trigger_menu ;;
|
||||
*share*) show_share_menu ;;
|
||||
*background*) show_background_menu ;;
|
||||
*capture*) show_capture_menu ;;
|
||||
*style*) show_style_menu ;;
|
||||
*theme*) show_theme_menu ;;
|
||||
|
||||
Executable
+18
@@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Sets the specified image as the current background
|
||||
|
||||
if [[ -z "$1" ]]; then
|
||||
echo "Usage: omarchy-theme-bg-set <path-to-image>" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
BACKGROUND="$1"
|
||||
CURRENT_BACKGROUND_LINK="$HOME/.config/omarchy/current/background"
|
||||
|
||||
# Create symlink to the new background
|
||||
ln -nsf "$BACKGROUND" "$CURRENT_BACKGROUND_LINK"
|
||||
|
||||
# Kill existing swaybg and start new one
|
||||
pkill -x swaybg
|
||||
setsid uwsm-app -- swaybg -i "$CURRENT_BACKGROUND_LINK" -m fill >/dev/null 2>&1 &
|
||||
@@ -33,7 +33,7 @@ rm -rf "$CURRENT_THEME_PATH"
|
||||
mv "$NEXT_THEME_PATH" "$CURRENT_THEME_PATH"
|
||||
|
||||
# Store theme name for reference
|
||||
echo "$THEME_NAME" > "$HOME/.config/omarchy/current/theme.name"
|
||||
echo "$THEME_NAME" >"$HOME/.config/omarchy/current/theme.name"
|
||||
|
||||
# Change background with theme
|
||||
omarchy-theme-bg-next
|
||||
@@ -48,6 +48,7 @@ omarchy-restart-hyprctl
|
||||
omarchy-restart-btop
|
||||
omarchy-restart-opencode
|
||||
omarchy-restart-mako
|
||||
omarchy-restart-walker
|
||||
|
||||
# Change app-specific themes
|
||||
omarchy-theme-set-gnome
|
||||
|
||||
Reference in New Issue
Block a user