Sort apps by magic and name