Skip to content

fix: auto-register Linux desktop icon on portable app start - #123

Open
VoidK2 wants to merge 1 commit into
router-for-me:mainfrom
VoidK2:fix/linux-portable-desktop-icons
Open

fix: auto-register Linux desktop icon on portable app start#123
VoidK2 wants to merge 1 commit into
router-for-me:mainfrom
VoidK2:fix/linux-portable-desktop-icons

Conversation

@VoidK2

@VoidK2 VoidK2 commented Aug 12, 2026

Copy link
Copy Markdown

Summary

Linux portable installs are just an extracted tarball. Without a proper FreeDesktop entry, app menu / desktop launchers often show a generic settings-style icon.

Users should not have to run an install script after every extract/update.

Approach

On Linux app startup, if this looks like a portable install (portable-app.json next to the executable):

  1. Write ~/.local/share/icons/hicolor/256x256/apps/easycliproxyapi.png (embedded from existing src-tauri/icons/128x128@2x.png)
  2. Write/refresh ~/.local/share/applications/easycliproxyapi.desktop with absolute Exec= and Icon=
  3. Best-effort update-desktop-database / gtk-update-icon-cache
  4. Failures are logged only — never block startup

No packaging/script/README changes. No new user-facing step: open the app once after install/move.

Files

  • src-tauri/src/linux_desktop.rs (new)
  • src-tauri/src/main.rs (call from setup)

Test plan

  • Unit tests for desktop entry content (absolute paths, quoting, embedded PNG header)
  • cargo test linux_desktop on Linux CI
  • Extract portable tarball, launch app once, confirm menu icon is the real logo
  • Move install directory, relaunch — desktop entry Exec= updates

@VoidK2
VoidK2 force-pushed the fix/linux-portable-desktop-icons branch from 3ee2bc1 to 57f0008 Compare August 12, 2026 08:46
@VoidK2 VoidK2 changed the title fix: ship multi-size Linux desktop icons in portable package fix: include Linux desktop icon helper in portable package Aug 12, 2026
@VoidK2
VoidK2 force-pushed the fix/linux-portable-desktop-icons branch from 57f0008 to 19f436e Compare August 12, 2026 08:55
@VoidK2 VoidK2 changed the title fix: include Linux desktop icon helper in portable package fix: auto-register Linux desktop icon on portable app start Aug 12, 2026
Portable Linux installs were launched from a tarball with no FreeDesktop
entry, so launchers often fell back to a generic settings-style icon.

On Linux startup, when portable-app.json is present next to the binary,
silently refresh a user-level .desktop entry and a 256px icon under
XDG_DATA_HOME. Uses the existing Tauri icon asset via include_bytes.
No install script and no packaging layout change; failures are logged
only and never block startup.
@VoidK2
VoidK2 force-pushed the fix/linux-portable-desktop-icons branch from 19f436e to 361fcf9 Compare August 12, 2026 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant