From 97576d2087ec15ef9121ed5d836f30804f9ca906 Mon Sep 17 00:00:00 2001 From: Angaddeep Singh Date: Thu, 19 Sep 2024 07:04:27 +0530 Subject: [PATCH] Added DNF configuration and Multimedia Support for fedora and other Redhat Distros (#438) * First commit * Small enhancements * Update configure-dnf.sh * update * Update configure-dnf.sh * update * Update multimedia-codecs.sh * Update multimedia-codecs.sh --- tabs/system-setup/fedora/configure-dnf.sh | 23 ++++++++++++++++ tabs/system-setup/fedora/multimedia-codecs.sh | 26 +++++++++++++++++++ tabs/system-setup/fedora/rpm-fusion-setup.sh | 1 + tabs/system-setup/tab_data.toml | 8 ++++++ 4 files changed, 58 insertions(+) create mode 100644 tabs/system-setup/fedora/configure-dnf.sh create mode 100644 tabs/system-setup/fedora/multimedia-codecs.sh diff --git a/tabs/system-setup/fedora/configure-dnf.sh b/tabs/system-setup/fedora/configure-dnf.sh new file mode 100644 index 00000000..af460545 --- /dev/null +++ b/tabs/system-setup/fedora/configure-dnf.sh @@ -0,0 +1,23 @@ +#!/bin/sh -e + +. ../../common-script.sh + +configureDNF() { + case $PACKAGER in + dnf) + printf "%b\n" ${YELLOW}"Configuring DNF...${RC}" + $ESCALATION_TOOL sed -i '/^max_parallel_downloads=/c\max_parallel_downloads=10' /etc/dnf/dnf.conf || echo 'max_parallel_downloads=10' >> /etc/dnf/dnf.conf + echo "fastestmirror=True" | $ESCALATION_TOOL tee -a /etc/dnf/dnf.conf > /dev/null + echo "defaultyes=True" | $ESCALATION_TOOL tee -a /etc/dnf/dnf.conf > /dev/null + $ESCALATION_TOOL "$PACKAGER" -y install dnf-plugins-core + printf "%b\n" "${GREEN}DNF Configured Succesfully...${RC}" + ;; + *) + printf "%b\n" "${RED}Unsupported distribution: $DTYPE${RC}" + ;; + esac +} + +checkEnv +checkEscalationTool +configureDNF diff --git a/tabs/system-setup/fedora/multimedia-codecs.sh b/tabs/system-setup/fedora/multimedia-codecs.sh new file mode 100644 index 00000000..a5db96a7 --- /dev/null +++ b/tabs/system-setup/fedora/multimedia-codecs.sh @@ -0,0 +1,26 @@ +#!/bin/sh -e + +. ../../common-script.sh + +multimedia() { + case $PACKAGER in + dnf) + if [ -e /etc/yum.repos.d/rpmfusion-free.repo ] && [ -e /etc/yum.repos.d/rpmfusion-nonfree.repo ]; then + printf "%b\n" "${YELLOW}Installing Multimedia Codecs...${RC}" + $ESCALATION_TOOL "$PACKAGER" swap ffmpeg-free ffmpeg --allowerasing -y + $ESCALATION_TOOL "$PACKAGER" update @multimedia --setopt="install_weak_deps=False" --exclude=PackageKit-gstreamer-plugin -y + $ESCALATION_TOOL "$PACKAGER" update @sound-and-video -y + printf "%b\n" "${GREEN}Multimedia Codecs Installed...${RC}" + else + printf "%b\n" "${RED}RPM Fusion repositories not found. Please set up RPM Fusion first!${RC}" + fi + ;; + *) + printf "%b\n" "${RED}Unsupported distribution: $DTYPE${RC}" + ;; + esac +} + +checkEnv +checkEscalationTool +multimedia \ No newline at end of file diff --git a/tabs/system-setup/fedora/rpm-fusion-setup.sh b/tabs/system-setup/fedora/rpm-fusion-setup.sh index e73bc001..d8b0e2ac 100644 --- a/tabs/system-setup/fedora/rpm-fusion-setup.sh +++ b/tabs/system-setup/fedora/rpm-fusion-setup.sh @@ -23,4 +23,5 @@ installRPMFusion() { } checkEnv +checkEscalationTool installRPMFusion diff --git a/tabs/system-setup/tab_data.toml b/tabs/system-setup/tab_data.toml index 19dd00ef..178a5680 100644 --- a/tabs/system-setup/tab_data.toml +++ b/tabs/system-setup/tab_data.toml @@ -36,6 +36,14 @@ name = "RPM Fusion Setup" description = "RPM Fusion provides software that the Fedora Project or Red Hat doesn't want to ship.\nThat software is provided as precompiled RPMs for all current Fedora versions and current Red Hat Enterprise Linux or clones versions; you can use the RPM Fusion repositories with tools like yum and PackageKit.\nFor more information visit: https://rpmfusion.org/" script = "fedora/rpm-fusion-setup.sh" +[[data.entries]] +name = "Configure DNF" +script = "fedora/configure-dnf.sh" + +[[data.entries]] +name = "Multimedia Setup" +script = "fedora/multimedia-codecs.sh" + [[data]] name = "Full System Cleanup" script = "system-cleanup.sh"