Create a k9-atom launcher
Background
So you are allergic to terminals and want to launch atom from a desktop icon, first you need to understand why we suggest starting from a terminal:-
-
It is usual to install gems locally
-
Paths to gem executables are not on system path
-
Launching atom in the regular way does not respect the local environment
Creating a custom bash script to launch atom
You could create this script in you home directory
atom-k9
#!/usr/bin/env bash
# export JAVA_HOME="wherever"
# export GEM_HOME="/home/tux/.gem/ruby/2.5.0"
# export GEM_PATH="/home/tux/.gem/ruby/2.5.0"
# export PATH="${PATH}:${GEM_PATH}/bin:${HOME}/bin:${JAVA_HOME}/bin"
k9=`which k9`
if [[ $k9 == /* ]]
then
atom
else
echo -e "You need to 'gem install jruby_art'"
echo -e "and ensure k9 is on your path"
echo -e "you could edit 'atom-k9.sh' to do this"
echo -e "before loading atom"
exit
fi
For testing purposes bash atom-k9
and you might find atom will load for you and you will be able to run sketches (otherwise warning messages should be helpful). But this is worse than before, so first make the script executable:-
chmod +x atom-k9
now you could ./atom-k9
run it, or install it to say /usr/local/bin/atom-k9
so is is now on your path.
So now you can run it atom-k9
, but this time atom will probably not run, which is where the commented out lines come in (but you will need to adjust these to your local environment and uncomment them to get the script working again).
If the script works you can the create a desktop launcher for the atom-script
and you are done.