diff --git a/tabs/utils/auto-login.sh b/tabs/utils/auto-login.sh index aa73211c5..b5ce0131b 100644 --- a/tabs/utils/auto-login.sh +++ b/tabs/utils/auto-login.sh @@ -44,9 +44,9 @@ configure_lightdm() { printf "Enter username for LightDM autologin: " read -r user - $ESCALATION_TOOL "printf '[Seat:*]' > /etc/lightdm/lightdm.conf.d/50-autologin.conf" - $ESCALATION_TOOL "printf 'autologin-user=$user' >> /etc/lightdm/lightdm.conf.d/50-autologin.conf" - $ESCALATION_TOOL "printf 'autologin-user-timeout=0' >> /etc/lightdm/lightdm.conf.d/50-autologin.conf" + "$ESCALATION_TOOL" "printf '[Seat:*]' > /etc/lightdm/lightdm.conf.d/50-autologin.conf" + "$ESCALATION_TOOL" "printf 'autologin-user=$user' >> /etc/lightdm/lightdm.conf.d/50-autologin.conf" + "$ESCALATION_TOOL" "printf 'autologin-user-timeout=0' >> /etc/lightdm/lightdm.conf.d/50-autologin.conf" printf "LightDM has been configured for autologin.\n" } @@ -54,7 +54,7 @@ configure_lightdm() { # Function to remove LightDM autologin remove_lightdm_autologin() { printf "Removing LightDM autologin configuration...\n" - $ESCALATION_TOOL rm -f /etc/lightdm/lightdm.conf.d/50-autologin.conf + "$ESCALATION_TOOL" rm -f /etc/lightdm/lightdm.conf.d/50-autologin.conf printf "LightDM autologin configuration has been removed.\n" } @@ -65,9 +65,9 @@ configure_gdm() { printf "Enter username for GDM autologin: " read -r user - $ESCALATION_TOOL "printf '[daemon]' > /etc/gdm/custom.conf" - $ESCALATION_TOOL "printf 'AutomaticLoginEnable = true' >> /etc/gdm/custom.conf" - $ESCALATION_TOOL "printf 'AutomaticLogin = $user' >> /etc/gdm/custom.conf" + "$ESCALATION_TOOL" "printf '[daemon]' > /etc/gdm/custom.conf" + "$ESCALATION_TOOL" "printf 'AutomaticLoginEnable = true' >> /etc/gdm/custom.conf" + "$ESCALATION_TOOL" "printf 'AutomaticLogin = $user' >> /etc/gdm/custom.conf" printf "GDM has been configured for autologin.\n" } @@ -75,8 +75,8 @@ configure_gdm() { # Function to remove GDM autologin remove_gdm_autologin() { printf "Removing GDM autologin configuration...\n" - $ESCALATION_TOOL sed -i '/AutomaticLoginEnable/d' /etc/gdm/custom.conf - $ESCALATION_TOOL sed -i '/AutomaticLogin/d' /etc/gdm/custom.conf + "$ESCALATION_TOOL" sed -i '/AutomaticLoginEnable/d' /etc/gdm/custom.conf + "$ESCALATION_TOOL" sed -i '/AutomaticLogin/d' /etc/gdm/custom.conf printf "GDM autologin configuration has been removed.\n" } @@ -88,9 +88,9 @@ configure_sddm() { read -r user list_sessions # Show session options - $ESCALATION_TOOL "printf '[Autologin]' > /etc/sddm.conf" - $ESCALATION_TOOL "printf 'User=$user' >> /etc/sddm.conf" - $ESCALATION_TOOL "printf 'Session=$session' >> /etc/sddm.conf" + "$ESCALATION_TOOL" "printf '[Autologin]' > /etc/sddm.conf" + "$ESCALATION_TOOL" "printf 'User=$user' >> /etc/sddm.conf" + "$ESCALATION_TOOL" "printf 'Session=$session' >> /etc/sddm.conf" printf "SDDM has been configured for autologin.\n" } @@ -98,7 +98,7 @@ configure_sddm() { # Function to remove SDDM autologin remove_sddm_autologin() { printf "Removing SDDM autologin configuration...\n" - $ESCALATION_TOOL sed -i '/\[Autologin\]/,+2d' /etc/sddm.conf + "$ESCALATION_TOOL" sed -i '/\[Autologin\]/,+2d' /etc/sddm.conf printf "SDDM autologin configuration has been removed.\n" } @@ -110,8 +110,8 @@ configure_lxdm() { read -r user list_sessions # Show session options - $ESCALATION_TOOL sed -i "s/^#.*autologin=.*$/autologin=${user}/" /etc/lxdm/lxdm.conf - $ESCALATION_TOOL sed -i "s|^#.*session=.*$|session=/usr/bin/${session}|; s|^session=.*$|session=/usr/bin/${session}|" /etc/lxdm/lxdm.conf + "$ESCALATION_TOOL" sed -i "s/^#.*autologin=.*$/autologin=${user}/" /etc/lxdm/lxdm.conf + "$ESCALATION_TOOL" sed -i "s|^#.*session=.*$|session=/usr/bin/${session}|; s|^session=.*$|session=/usr/bin/${session}|" /etc/lxdm/lxdm.conf printf "LXDM has been configured for autologin.\n" } @@ -119,8 +119,8 @@ configure_lxdm() { # Function to remove LXDM autologin remove_lxdm_autologin() { printf "Removing LXDM autologin configuration...\n" - $ESCALATION_TOOL sed -i "s/^autologin=.*$/#autologin=/" /etc/lxdm/lxdm.conf - $ESCALATION_TOOL sed -i "s/^session=.*$/#session=/" /etc/lxdm/lxdm.conf + "$ESCALATION_TOOL" sed -i "s/^autologin=.*$/#autologin=/" /etc/lxdm/lxdm.conf + "$ESCALATION_TOOL" sed -i "s/^session=.*$/#session=/" /etc/lxdm/lxdm.conf printf "LXDM autologin configuration has been removed.\n" } diff --git a/tabs/utils/create-bootable-usb.sh b/tabs/utils/create-bootable-usb.sh index e96c73a93..17e422c24 100644 --- a/tabs/utils/create-bootable-usb.sh +++ b/tabs/utils/create-bootable-usb.sh @@ -13,7 +13,7 @@ usage() { list_devices() { printf "%b\n" "${YELLOW} Available devices and partitions: ${RC}" printf "\n" - $ESCALATION_TOOL lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL + "$ESCALATION_TOOL" lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL printf "\n" } @@ -164,13 +164,13 @@ write_iso(){ # Display progress and create the bootable USB drive printf "%b\n" "${YELLOW}Creating bootable USB drive...${RC}" - if ! $ESCALATION_TOOL dd if="$ISO_PATH" of="$USB_DEVICE" bs=4M status=progress oflag=sync; then + if ! "$ESCALATION_TOOL" dd if="$ISO_PATH" of="$USB_DEVICE" bs=4M status=progress oflag=sync; then printf "%b\n" "${RED}Failed to create bootable USB drive${RC}" exit 1 fi # Sync to ensure all data is written - if ! $ESCALATION_TOOL sync; then + if ! "$ESCALATION_TOOL" sync; then printf "%b\n" "${RED}Failed to sync data${RC}" exit 1 fi @@ -179,10 +179,10 @@ write_iso(){ # Eject the USB device printf "%b\n" "${YELLOW}Ejecting ${USB_DEVICE}...${RC}" - if ! $ESCALATION_TOOL umount "${USB_DEVICE}"* 2>/dev/null; then + if ! "$ESCALATION_TOOL" umount "${USB_DEVICE}"* 2>/dev/null; then printf "%b\n" "${RED}Failed to unmount ${USB_DEVICE}${RC}" fi - if ! $ESCALATION_TOOL eject "$USB_DEVICE"; then + if ! "$ESCALATION_TOOL" eject "$USB_DEVICE"; then printf "%b\n" "${RED}Failed to eject ${USB_DEVICE}${RC}" fi diff --git a/tabs/utils/encrypt_decrypt_tool.sh b/tabs/utils/encrypt_decrypt_tool.sh index 48945b717..580c94d29 100644 --- a/tabs/utils/encrypt_decrypt_tool.sh +++ b/tabs/utils/encrypt_decrypt_tool.sh @@ -8,16 +8,16 @@ printf "%b\n" "${YELLOW}Ensuring OpenSSL is installed...${RC}" if ! command_exists openssl; then case $PACKAGER in pacman) - $ESCALATION_TOOL ${PACKAGER} -Syu --noconfirm openssl + "$ESCALATION_TOOL" ${PACKAGER} -Syu --noconfirm openssl ;; apt-get) - $ESCALATION_TOOL ${PACKAGER} update && $ESCALATION_TOOL ${PACKAGER} install -y openssl + "$ESCALATION_TOOL" ${PACKAGER} update && "$ESCALATION_TOOL" ${PACKAGER} install -y openssl ;; dnf) - $ESCALATION_TOOL ${PACKAGER} install -y openssl + "$ESCALATION_TOOL" ${PACKAGER} install -y openssl ;; zypper) - $ESCALATION_TOOL ${PACKAGER} install openssl + "$ESCALATION_TOOL" ${PACKAGER} install openssl ;; *) printf "%b\n" "${RED}Your Linux distribution is not supported by this script.${RC}" diff --git a/tabs/utils/power-profile.sh b/tabs/utils/power-profile.sh index 3cc1823fc..cfd8b9f9b 100644 --- a/tabs/utils/power-profile.sh +++ b/tabs/utils/power-profile.sh @@ -17,10 +17,10 @@ installAutoCpufreq() { printf "%b\n" "${YELLOW}git not found. Installing git...${RC}" case ${PACKAGER} in pacman) - $ESCALATION_TOOL ${PACKAGER} -S --needed --noconfirm git + "$ESCALATION_TOOL" ${PACKAGER} -S --needed --noconfirm git ;; *) - $ESCALATION_TOOL ${PACKAGER} install -y git + "$ESCALATION_TOOL" ${PACKAGER} install -y git ;; esac fi @@ -35,7 +35,7 @@ installAutoCpufreq() { *) cd auto-cpufreq printf "%b\n" "${YELLOW}Running auto-cpufreq installer...${RC}" - $ESCALATION_TOOL ./auto-cpufreq-installer + "$ESCALATION_TOOL" ./auto-cpufreq-installer ;; esac cd .. @@ -49,10 +49,10 @@ configureAutoCpufreq() { # Check if the system has a battery to determine if it's a laptop if [ -d /sys/class/power_supply/BAT0 ]; then printf "%b\n" "${GREEN}System detected as laptop. Updating auto-cpufreq for laptop...${RC}" - $ESCALATION_TOOL auto-cpufreq --force powersave + "$ESCALATION_TOOL" auto-cpufreq --force powersave else printf "%b\n" "${GREEN}System detected as desktop. Updating auto-cpufreq for desktop...${RC}" - $ESCALATION_TOOL auto-cpufreq --force performance + "$ESCALATION_TOOL" auto-cpufreq --force performance fi else printf "%b\n" "${RED}auto-cpufreq is not installed, skipping configuration.${RC}" @@ -64,7 +64,7 @@ removeAutoCpufreqTweak() { if command_exists auto-cpufreq; then printf "%b\n" "${YELLOW}Resetting auto-cpufreq configuration...${RC}" - $ESCALATION_TOOL auto-cpufreq --force reset + "$ESCALATION_TOOL" auto-cpufreq --force reset else printf "%b\n" "${RED}auto-cpufreq is not installed, skipping removal.${RC}" fi diff --git a/tabs/utils/service-control.sh b/tabs/utils/service-control.sh index 119e45f31..4539f4448 100644 --- a/tabs/utils/service-control.sh +++ b/tabs/utils/service-control.sh @@ -92,11 +92,11 @@ add_service() { printf "\n" printf "[Install]\n" printf "WantedBy=multi-user.target\n" - } | $ESCALATION_TOOL tee "$SERVICE_FILE" > /dev/null + } | "$ESCALATION_TOOL" tee "$SERVICE_FILE" > /dev/null # Set permissions and reload systemd - $ESCALATION_TOOL chmod 644 "$SERVICE_FILE" - $ESCALATION_TOOL systemctl daemon-reload + "$ESCALATION_TOOL" chmod 644 "$SERVICE_FILE" + "$ESCALATION_TOOL" systemctl daemon-reload printf "Service $SERVICE_NAME has been created and is ready to be started.\n" # Optionally, enable and start the service @@ -121,12 +121,12 @@ remove_service() { if [ -f "$SERVICE_FILE" ]; then printf "Stopping and disabling the service...\n" - $ESCALATION_TOOL systemctl stop "$SERVICE_NAME" - $ESCALATION_TOOL systemctl disable "$SERVICE_NAME" + "$ESCALATION_TOOL" systemctl stop "$SERVICE_NAME" + "$ESCALATION_TOOL" systemctl disable "$SERVICE_NAME" printf "Removing the service file...\n" - $ESCALATION_TOOL rm -f "$SERVICE_FILE" - $ESCALATION_TOOL systemctl daemon-reload + "$ESCALATION_TOOL" rm -f "$SERVICE_FILE" + "$ESCALATION_TOOL" systemctl daemon-reload printf "Service $SERVICE_NAME has been removed.\n" else printf "Service $SERVICE_NAME does not exist.\n" @@ -139,7 +139,7 @@ start_service() { printf "Enter the name of the service to start (e.g., my_service):\n" read -r SERVICE_NAME - if $ESCALATION_TOOL systemctl start "$SERVICE_NAME"; then + if "$ESCALATION_TOOL" systemctl start "$SERVICE_NAME"; then printf "Service $SERVICE_NAME has been started.\n" else printf "Failed to start service: $SERVICE_NAME.\n" @@ -152,7 +152,7 @@ stop_service() { printf "Enter the name of the service to stop (e.g., my_service):\n" read -r SERVICE_NAME - if $ESCALATION_TOOL systemctl stop "$SERVICE_NAME"; then + if "$ESCALATION_TOOL" systemctl stop "$SERVICE_NAME"; then printf "Service $SERVICE_NAME has been stopped.\n" else printf "Failed to stop service: $SERVICE_NAME.\n" @@ -165,7 +165,7 @@ enable_service() { printf "Enter the name of the service to enable (e.g., my_service):\n" read -r SERVICE_NAME - if $ESCALATION_TOOL systemctl enable "$SERVICE_NAME"; then + if "$ESCALATION_TOOL" systemctl enable "$SERVICE_NAME"; then printf "Service $SERVICE_NAME has been enabled.\n" else printf "Failed to enable service: $SERVICE_NAME.\n" @@ -178,7 +178,7 @@ disable_service() { printf "Enter the name of the service to disable (e.g., my_service):\n" read -r SERVICE_NAME - if $ESCALATION_TOOL systemctl disable "$SERVICE_NAME"; then + if "$ESCALATION_TOOL" systemctl disable "$SERVICE_NAME"; then printf "Service $SERVICE_NAME has been enabled.\n" else printf "Failed to enable service: $SERVICE_NAME.\n" @@ -228,8 +228,8 @@ create_service_from_external() { "$ESCALATION_TOOL" cp "$SERVICE_FILE" "$SYSTEMD_SERVICE_FILE" # Set permissions and reload systemd - $ESCALATION_TOOL chmod 644 "$SYSTEMD_SERVICE_FILE" - $ESCALATION_TOOL systemctl daemon-reload + "$ESCALATION_TOOL" chmod 644 "$SYSTEMD_SERVICE_FILE" + "$ESCALATION_TOOL" systemctl daemon-reload printf "Service $SERVICE_NAME has been created and is ready to be started.\n" # Optionally, enable and start the service @@ -237,8 +237,8 @@ create_service_from_external() { read -r START_ENABLE if [ "$START_ENABLE" = "y" ]; then - $ESCALATION_TOOL systemctl start "$SERVICE_NAME" - $ESCALATION_TOOL systemctl enable "$SERVICE_NAME" + "$ESCALATION_TOOL" systemctl start "$SERVICE_NAME" + "$ESCALATION_TOOL" systemctl enable "$SERVICE_NAME" printf "Service $SERVICE_NAME has been started and enabled.\n" else printf "Service $SERVICE_NAME has been created but not started.\n" diff --git a/tabs/utils/timeshift.sh b/tabs/utils/timeshift.sh index ec69081f2..8daa20f4d 100644 --- a/tabs/utils/timeshift.sh +++ b/tabs/utils/timeshift.sh @@ -10,10 +10,10 @@ install_timeshift() { if ! command_exists timeshift; then case ${PACKAGER} in pacman) - $ESCALATION_TOOL "${PACKAGER}" -S --noconfirm timeshift + "$ESCALATION_TOOL" "${PACKAGER}" -S --noconfirm timeshift ;; *) - $ESCALATION_TOOL "${PACKAGER}" install -y timeshift + "$ESCALATION_TOOL" "${PACKAGER}" install -y timeshift ;; esac else @@ -37,13 +37,13 @@ display_menu() { # Function to list snapshots list_snapshots() { printf "%b\n" "${CYAN}Listing snapshots...${RC}" - $ESCALATION_TOOL timeshift --list-snapshots + "$ESCALATION_TOOL" timeshift --list-snapshots } # Function to list devices list_devices() { printf "%b\n" "${CYAN}Listing available devices...${RC}" - $ESCALATION_TOOL timeshift --list-devices + "$ESCALATION_TOOL" timeshift --list-devices } # Function to create a new snapshot @@ -55,13 +55,13 @@ create_snapshot() { if [ -z "$COMMENT" ] && [ -z "$TAG" ]; then printf "%b\n" "${CYAN}Creating snapshot with no comment or tag...${RC}" - $ESCALATION_TOOL timeshift --create + "$ESCALATION_TOOL" timeshift --create elif [ -z "$TAG" ]; then printf "%b\n" "${CYAN}Creating snapshot with no tag...${RC}" - $ESCALATION_TOOL timeshift --create --comments "$COMMENT" + "$ESCALATION_TOOL" timeshift --create --comments "$COMMENT" else printf "%b\n" "${CYAN}Creating snapshot with tag: $TAG...${RC}" - $ESCALATION_TOOL timeshift --create --comments "$COMMENT" --tags "$TAG" + "$ESCALATION_TOOL" timeshift --create --comments "$COMMENT" --tags "$TAG" fi if [ $? -eq 0 ]; then @@ -83,11 +83,11 @@ restore_snapshot() { read -r SKIP_GRUB if [ "$SKIP_GRUB" = "yes" ]; then - $ESCALATION_TOOL timeshift --restore --snapshot "$SNAPSHOT" --target-device "$TARGET_DEVICE" --skip-grub --yes + "$ESCALATION_TOOL" timeshift --restore --snapshot "$SNAPSHOT" --target-device "$TARGET_DEVICE" --skip-grub --yes else printf "%b\n" "${CYAN}Enter GRUB device (e.g., /dev/sda): ${RC}" read -r GRUB_DEVICE - $ESCALATION_TOOL timeshift --restore --snapshot "$SNAPSHOT" --target-device "$TARGET_DEVICE" --grub-device "$GRUB_DEVICE" --yes + "$ESCALATION_TOOL" timeshift --restore --snapshot "$SNAPSHOT" --target-device "$TARGET_DEVICE" --grub-device "$GRUB_DEVICE" --yes fi if [ $? -eq 0 ]; then @@ -105,7 +105,7 @@ delete_snapshot() { read -r SNAPSHOT printf "%b\n" "${YELLOW}Deleting snapshot $SNAPSHOT...${RC}" - $ESCALATION_TOOL timeshift --delete --snapshot "$SNAPSHOT" --yes + "$ESCALATION_TOOL" timeshift --delete --snapshot "$SNAPSHOT" --yes if [ $? -eq 0 ]; then printf "%b\n" "${GREEN}Snapshot deleted successfully.${RC}" @@ -122,7 +122,7 @@ delete_all_snapshots() { if [ "$CONFIRMATION" = "yes" ]; then printf "%b\n" "${CYAN}Deleting all snapshots...${RC}" - $ESCALATION_TOOL timeshift --delete-all --yes + "$ESCALATION_TOOL" timeshift --delete-all --yes if [ $? -eq 0 ]; then printf "%b\n" "${GREEN}All snapshots deleted successfully.${RC}" else