Skip to content

Instantly share code, notes, and snippets.

@Ghostbird
Created September 23, 2022 08:17
Show Gist options
  • Save Ghostbird/49c4fe7f2a3d248daf4b50c4a549f184 to your computer and use it in GitHub Desktop.
Save Ghostbird/49c4fe7f2a3d248daf4b50c4a549f184 to your computer and use it in GitHub Desktop.
Script that prompts to mark AppImage executable, and subsequently launch it
#!/bin/bash
# Put this script somewhere, and mark it as the default program to open AppImage files.
# Now if you click an AppImage that's not marked as executable,
# it will prompt whether you want to make it so, and launch it.
zenity --question \
--title 'AppImage is not executable' \
--text 'This AppImage is not marked as executable. Do you want to mark it as executable and launch the program?' \
--width=512
if [[ $? = 0 ]]
then
chmod u+x $1
"$@"
fi
@Ghostbird
Copy link
Author

Note: This is a user-convenience script. It won't cover all scenarios:

  • Won't work if you don't have zenity installed
  • Won't work if the AppImage is not owned by the current user
  • You must mark this script as executable and set it to be the default program to open AppImages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment