Conventional scintillator-based X-ray imaging typically captures the full spectral of X-ray photons without distinguishing their energy. However, the absence of X-ray spectral information often results in insufficient image contrast, particularly for substances possessing similar atomic numbers and densities. In this study, we present an innovative multi-energy X-ray linear-array detector that leverages side-illuminated X-ray scintillation using emerging metal halide Cs3Cu2I5. The negligible self-absorption characteristic not only improves the scintillation output but is also beneficial for improving the energy resolution for the side-illuminated scintillation scenarios. By exploiting Beer's law, which governs the absorption of X-ray photons with different energies, the incident X-ray spectral can be reconstructed by analyzing the distribution of scintillation intensity when the scintillator is illuminated from the side. The relative error between the reconstructed and measured X-ray spectral was less than 5.63 %. Our method offers an additional energy-resolving capability for X-ray linear-array detectors commonly used in computed tomography (CT) imaging setups, surpassing the capabilities of conventional energy-integration approaches, all without requiring extra hardware components. A proof-of-concept multi-energy CT imaging system featuring eight energy channels was successfully implemented. This study presents a simple and efficient strategy for achieving multi-energy X-ray detection and CT imaging based on emerging metal halides.