bash-startup
·209 words·1 min
bash_startup #
A program that runs every time I open a terminal
More complex things I want to run when my bashrc runs (external scripts)
bash_startup #
Description #
There are two scripts, the first bash_startup
are written in crystal and c++.
This script will search through my bashrc and find aliases
Example #
start_alias_show () {
bash_startup_cpp
}
# Checks if bash_startup_cpp is installed, then run it
if [ 2>/dev/null 1>/dev/null $(which bash_startup_cpp) ]; then
start_alias_show
else
echo "Install bash_startup_cpp and add it to your PATH"
fi
cheat_sheet_startup #
Description #
The second script is cheat_sheet_startup
and will pull cheat sheets from cht.sh.
This script is written in python.
Example #
# It will print the last cheat sheet located at `~/.cht_sheet_entry`
# then it will pull the next one in the background so the perceived time
# it takes to run is just the time it takes to read the cht_sheet_entry
start_cheat_sheet () {
# Print the cheat sheet pulled last run
cheat_sheet_startup print
# Pulling the cheat sheet (takes a few seconds)
(cheat_sheet_startup pull &)
}
# Checks if the script is installed, then runs it
if [ 2>/dev/null 1>/dev/null $(which cheat_sheet_startup) ]; then
start_cheat_sheet
else
echo "Install cheat_sheet_startup and add it to your PATH"
fi