For security reasons, I think that running **whole** script as root is highly dangerous, or at least, may seem like that for the user. Consider running only particular commands *inside* the scripts (e.g. `pacman`) with sudo explicitly.