← Retour

choix.lua

mon_menu/src/affichage/choix.lua
local ansi = require ("affichage.ansi")

local  module_choix = {}


function module_choix.application () -- Fonction choisir ses options d actions
	print(ansi.orange .. "┌─ OPTIONS ──────────────────────")
    print("│  [1] Lancer serveur graphique")
    print("│  [2] Mise à jour système")
    print("│  [3] Quitter le programme")
    print("└────────────────────────────────" .. ansi.reset )

	io.write("Votre choix : ")

		local choix = io.read()
		  if choix == "1" then
		    print (" dwm SUCKS")
		    return true
		    
		  elseif choix == "2" then
		    os.execute("sudo apt update && sudo apt upgrade")
		    return true
		    
		  elseif choix == "3" then
		    print("─ Au revoir ─────────────────────")
		    return false
		    
		  else 
		    print ("Choix invalide")
		    return true
		    
		  end
end

return module_choix