← Retour

main.lua

mon_menu/version/v002/main.lua
--LUA
--Menu dans le terminal
--Version 1.1
--2026





-- =========================
-- 00. IMPORTS
-- =========================

local module_titre = require("affichage.titre")

-- =====================================
-- Définition des fonctions
-- =====================================



function  titre() -- Fonction titre  principal de l'application

	print ("------------------")
	print ("-Mon Super Menu---")
	print ("------------------")
end

function choixApplication () -- Fonction choisir ses options d actions
	print ("Lancer serveur graphique choix: 1")
	print ("Lancer Mise a jour systeme choix: 2")
	print ("Quitter le programme: 3")

	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
-- =====================================
-- Lancement du programme boucle principale
-- =====================================

function lancerProgramme ()
  local continuer = true
   while continuer do
        module_titre.afficher()
        continuer = choixApplication()
        
    end
 end  

-- =====================================
-- Programme principal
-- =====================================
 lancerProgramme ()