Install the extension on /usr/share/gnome-shell/extensions/ instead of $HOME/.local/share/gnome-shell/extensions/ if the script is running with super user permissions.