Last active
April 4, 2020 23:46
-
-
Save dhhdev/dad1d7e4a483f8c2b418fe247a764c21 to your computer and use it in GitHub Desktop.
A collection of custom scripts mainly for sourcing, setting PATH etc.
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
# 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