omarchy icon indicating copy to clipboard operation
omarchy copied to clipboard

webapp install: slashes in app name create a nested .desktop path that webapp remove can't delete

Open curatingbits opened this issue 3 months ago • 0 comments

What happened

I accidentally entered the URL into the Name field when installing a web app (Name> http://127.0.0.1:4000). The install "succeeded", but because the name contains slashes, the launcher was written to a nested path instead of a single file:

~/.local/share/applications/http:/127.0.0.1:4000/.desktop

omarchy-webapp-install builds DESKTOP_FILE="$HOME/.local/share/applications/$APP_NAME.desktop" and then runs mkdir -p "$(dirname "$DESKTOP_FILE")", so every / in the name becomes a directory level.

The broken entry then cannot be removed with omarchy webapp remove:

  • The picker finds the file via find "$DESKTOP_DIR" -name '*.desktop' and displays basename "${file%.desktop}" → it shows up as 127.0.0.1:4000.
  • Removal then runs rm -f "$DESKTOP_DIR/$APP_NAME.desktop" → ~/.local/share/applications/127.0.0.1:4000.desktop, which doesn't exist. The real file is in the nested directory, so the rm silently deletes nothing and the app stays in the launcher.

Passing the original name doesn't work either: omarchy webapp remove "http://127.0.0.1:4000" targets .../http:/127.0.0.1:4000.desktop, but the actual file is .../http:/127.0.0.1:4000/.desktop.

Manual cleanup: rm -rf ~/.local/share/applications/http:

Steps to reproduce

omarchy webapp install "http://example.test/oops" "https://example.com" hey

ls ~/.local/share/applications/
# → a directory "http:" containing "example.test/oops.desktop"

omarchy webapp remove "http://example.test/oops"   # notification says removed, file remains
omarchy webapp remove                               # picker entry can't resolve back to the real path

Expected

Either the name is sanitized/rejected (no / in $APP_NAME, similar to what safe_icon_name already does for icons), or at minimum removal works on whatever install created.

Suggested fix

  1. In omarchy-webapp-install: validate APP_NAME (reject or strip /) before composing DESKTOP_FILE. The mkdir -p "$(dirname ...)" then becomes a plain mkdir -p of the applications dir.
  2. In omarchy-webapp-remove: remember the full path found by find and delete that, instead of reconstructing $DESKTOP_DIR/$APP_NAME.desktop from the displayed basename. That would also make removal robust to any other odd names that slip through.

Related: #1092 covered spaces in names breaking removal; this is the slash variant, with the extra twist that install itself writes an invalid layout.

System

  • Omarchy version: 4.0.0.r1772.gf32ebbd-1
  • Hardware-independent — pure script-logic bug in bin/omarchy-webapp-install / bin/omarchy-webapp-remove, reproduced from the packaged scripts.

curatingbits avatar Aug 23 '26 15:08 curatingbits