We study the atomic contributions to the nanoscale friction in layered MX2 (M = Mo, W; X = S, Se, Te) transition metal dichalcogenides by combining ab initio techniques with group theoretical analysis. Starting from stable atomic configurations, we propose a computational method, named Normal-Modes Transition Approximation (NMTA), to individuate possible sliding paths from only the analysis of the phonon modes of the stable geometry. The method provides a way to decompose the atomic displacements realizing the layer sliding in terms of phonon modes of the stable structure, so as to guide the selection and tuning of specific atomic motions promoting MX2 sheets gliding, and to adjust the corresponding energy barrier. The present results show that main contributions to the nanoscale friction are due to few low frequency phonon modes, corresponding to rigid shifts of MX2 layers. We also provide further evidences that a previously reported Ti-doped MoS2 phase is a promising candidate as new material with enhanced tribologic properties. The NMTA approach can be exploited to tune the energetic and the structural features of specific phonon modes, and, thanks to its general formulation, can also be applied to any solid state system, irrespective of the chemical composition and structural topology.