Sunday 22 October 2023

Linux Shortcuts and Auto Updating AppImages

A minor annoyance with software deployed as AppImages that auto update is each update breaks any shortcuts you've created.

The trick is not to create the shortcut directly to the file, e.g.

  /home/me/software/myappname-v32831.38474-linux-x86_64.AppImage 
  


Instead create the shortcut to run the "find" command so it locates any file in that folder starting with the same text and launches it, regardless of the version number.

find /home/me/software/ -name myappname-* -exec {} \; 


Could introduce problems so there are a few assumptions/caveats:
  • The app is saved/run from /home/me/software/ in the above example
  • You're aware this is just launching any file in that folder with the right name, so if other users can access it then they could replace it and you'll launch their file
  • The AppImage update process needs to delete the old file, otherwise you'd have to modify the find command to sort by date

Read more...