Add Visual Studio Code To $Path, But Code Is A Flatpak?

If your flatpak is vscodium and you want to run it using code command.

It is not much different than a java app packed as jar ([root tip] [How To] I have downloaded a program as a jar file - what now?)

Ensure the ~/.local/bin folder exist

mkdir -p ~/.local/bin

Create the script (this is a herefile - you could use any editor of choice (copy paste line 2 and 3))

cat << EOF > ~/.local/bin/code
#!/usr/bin/env bash
flatpak run com.vscodium.codium "\$@" &
EOF

Make the script executable

chmod +x ~/.local/bin/code