This commit is contained in:
MacRimi 2025-03-02 19:50:59 +01:00
parent 22c4b7421c
commit 5d0d12c9ce
2 changed files with 32 additions and 43 deletions

View File

@ -157,11 +157,11 @@ apt_upgrade() {
fi fi
# Enable Proxmox testing repository # Enable Proxmox testing repository
if [ ! -f /etc/apt/sources.list.d/pve-testing-repo.list ] || ! grep -q "pvetest" /etc/apt/sources.list.d/pve-testing-repo.list; then # if [ ! -f /etc/apt/sources.list.d/pve-testing-repo.list ] || ! grep -q "pvetest" /etc/apt/sources.list.d/pve-testing-repo.list; then
msg_info "$(translate "Enabling Proxmox testing repository...")" # msg_info "$(translate "Enabling Proxmox testing repository...")"
echo -e "deb http://download.proxmox.com/debian/pve ${OS_CODENAME} pvetest\\n" > /etc/apt/sources.list.d/pve-testing-repo.list # echo -e "deb http://download.proxmox.com/debian/pve ${OS_CODENAME} pvetest\\n" > /etc/apt/sources.list.d/pve-testing-repo.list
msg_ok "$(translate "Proxmox testing repository enabled")" # msg_ok "$(translate "Proxmox testing repository enabled")"
fi # fi
# Configure main Debian repositories # Configure main Debian repositories
if ! grep -q "${OS_CODENAME}-security" /etc/apt/sources.list; then if ! grep -q "${OS_CODENAME}-security" /etc/apt/sources.list; then
@ -1986,6 +1986,11 @@ configure_fastfetch() {
msg_ok "$(translate "Fastfetch is already installed")" msg_ok "$(translate "Fastfetch is already installed")"
fi fi
# Create initial config file if it doesn't exist
if [ ! -f "$fastfetch_config" ]; then
echo '{"modules": []}' > "$fastfetch_config"
fi
while true; do while true; do
# Define logo options # Define logo options
local logo_options=("ProxMenux" "Proxmox (default)" "Comunidad Helper-Scripts" "Home-Labs-Club" "Proxmology" "Custom") local logo_options=("ProxMenux" "Proxmox (default)" "Comunidad Helper-Scripts" "Home-Labs-Club" "Proxmology" "Custom")
@ -2087,33 +2092,36 @@ configure_fastfetch() {
done done
# Modify Fastfetch modules to display custom title # Modify Fastfetch modules to display custom title
msg_info "$(translate "Modifying Fastfetch configuration...")" msg_info "$(translate "Modifying Fastfetch configuration...")"
# Eliminar "title" si existe en la configuración # Use temporary files for jq operations
jq '.modules |= map(select(. != "title"))' ~/.config/fastfetch/config.jsonc > ~/.config/fastfetch/config.jsonc.tmp && mv ~/.config/fastfetch/config.jsonc.tmp ~/.config/fastfetch/config.jsonc local temp_config=$(mktemp)
# Asegurar que solo haya una entrada "custom" # Remove "title" if it exists in the configuration
jq 'del(.modules[] | select(type == "object" and .type == "custom"))' ~/.config/fastfetch/config.jsonc > ~/.config/fastfetch/config.jsonc.tmp && mv ~/.config/fastfetch/config.jsonc.tmp ~/.config/fastfetch/config.jsonc jq '.modules |= map(select(. != "title"))' "$fastfetch_config" > "$temp_config" && mv "$temp_config" "$fastfetch_config"
# Agregar la entrada "custom" al inicio de los módulos si no existe # Ensure there's only one "custom" entry
jq '.modules |= [{"type": "custom", "format": "\u001b[1;38;5;166mSystem optimised by ProxMenux\u001b[0m"}] + .' ~/.config/fastfetch/config.jsonc > ~/.config/fastfetch/config.jsonc.tmp && mv ~/.config/fastfetch/config.jsonc.tmp ~/.config/fastfetch/config.jsonc jq 'del(.modules[] | select(type == "object" and .type == "custom"))' "$fastfetch_config" > "$temp_config" && mv "$temp_config" "$fastfetch_config"
msg_ok "$(translate "Fastfetch now displays: System optimised by: ProxMenux")" # Add the "custom" entry to the beginning of the modules
jq '.modules |= [{"type": "custom", "format": "\u001b[1;38;5;166mSystem optimised by ProxMenux\u001b[0m"}] + .' "$fastfetch_config" > "$temp_config" && mv "$temp_config" "$fastfetch_config"
# Regenerar configuración (evita que Fastfetch sobrescriba cambios) msg_ok "$(translate "Fastfetch now displays: System optimised by: ProxMenux")"
fastfetch --gen-config > /dev/null 2>&1
msg_ok "$(translate "Fastfetch configuration updated")"
# Eliminar instancias previas de Fastfetch en bashrc y perfiles # Regenerate configuration (prevents Fastfetch from overwriting changes)
sed -i '/fastfetch/d' ~/.bashrc ~/.profile /etc/profile fastfetch --gen-config > /dev/null 2>&1
rm -f /etc/update-motd.d/99-fastfetch msg_ok "$(translate "Fastfetch configuration updated")"
# Agregar Fastfetch a ~/.bashrc para que se ejecute en cada inicio de sesión # Remove previous instances of Fastfetch in bashrc and profiles
echo "clear && fastfetch" >> ~/.bashrc sed -i '/fastfetch/d' ~/.bashrc ~/.profile /etc/profile
msg_ok "$(translate "Fastfetch will start automatically in the console")" rm -f /etc/update-motd.d/99-fastfetch
msg_success "$(translate "Fastfetch installation and configuration completed")" # Add Fastfetch to ~/.bashrc to run on each login
echo "clear && fastfetch" >> ~/.bashrc
msg_ok "$(translate "Fastfetch will start automatically in the console")"
msg_success "$(translate "Fastfetch installation and configuration completed")"
} }

View File

@ -120,25 +120,6 @@ export default function PerformanceSettingsPage() {
If the output mentions <code>pigz</code>, the replacement was successful. If the output mentions <code>pigz</code>, the replacement was successful.
</p> </p>
<h4 className="text-lg font-semibold mt-6">Performance Test: gzip vs. pigz</h4>
<p className="mb-4">
To measure the speed difference between gzip and pigz, try compressing a large file:
</p>
<CopyableCode
code={`
# Compress a file using gzip (single-threaded)
time gzip largefile.img
# Compress a file using pigz (multi-threaded)
time pigz largefile.img
`}
/>
<p className="mb-4">
Since pigz utilizes multiple CPU cores, the compression process should be significantly faster.
</p>
<p className="mt-4"> <p className="mt-4">
With this optimization, vzdump backups and all gzip compression tasks benefit from parallel processing, With this optimization, vzdump backups and all gzip compression tasks benefit from parallel processing,