Fiber-based structured light including cylindrical vector beams (CVBs) and orbital angular momentum (OAM) has gained significant interest for its unique properties. In this work, we propose the concept of a programmable linearly polarized (LP)-mode synthesizer for general structured light generation, in which an LP-mode pool supporting independent and selectable LP-mode output is first established, and then different CVB/OAM modes could be generated in a general way through polarization and phase control. We demonstrate a proof-of-concept LP-mode synthesizer based on a fiber ring laser characterized by a partial five-LP mode weakly coupled few-mode fiber (FMF) cavity and an arbitrary LP-mode switch array. Various CVB/OAM beams including TE01, TM01, OAM±1 and OAM±2 modes are successfully generated. This approach provides new insights into mode manipulation methods, potentially enhancing the performance of optical quantum communications, optical fiber sensing and optical trapping applications.