In two dimensions, we consider the problem of inversion of the attenuated $X$-ray transform of a compactly supported function from data restricted to lines leaning on a given arc. We provide a method to reconstruct the function on the convex hull of this arc. The attenuation is assumed known. The method of proof uses the Hilbert transform associated with $A$-analytic functions in the sense of Bukhgeim.