#16115

Give an installed launcher a real icon, and take it away again

Openstatick88wants to merge intofrom

Fixes the icon handling in omarchy-tui-install and omarchy-tui-remove.

Three gaps, all reproducible in a throwaway $HOME:

export HOME=$(mktemp -d)
ID=$HOME/.local/share/icons/hicolor/256x256/apps

# 1. A URL that 404s installs the error body as the icon, with exit 0
omarchy-tui-install T1 true tile https://example.com/missing.png
file $ID/t1.png   # ASCII text, 105 bytes

# 2. A bare icon name that does not exist writes Icon=<name> and no icon
omarchy-tui-install T2 true tile no-such-icon
grep ^Icon= $HOME/.local/share/applications/T2.desktop   # Icon=no-such-icon

# 3. A local .svg is copied as <name>.svg, which tui-remove never deletes
omarchy-tui-install T3 true tile ./icon.svg
OMARCHY_REMOVE_NOTIFY=false omarchy-tui-remove T3
ls $ID            # t3.svg is still there

curl exits 0 on an HTTP error, so the first case installed the body of the error page as the icon and reported success. The launcher script now checks the answer the way omarchy-webapp-install already does, and removes the file when the answer is not an image, so a failed download leaves nothing behind.

A bare icon name is looked up in the icon theme before the launcher is written. A name that resolves to nothing is reported, and the launcher is still written, because an app without its own icon is a valid thing to install; the user is told which name was not found.

The icon keeps the format it was installed with, so the removal scripts now take the icon away in every format the installer can copy. The removal matches the sanitized app name, which is the name the installer gave the icon, so a name typed at the prompt cannot reach another app's icon. omarchy-webapp-remove had the same leftover, and omarchy-webapp-install left a failed download behind in the icon directory the same way.

Fixes #16047.

Tested with test/shell.d/tui-icon-test.sh, which answers the download with an error body, with something that is not an image and with a real image, and pins the launcher, the warning, the removal of the icon in both formats, and the fact that a name typed at the prompt removes no other icon.

Activity

13
greptile-apps[bot]19h ago

Confidence Score: 5/5

[Medium impact] The latest update appears safe to merge; the two remaining earlier findings are non-blocking.

Findings

  1.  Some icons remain after removal ▶
  2.  Working icons get false warnings ▶

Summary

The PR checks downloaded icons before replacing installed files and expands icon cleanup.

  • Downloaded launcher icons are checked before they replace saved files.
  • The TUI installer warns when a named icon cannot be found.
  • Removing either launcher also removes its PNG, SVG, and XPM icons.

Reviews (6) · Last reviewed commit: "See through the links a theme makes of i..." · Reviewed by Greptile

greptile-apps[bot]reviewed19h ago
greptile-apps[bot]reviewed19h ago
greptile-apps[bot]reviewed19h ago
greptile-apps[bot]reviewed19h ago
greptile-apps[bot]18h ago

Want your agent to iterate on Greptile's feedback? Try greploops.