After unification of Italy, the early Italian colonists petitioned the king to annex Tunisia (IIRC, it was in 1865 or thereof).
Nothing came out of it, since the Roman question and the Veneto issue were dominant.
Maybe it would have taken some incident between the local population and the Italian colonists (it is irrelevant if the bey is behind it or not).
Once the incidents happen, a military intervention is not a problem. The diplomatic side might be much more complicated, since I do feel that both the British and the French would not be completely happy with Italy controlling both sides of the channel of Sicily.