  The chiral magnetic effect is a phenomenon where an electromagnetic current
is generated along a magnetic field. Recently, in nonequilibrium systems,
negative longitudinal magnetoresistance has been observed experimentally in
Dirac/Weyl semimetals, which provides evidence for the chiral magnetic effect
as a nonequilibrium current. On the other hand, the emergence of the chiral
magnetic effect as an equilibrium current is still controversial. We propose a
possible realization of the chiral magnetic effect as an equilibrium current
using inhomogeneous magnetic fields. By employing tight-binding calculations
and linear response theory, we demonstrate that a finite current density is
generated by inhomogeneous magnetic fields, while the spatial integration of
the current is equal to zero, which is consistent with the so-called "no-go
theorem" of the chiral magnetic effect in real lattice systems. Moreover, we
propose an experimental setup to detect the effect in Weyl semimetal materials.
