From f6e0b4f7b6cc5406b40d39a2ccf5e1eed971bee3 Mon Sep 17 00:00:00 2001 From: Chris Titus Date: Tue, 23 Jul 2024 16:14:17 -0500 Subject: [PATCH] add global theme --- src/commands/common-script.sh | 2 +- src/commands/system-setup/3-global-theme.sh | 65 +++++++++++++++++++++ src/list.rs | 4 ++ 3 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 src/commands/system-setup/3-global-theme.sh diff --git a/src/commands/common-script.sh b/src/commands/common-script.sh index a97a284f..a6f31515 100644 --- a/src/commands/common-script.sh +++ b/src/commands/common-script.sh @@ -78,7 +78,7 @@ checkDistro() { checkEnv() { checkCommandRequirements 'curl groups sudo' - checkPackageHandler 'apt-get dnf pacman zypper' + checkPackageManager 'apt-get dnf pacman zypper' checkSuperUser checkDistro } diff --git a/src/commands/system-setup/3-global-theme.sh b/src/commands/system-setup/3-global-theme.sh new file mode 100644 index 00000000..915684b1 --- /dev/null +++ b/src/commands/system-setup/3-global-theme.sh @@ -0,0 +1,65 @@ +#!/bin/sh -e + +# Check if the home directory and linuxtoolbox folder exist, create them if they don't +LINUXTOOLBOXDIR="$HOME/linuxtoolbox" + +if [ ! -d "$LINUXTOOLBOXDIR" ]; then + echo -e "${YELLOW}Creating linuxtoolbox directory: $LINUXTOOLBOXDIR${RC}" + mkdir -p "$LINUXTOOLBOXDIR" + echo -e "${GREEN}linuxtoolbox directory created: $LINUXTOOLBOXDIR${RC}" +fi + +cd "$LINUXTOOLBOXDIR" || exit + +install_theme_tools() { + echo -e "${YELLOW}Installing theme tools (qt6ct and kvantum)...${RC}" + case $PACKAGER in + apt-get) + sudo apt-get update + sudo apt-get install -y qt6ct kvantum + ;; + zypper) + sudo zypper refresh + sudo zypper --non-interactive install qt6ct kvantum + ;; + dnf) + sudo dnf update + sudo dnf install -y qt6ct kvantum + ;; + pacman) + sudo pacman -Sy + sudo pacman --noconfirm -S qt6ct kvantum + ;; + *) + echo -e "${RED}Unsupported package manager. Please install qt6ct and kvantum manually.${RC}" + exit 1 + ;; + esac +} + +configure_qt6ct() { + echo -e "${YELLOW}Configuring qt6ct...${RC}" + mkdir -p "$HOME/.config/qt6ct" + cat < "$HOME/.config/qt6ct/qt6ct.conf" +[Appearance] +style=kvantum +color_scheme=default +icon_theme=breeze +EOF + echo -e "${GREEN}qt6ct configured successfully.${RC}" +} + +configure_kvantum() { + echo -e "${YELLOW}Configuring Kvantum...${RC}" + mkdir -p "$HOME/.config/Kvantum" + cat < "$HOME/.config/Kvantum/kvantum.kvconfig" +[General] +theme=Breeze +EOF + echo -e "${GREEN}Kvantum configured successfully.${RC}" +} + +checkEnv +install_theme_tools +configure_qt6ct +configure_kvantum \ No newline at end of file diff --git a/src/list.rs b/src/list.rs index 15287d07..b9d50753 100644 --- a/src/list.rs +++ b/src/list.rs @@ -92,6 +92,10 @@ impl CustomList { name: "Gaming Dependencies", command: with_common_script!("commands/system-setup/2-gaming-setup.sh"), }, + ListNode { + name: "Global Theme", + command: with_common_script!("commands/system-setup/3-global-theme.sh"), + }, ListNode { name: "Recursion?", command: "cargo run"