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
2 changes: 2 additions & 0 deletions bin/omarchy-pkg-remove
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,7 @@ pkg_names=$(yay -Qqe | fzf "${fzf_args[@]}")
if [[ -n $pkg_names ]]; then
# Convert newline-separated selections to space-separated for yay
echo "$pkg_names" | tr '\n' ' ' | xargs sudo pacman -Rns --noconfirm
# Reconcile .desktop entries — drops orphans for removed packages (#5933).
omarchy-refresh-applications
omarchy-show-done
fi
18 changes: 16 additions & 2 deletions bin/omarchy-refresh-applications
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,27 @@ mkdir -p ~/.local/share/icons/hicolor/48x48/apps/
cp ~/.local/share/omarchy/applications/icons/*.png ~/.local/share/icons/hicolor/48x48/apps/
gtk-update-icon-cache ~/.local/share/icons/hicolor &>/dev/null

# Copy .desktop declarations
# Copy .desktop declarations. For top-level entries (i.e. visible launchers),
# also clean up the destination when the referenced Exec command is missing —
# otherwise removing a preinstalled package via `omarchy-pkg-remove` leaves an
# orphan .desktop that still shows up in the launcher and "App failure"s on
# click (see #5933).
mkdir -p ~/.local/share/applications
cp ~/.local/share/omarchy/applications/*.desktop ~/.local/share/applications/
for src in ~/.local/share/omarchy/applications/*.desktop; do
dest=~/.local/share/applications/$(basename "$src")
cmd=$(sed -n 's/^Exec=\([^ ]*\).*/\1/p' "$src" | head -1)
if [[ -n $cmd ]] && command -v "$cmd" &>/dev/null; then
cp "$src" "$dest"
else
rm -f "$dest"
fi
done
cp ~/.local/share/omarchy/applications/hidden/*.desktop ~/.local/share/applications/

if omarchy-cmd-present alacritty; then
cp ~/.local/share/omarchy/default/alacritty/alacritty.desktop ~/.local/share/applications/
else
rm -f ~/.local/share/applications/alacritty.desktop
fi

# Refresh the webapps, TUIs, and npm wrappers
Expand Down