Skip to content

Instantly share code, notes, and snippets.

@haxwithaxe
Created September 14, 2025 22:34
Show Gist options
  • Select an option

  • Save haxwithaxe/9fdc75a01f7a833524607f4298c3bf53 to your computer and use it in GitHub Desktop.

Select an option

Save haxwithaxe/9fdc75a01f7a833524607f4298c3bf53 to your computer and use it in GitHub Desktop.
Creates a script to launch a flatpak (optionally with flatpak run args) from the cli with the app name
#!/bin/bash
set -e
usage() {
echo "$0 <app name> <flatpak> [flatpak run args]"
}
case $1 in
-h|--help|help)
usage
exit 1
;;
*)
APP_NAME=$1
shift
;;
esac
if [[ -z $1 ]]; then
usage
exit 1
fi
echo '#!/bin/sh' > "$HOME/.local/bin/$APP_NAME"
echo "flatpak run $@" >> "$HOME/.local/bin/$APP_NAME"
chmod u=rwx,g=rx,o=rx "$HOME/.local/bin/$APP_NAME"
echo Created "$HOME/.local/bin/$APP_NAME with 'flatpak run $@'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment