You "should" also be able to replace the /home/pi with the $HOME variable.