import bpy
from bpy.app.handlers import persistent

@persistent
def setup_gp_render_workspace():

    scn = bpy.context.scene
    if not scn.camera:
        scn.camera = next((o for o in scn.objects if o.type == 'CAMERA'), None)

    # Use rendered preview shading.
    for screen in bpy.data.screens:
        for area in screen.areas:
            for space in area.spaces:
                if space.type == 'VIEW_3D':
                    space.region_3d.view_perspective = 'CAMERA'

def register():
    bpy.app.handlers.load_post.append(setup_gp_render_workspace)

def unregister():
    bpy.app.handlers.load_factory_startup_post.remove(setup_gp_render_workspace)