A trapping mechanism for propelled colloidal particles based on an inhomogeneous drive is presented and studied by means of computer simulations. In experiments this method can be realized using photophoretic Janus particles driven by a light source, which shines through a shading mask and leads to an accumulation of the particles in the passive part. An equation for an accumulation parameter is derived using the effective inhomogeneous diffusion constant generated by the inhomogeneous drive. The impact of particle interaction on the trapping mechanism is studied, as well as the interplay between passivity-induced trapping and the emergent self-clustering of systems containing a high density of active particles. The combination of both effects makes the clusters more controllable for applications.