  We consider two-dimensional Ising strip bounded by two planar, inhomogeneous
walls. The inhomogeneity of each wall is modeled by a magnetic field acting on
surface spins. It is equal to $+h_1$ except for a group of $N_1$ sites where it
is equal to $-h_1$. The inhomogeneities of the upper and lower wall are shifted
with respect to each other by a lateral distance $L$. Using exact
diagonalization of the transfer matrix, we study both the lateral and normal
critical Casimir forces as well as magnetization profiles for a wide range of
temperatures and system parameters. The lateral critical Casimir force tends to
reduce the shift between the inhomogeneities, and the excess normal force is
attractive. Upon increasing the shift $L$ we observe, depending on the
temperature, three different scenarios of breaking of the capillary bridge of
negative magnetization connecting the inhomogeneities of the walls across the
strip. As long as there exists a capillary bridge in the system, the magnitude
of the excess total critical Casimir force is almost constant, with its
direction depending on $L$. By investigating the bridge morphologies we have
found a relation between the point at which the bridge breaks and the
inflection point of the force. We provide a simple argument that some of the
properties reported here should also hold for a whole range of different models
of the strip with the same type of inhomogeneity.
