Skip to content

Instantly share code, notes, and snippets.

@ZaLiTHkA
Last active June 27, 2024 11:39
Show Gist options
  • Save ZaLiTHkA/f99619744c7e3cb3f4f19dbd15b65801 to your computer and use it in GitHub Desktop.
Save ZaLiTHkA/f99619744c7e3cb3f4f19dbd15b65801 to your computer and use it in GitHub Desktop.
# custom Toolbox scripts
# export PATH="$PATH:$HOME/.local/share/JetBrains/Toolbox/scripts"
export PATH="$PATH:$HOME/tools/jetbrains-toolbox-wrappers/scripts"
#!/usr/bin/env bash
destination_folder="$HOME/tools/jetbrains-toolbox-wrappers/scripts"
if [[ ! "${PATH//:/ }" =~ "$destination_folder" ]]; then
echo "NOTE: custom scripts folder is not currently in PATH.."
fi
if [ ! -d "$destination_folder" ]; then
mkdir -p "$destination_folder"
fi
for file in "$HOME/.local/share/JetBrains/Toolbox/scripts/"*; do
filename=$(basename "$file")
cp "$file" "$destination_folder/$filename"
echo " &> /dev/null &" >> "$destination_folder/$filename"
done
echo "custom launcher scripts updated"
exit 0
@ZaLiTHkA
Copy link
Author

IMPORTANT NOTE: this intentionally avoids directly modifying your .bashrc file or updating your PATH variable.. because if you don't use Bash, then you will obviously need to do something different here. these are one-time changes in your own environment, after which this script will "Just Work"(tm).

usage-wise, this script must be manually executed each time JetBrains ToolBox installs an IDE update, because that will result in a new shell launcher script being created in the $HOME/.local/share/JetBrains/Toolbox/scripts folder.

I may expand on this idea in the future, but for now this meets my personal needs, so anything more than this is dangerously close to over-engineering a (hopefully temporary) workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment