Created
September 14, 2025 22:34
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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