A possible unified model of short and long gamma-ray bursts ( GRBs ) , X-ray rich GRBs , and X-ray flashes is proposed . It is assumed that the jet of a GRB consists of many emitting sub-shells ( i.e. , an inhomogeneous jet model ) . The multiplicity of the sub-shells along a line of sight n _ { s } is an important parameter . If n _ { s } is large ( \gg 1 ) the event looks like a long GRB , while if n _ { s } = 1 , the event looks like a short GRB . Finally , when n _ { s } = 0 , the event looks like an X-ray flash or an X-ray rich GRB . Furthermore , our model may also explain the bimodal distributions of T _ { 90 } duration of BATSE-GRBs . Clearly , our model predicts that short GRBs should be associated with energetic SNe .