Last active
August 24, 2022 16:41
-
-
Save AlexAtkinson/02df7249a78073309dbc66aac3d28cc5 to your computer and use it in GitHub Desktop.
ProTip: RC File Dependency Sanities
This file contains 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
# Include simple dependnecy checks for aliases. | |
# Set aliases only if dependnecy is available. | |
# An IF statement may makes more sense... | |
dep='xclip' | |
[[ ! $(command -v $dep) ]] && echo -e "\e[01;31mERROR:\e[0m ${BASH_SOURCE[0]} - $dep not available!" | |
[[ $(command -v $dep) ]] && alias clipc="xclip -selection c" | |
[[ $(command -v $dep) ]] && alias clipp="xclip -selection c -o" | |
[[ $(command -v $dep) ]] && alias clipv="clipp | less" | |
# Note: you could also name these aliases pbcopy/pbpaste, if that suits you. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment