Skip to content

Instantly share code, notes, and snippets.

@dhhdev
Last active April 4, 2020 23:46
Show Gist options
  • Save dhhdev/dad1d7e4a483f8c2b418fe247a764c21 to your computer and use it in GitHub Desktop.
Save dhhdev/dad1d7e4a483f8c2b418fe247a764c21 to your computer and use it in GitHub Desktop.
A collection of custom scripts mainly for sourcing, setting PATH etc.
# Making aliases for CLI to run flatpak sandboxes.
# I use zsh, but should be useable in bash as well.
# Requires find, basename
FLATPAK_ALIAS_PREFIX="fp"
FLATPAK_EXPORTS_PATH="/var/lib/flatpak/exports/bin"
FLATPAK_LIST=($(find $FLATPAK_EXPORTS_PATH -type l))
for FLATPAK_EXEC in "${FLATPAK_LIST[@]}"
do
# Get the actual executable name
EXEC_NAME=$(basename -- $FLATPAK_EXEC)
# Alias the executable to your CLI with a PREFIX
alias $FLATPAK_PREFIX.$EXEC_NAME=$FLATPAK_EXEC
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment