This way each application has to be specifically modified to use $SNAP_USER_COMMON instead of $HOME? Why not let the applications keep using $HOME but add an option to snapcraft.yaml that would specify what exactly to set $HOME to, with options like “real home”, “versioned snap directory”, “common snap directory”? (So none of the REALHOME=$(getent passwd $(id -u) | cut -d ':' -f 6) nonsense.)
This way each application has to be specifically modified to use $SNAP_USER_COMMON instead of $HOME? Why not let the applications keep using $HOME but add an option to snapcraft.yaml that would specify what exactly to set $HOME to, with options like “real home”, “versioned snap directory”, “common snap directory”? (So none of the REALHOME=$(getent passwd $(id -u) | cut -d ':' -f 6) nonsense.)