  The modified Becke-Johnson meta-GGA potential of density functional theory
has been shown to be the best exchange-correlation potential to determine band
gaps of crystalline solids. However, it cannot be consistently used for the
electronic structure of non-periodic or nanostructured systems. We propose an
extension of this potential that enables its use to study heterogeneous, finite
and low-dimensional systems. This is achieved by using a coordinate-dependent
expression for the parameter $c$ that weights the Becke-Russel exchange, in
contrast to the original global formulation, where $c$ is just a fitted number.
Our potential takes advantage of the excellent description of band gaps
provided by the modified Becke-Johnson potential and preserves its modest
computational effort. Furthermore, it yields with one single calculation band
diagrams and band offsets of heterostructures and surfaces. We exemplify the
usefulness and efficiency of our local meta-GGA potential by testing it for a
series of interfaces (Si/SiO$_2$, AlAs/GaAs, AlP/GaP, and GaP/Si), a Si
surface, and boron nitride monolayer.
