ajout test sur gestionnaire pkg

This commit is contained in:
lebartal committed 2026-01-24 18:54:08 +01:00
1 parent 3874911df2
commit 4432d6ac5d
2 files changed
+36 -21

No files matched your search

+22 -14
View File
@@ -24,25 +24,33 @@ GRAS='\e[1m'
SOULIGNE='\e[4m'
RESET="\e[0m"
#Verif gestionnaire packages
if command -v nala >/dev/null 2>&1 ; then
{
gest_pkg="nala"
};
else
{
gest_pkg="apt"
}
fi
# -------------- FONCTIONS ---------------
function maj_depot
{
#Actualisation depots
apt update
# Maj Systeme avant AutoInstall
apt full-upgrade -y
${gest_pkg} update
}
function maj_systeme
{
nala full-upgrade -y
${gest_pkg} full-upgrade -y
}
function maj_packages
{
nala upgrade -y
${gest_pkg} upgrade -y
}
function install_nala
@@ -57,18 +65,18 @@ function install_nerdfont
mkdir -p ~/.local/share/fonts/
#Installation de la Police
wget -o ~/.local/share/fonts/Hack.zip --download https://github.com/ryanoasis/nerd-fonts/releases/download/v3.4.0/Hack.zip
wget -o ~/.local/share/fonts/Hack.zip https://github.com/ryanoasis/nerd-fonts/releases/download/v3.4.0/Hack.zip
unzip ~/.local/share/fonts/Hack.zip
rm ~/.local/share/fonts/Hack.zip
#Mise a jour des polices
fc-cache -f
}
}-
function install_packages
{
add-apt-repository ppa:zhangsongcui3371/fastfetch -y
nala install btop duf httpie fastfetch
${gest_pkg} install btop duf httpie fastfetch
snap install lsd
}
@@ -78,8 +86,8 @@ function install_flatpaks
# 12/01/2026 desactivation des flatpak, ces derniers sont installables directement dans les depots de bases.
#Installation Flatpak
#add-apt-repository ppa:flatpak/stable -y
nala install flatpak -y
nala install gnome-software-plugin-flatpak -y
${gest_pkg} install flatpak -y
${gest_pkg} install gnome-software-plugin-flatpak -y
#flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
#Installation Packages Flatpak
@@ -90,20 +98,20 @@ function install_mainline
{
#Installation Mainline
add-apt-repository ppa:cappelikan/ppa -y
nala install mainline -y
${gest_pkg} install mainline -y
}
function install_atuin
{
#Installation Atuin
bash <(curl https://raw.githubusercontent.com/atuinsh/atuin/main/install.sh)
echo -e "${SOULIGNE}${VERT}Atuin est installe, merci de faire une deco/reco${RESET}"
echo -e "${SOULIGNE}${VERT}✅ Atuin est installe, merci de faire une deco/reco${RESET}"
}
function install_zsh
# ainsi que les plugins
{
nala install zsh -y
${gest_pkg} install zsh -y
#Configuration zsh+plugins
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
+14 -7
View File
@@ -20,7 +20,8 @@ YELLOW=$(tput setaf 3 2>/dev/null || printf '')
RESET=$(tput sgr0 2>/dev/null || printf '')
# ---------- Fonction de journalisation ----------
log() {
log()
{
# $1 = niveau (INFO|OK|ERR)
# $2 = message
case "$1" in
@@ -32,7 +33,8 @@ log() {
}
# ---------- Wrapper d’exécution de commande ----------
run_cmd() {
run_cmd()
{
# On exécute la commande passée en arguments séparés
# "$@" préserve les espaces éventuels dans chaque argument.
"$@"
@@ -46,27 +48,32 @@ run_cmd() {
}
# ---------- Étapes de mise à jour ----------
update_pkg_list() {
update_pkg_list()
{
log INFO "Mise à jour de la liste des paquets…"
run_cmd apt-get update -y
}
upgrade_installed() {
upgrade_installed()
{
log INFO "Mise à jour des paquets déjà installés…"
run_cmd apt-get upgrade -y
}
dist_upgrade_os() {
dist_upgrade_os()
{
log INFO "Dist-upgrade de l’OS…"
run_cmd apt-get dist-upgrade -y
}
autoremove_obsolete() {
autoremove_obsolete()
{
log INFO "Suppression des paquets obsolètes…"
run_cmd apt-get autoremove -y
}
clean_cache() {
clean_cache()
{
log INFO "Nettoyage du cache des paquets…"
run_cmd apt-get clean -y
}