From b48f67058be4645dc723fceeeb99fbb5182d52f8 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Mon, 11 May 2026 17:50:04 +0200 Subject: [PATCH] Use consistent terms --- bin/omarchy-menu-images | 2 +- bin/omarchy-theme-bg-set | 2 +- bin/omarchy-theme-bg-switcher | 4 ++-- default/elephant/omarchy_background_selector.lua | 4 ++-- default/hypr/autostart.lua | 2 +- default/hypr/bindings/utilities.lua | 2 +- .../{wallpaper-switcher.qml => background-switcher.qml} | 9 +++++---- ...lors.json.tpl => background-switcher-colors.json.tpl} | 0 8 files changed, 13 insertions(+), 12 deletions(-) rename default/quickshell/{wallpaper-switcher.qml => background-switcher.qml} (94%) rename default/themed/{wallpaper-switcher-colors.json.tpl => background-switcher-colors.json.tpl} (100%) diff --git a/bin/omarchy-menu-images b/bin/omarchy-menu-images index ad8e0dc2..f76cf6ea 100755 --- a/bin/omarchy-menu-images +++ b/bin/omarchy-menu-images @@ -45,7 +45,7 @@ done_file=$(mktemp) rm -f "$done_file" trap 'rm -f "$selection_file" "$done_file"' EXIT socket_path="${XDG_RUNTIME_DIR:-/run/user/$UID}/omarchy-image-selector.sock" -selector_qml="$OMARCHY_PATH/default/quickshell/wallpaper-switcher.qml" +selector_qml="$OMARCHY_PATH/default/quickshell/background-switcher.qml" image_dirs_env="" for dir in "${image_dirs[@]}"; do diff --git a/bin/omarchy-theme-bg-set b/bin/omarchy-theme-bg-set index 9c695d0e..803bea36 100755 --- a/bin/omarchy-theme-bg-set +++ b/bin/omarchy-theme-bg-set @@ -2,7 +2,7 @@ # omarchy:summary=Set the current background image # omarchy:args= -# omarchy:examples=omarchy theme bg set ~/Pictures/wallpaper.png +# omarchy:examples=omarchy theme bg set ~/Pictures/background.png if [[ -z $1 ]]; then echo "Usage: omarchy-theme-bg-set " >&2 diff --git a/bin/omarchy-theme-bg-switcher b/bin/omarchy-theme-bg-switcher index 16b9e2bb..d3846027 100755 --- a/bin/omarchy-theme-bg-switcher +++ b/bin/omarchy-theme-bg-switcher @@ -1,9 +1,9 @@ #!/bin/bash -# omarchy:summary=Open the Omarchy wallpaper switcher +# omarchy:summary=Open the Omarchy background switcher # omarchy:group=theme # omarchy:name=bg-switcher -# omarchy:aliases=omarchy wallpaper +# omarchy:aliases=omarchy background OMARCHY_PATH=${OMARCHY_PATH:-$HOME/.local/share/omarchy} theme_name=$(cat "$HOME/.config/omarchy/current/theme.name" 2>/dev/null) diff --git a/default/elephant/omarchy_background_selector.lua b/default/elephant/omarchy_background_selector.lua index 38bc2bf1..4b96f4a6 100644 --- a/default/elephant/omarchy_background_selector.lua +++ b/default/elephant/omarchy_background_selector.lua @@ -44,9 +44,9 @@ function GetEntries() -- Track added files to avoid duplicates local seen = {} - for _, wallpaper_dir in ipairs(dirs) do + for _, background_dir in ipairs(dirs) do local handle = io.popen( - "find -L " .. ShellEscape(wallpaper_dir) + "find -L " .. ShellEscape(background_dir) .. " -maxdepth 1 -type f \\( -name '*.jpg' -o -name '*.jpeg' -o -name '*.png' -o -name '*.gif' -o -name '*.bmp' -o -name '*.webp' \\) 2>/dev/null | sort" ) if handle then diff --git a/default/hypr/autostart.lua b/default/hypr/autostart.lua index 846b788a..6d2812c9 100644 --- a/default/hypr/autostart.lua +++ b/default/hypr/autostart.lua @@ -4,7 +4,7 @@ hl.on("hyprland.start", function() hl.exec_cmd("! omarchy-toggle-enabled waybar-off && uwsm-app -- waybar") hl.exec_cmd("uwsm-app -- fcitx5 --disable notificationitem") hl.exec_cmd("uwsm-app -- swaybg -i ~/.config/omarchy/current/background -m fill") - hl.exec_cmd("uwsm-app -- quickshell -p ~/.local/share/omarchy/default/quickshell/wallpaper-switcher.qml") + hl.exec_cmd("uwsm-app -- quickshell -p ~/.local/share/omarchy/default/quickshell/background-switcher.qml") hl.exec_cmd("/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1") hl.exec_cmd("omarchy-first-run") hl.exec_cmd("omarchy-powerprofiles-init") diff --git a/default/hypr/bindings/utilities.lua b/default/hypr/bindings/utilities.lua index 57a3e70e..ef068b02 100644 --- a/default/hypr/bindings/utilities.lua +++ b/default/hypr/bindings/utilities.lua @@ -15,7 +15,7 @@ hl.bind("SUPER + SHIFT + CTRL + UP", hl.dsp.exec_cmd("omarchy-style-waybar-posit hl.bind("SUPER + SHIFT + CTRL + DOWN", hl.dsp.exec_cmd("omarchy-style-waybar-position bottom"), { description = "Move Waybar to bottom" }) hl.bind("SUPER + SHIFT + CTRL + LEFT", hl.dsp.exec_cmd("omarchy-style-waybar-position left"), { description = "Move Waybar to left" }) hl.bind("SUPER + SHIFT + CTRL + RIGHT", hl.dsp.exec_cmd("omarchy-style-waybar-position right"), { description = "Move Waybar to right" }) -hl.bind("SUPER + CTRL + SPACE", hl.dsp.exec_cmd("bash -lc 'background=$(omarchy-theme-bg-switcher) && [[ -n $background ]] && omarchy-theme-bg-set \"$background\"'"), { description = "Wallpaper switcher" }) +hl.bind("SUPER + CTRL + SPACE", hl.dsp.exec_cmd("omarchy-menu background"), { description = "Background switcher" }) hl.bind("SUPER + SHIFT + CTRL + SPACE", hl.dsp.exec_cmd("omarchy-menu theme"), { description = "Theme menu" }) hl.bind("SUPER + BACKSPACE", hl.dsp.exec_cmd("omarchy-hyprland-window-transparency-toggle"), { description = "Toggle window transparency" }) hl.bind("SUPER + SHIFT + BACKSPACE", hl.dsp.exec_cmd("omarchy-hyprland-window-gaps-toggle"), { description = "Toggle window gaps" }) diff --git a/default/quickshell/wallpaper-switcher.qml b/default/quickshell/background-switcher.qml similarity index 94% rename from default/quickshell/wallpaper-switcher.qml rename to default/quickshell/background-switcher.qml index 01bc508e..aeea282f 100644 --- a/default/quickshell/wallpaper-switcher.qml +++ b/default/quickshell/background-switcher.qml @@ -10,9 +10,9 @@ ShellRoot { property string imageDirs: Quickshell.env("OMARCHY_IMAGE_SELECTOR_DIRS") || Quickshell.env("OMARCHY_IMAGE_SELECTOR_DIR") || Quickshell.env("OMARCHY_STOCK_BACKGROUNDS_DIR") || (Quickshell.env("HOME") + "/.config/omarchy/current/theme/backgrounds") property string imageRows: "" - property string selectionFile: Quickshell.env("OMARCHY_IMAGE_SELECTOR_SELECTION_FILE") || Quickshell.env("OMARCHY_WALLPAPER_SELECTION_FILE") + property string selectionFile: Quickshell.env("OMARCHY_IMAGE_SELECTOR_SELECTION_FILE") || Quickshell.env("OMARCHY_BACKGROUND_SELECTION_FILE") property string selectedImage: Quickshell.env("OMARCHY_IMAGE_SELECTOR_SELECTED") - property string colorsFile: Quickshell.env("OMARCHY_IMAGE_SELECTOR_COLORS_FILE") || (Quickshell.env("HOME") + "/.config/omarchy/current/theme/wallpaper-switcher-colors.json") + property string colorsFile: Quickshell.env("OMARCHY_IMAGE_SELECTOR_COLORS_FILE") || (Quickshell.env("HOME") + "/.config/omarchy/current/theme/background-switcher-colors.json") property int selectedIndex: 0 property bool imagesLoaded: false property bool opened: false @@ -57,6 +57,7 @@ ShellRoot { function applySelected() { var path = currentPath() if (!path) return + if (!selectionFile) return applyProc.command = ["bash", "-lc", "printf '%s\\n' " + shellQuote(path) + " > " + shellQuote(selectionFile) + "; : > " + shellQuote(doneFile)] applyProc.running = true } @@ -88,7 +89,7 @@ ShellRoot { selectedImage = nextSelectedImage selectionFile = nextSelectionFile doneFile = nextDoneFile - colorsFile = nextColorsFile || (Quickshell.env("HOME") + "/.config/omarchy/current/theme/wallpaper-switcher-colors.json") + colorsFile = nextColorsFile || (Quickshell.env("HOME") + "/.config/omarchy/current/theme/background-switcher-colors.json") imageModel.clear() selectedIndex = 0 list.currentIndex = 0 @@ -134,7 +135,7 @@ ShellRoot { Process { id: loadImagesProc property string output: "" - command: ["bash", "-lc", "cache_dir=${XDG_CACHE_HOME:-$HOME/.cache}/omarchy/image-selector; while IFS= read -r dir; do [[ -d $dir ]] && find -L \"$dir\" -maxdepth 1 -type f \\( -iname '*.jpg' -o -iname '*.jpeg' -o -iname '*.png' -o -iname '*.webp' \\) -print0; done <<< " + shellQuote(root.imageDirs) + " | sort -z | while IFS= read -r -d '' image; do hash=$(md5sum \"$image\" | cut -d ' ' -f 1); thumb=\"$cache_dir/$hash.jpg\"; [[ -f $thumb ]] || thumb=$image; printf '%s\\t%s\\n' \"$image\" \"$thumb\"; done"] + command: ["bash", "-lc", "cache_dir=${XDG_CACHE_HOME:-$HOME/.cache}/omarchy/image-selector; while IFS= read -r dir; do [[ -n $dir && -d $dir ]] && find -L \"$dir\" -maxdepth 1 -type f \\( -iname '*.jpg' -o -iname '*.jpeg' -o -iname '*.png' -o -iname '*.webp' \\) -print0; done <<< " + shellQuote(root.imageDirs) + " | sort -z | while IFS= read -r -d '' image; do hash=$(md5sum \"$image\" | cut -d ' ' -f 1); thumb=\"$cache_dir/$hash.jpg\"; [[ -f $thumb ]] || thumb=$image; printf '%s\\t%s\\n' \"$image\" \"$thumb\"; done"] stdout: SplitParser { onRead: function(data) { loadImagesProc.output += data + "\n" diff --git a/default/themed/wallpaper-switcher-colors.json.tpl b/default/themed/background-switcher-colors.json.tpl similarity index 100% rename from default/themed/wallpaper-switcher-colors.json.tpl rename to default/themed/background-switcher-colors.json.tpl