Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion default/elephant/omarchy_background_selector.lua
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,14 @@ function GetEntries()
if theme_name then
table.insert(dirs, home .. "/.config/omarchy/backgrounds/" .. theme_name)
end
table.insert(dirs, home .. "/Wallpapers")

-- Track added files to avoid duplicates
local seen = {}

for _, wallpaper_dir in ipairs(dirs) do
local handle = io.popen(
"find " .. ShellEscape(wallpaper_dir)
"find -L " .. ShellEscape(wallpaper_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
Expand Down
9 changes: 9 additions & 0 deletions migrations/1776587855.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
echo "Create ~/Wallpapers directory for global wallpaper collection"

if [[ -d "$HOME/Wallpapers" ]]; then
:
elif [[ -e "$HOME/Wallpapers" ]]; then
Copy link

Copilot AI Apr 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[[ -e "$HOME/Wallpapers" ]] is false for a dangling symlink, so a user with ~/Wallpapers as a broken symlink (e.g., pointing at an offline mount) will fall into the mkdir -p branch and the migration will fail with "File exists". Consider treating any existing path (including symlinks) as "do not create" by checking -L/-h as well (or using a [[ -e ... || -L ... ]] guard) and keeping the current warning for non-directory, non-symlink cases.

Suggested change
elif [[ -e "$HOME/Wallpapers" ]]; then
elif [[ -e "$HOME/Wallpapers" || -L "$HOME/Wallpapers" ]]; then

Copilot uses AI. Check for mistakes.
echo "Skipping ~/Wallpapers creation: $HOME/Wallpapers exists but is not a directory"
else
mkdir -p "$HOME/Wallpapers"
fi
Loading