From 23954aa8bc5ce4ec9a56972de33dae56b4c1abca Mon Sep 17 00:00:00 2001 From: JEEVITHA KANNAN K S Date: Thu, 31 Oct 2024 23:23:06 +0530 Subject: [PATCH 01/27] refact(ci): ShellCheck (#887) * ci: add shfmt * refact: shellcheck --- .github/workflows/shellcheck.yml | 61 +++++++++++--------------------- 1 file changed, 20 insertions(+), 41 deletions(-) diff --git a/.github/workflows/shellcheck.yml b/.github/workflows/shellcheck.yml index 6b1ad429..854e9451 100644 --- a/.github/workflows/shellcheck.yml +++ b/.github/workflows/shellcheck.yml @@ -1,9 +1,9 @@ -name: ShellCheck +name: Script Checks on: pull_request: paths: - - 'core/tabs/**/*.sh' + - '**/*.sh' workflow_dispatch: jobs: @@ -11,45 +11,24 @@ jobs: name: Shellcheck runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - run: git fetch origin ${{ github.base_ref }} + - name: Checkout sources + uses: actions/checkout@v4 - - name: Download, setup, and run ShellCheck - shell: bash {0} - run : | - SC_URL="https://github.com/koalaman/shellcheck/releases/download/v0.10.0/shellcheck-v0.10.0.linux.x86_64.tar.xz" - curl -fsSL "$SC_URL" | tar -Jx - chmod +x "./shellcheck-v0.10.0/shellcheck" + - name: Run ShellCheck + uses: reviewdog/action-shellcheck@v1 + with: + reviewdog_flags: '-fail-level=any' - error=0 - files_to_check=$(git diff --name-only origin/${{ github.base_ref }} HEAD core/tabs) + shfmt: + name: Shell Fomatting + runs-on: ubuntu-latest + needs: shellcheck + steps: + - name: Checkout sources + uses: actions/checkout@v4 - for file in $files_to_check; do - if [[ "$file" == *.sh ]] && [[ -f "$file" ]]; then - sc_output=$(./shellcheck-v0.10.0/shellcheck -fgcc -Serror "$file") - iter_safe_parsed_errors=$(echo -e "$sc_output" | sed -n 's/\(.\+\)\:\([0-9]\+\)\:\([0-9]\+\)\: \(.*\)/::error file=\1,line=\2,col=\3::\4/p' | sed 's/ /:space:/g') - - for error in $iter_safe_parsed_errors; do - echo "$error" | sed 's/:space:/ /g' - error=1 - done - - tabs_detected=$(grep -nP '^\t+\S+' "$file") - - # fast fail on the action runner would fail immediately if there weren't any tabs found - # this check makes sure that we don't continue if there's something really weird going on - if [ "$?" = "2" ]; then - echo "::error file=$file::There was a critical error while grepping $file, aborting" - exit 1 - fi - - iter_safe_parsed_tabs_detected=$(echo "$tabs_detected" | sed -n 's,\([0-9]\+\).*,::error file='"$file"'\,line=\1::Found tab indentations,p' | sed 's/ /:space:/g') - - for error in $iter_safe_parsed_tabs_detected; do - echo "$error" | sed 's/:space:/ /g' - error=1 - done - fi - done - - exit $error + - name: Run shfmt + uses: reviewdog/action-shfmt@v1 + with: + shfmt_flags: '-i 4 -ci' + reviewdog_flags: '-fail-level=any' From 5e19458c74424044ee9f37ba31f27ef3e91a27d1 Mon Sep 17 00:00:00 2001 From: Liam <33645555+lj3954@users.noreply.github.com> Date: Thu, 31 Oct 2024 12:58:10 -0500 Subject: [PATCH 02/27] feat: Drastically increase the operating system support for USB creation script (#828) * feat: Drastically increase the operating system support for USB creator * fix: Modify jq syntax to fix false positive from checkbashisms * feat: Include chosen release in 'available editions' text * fix: Correct syntax for older jq versions * refactor: Remove pointless comment Co-authored-by: nyx * fix: List available options in a more readable way. Co-authored-by: adamperkowski --------- Co-authored-by: nyx Co-authored-by: adamperkowski --- core/tabs/utils/create-bootable-usb.sh | 245 ++++++++++++++++--------- 1 file changed, 161 insertions(+), 84 deletions(-) diff --git a/core/tabs/utils/create-bootable-usb.sh b/core/tabs/utils/create-bootable-usb.sh index 0e59440d..f05830d3 100644 --- a/core/tabs/utils/create-bootable-usb.sh +++ b/core/tabs/utils/create-bootable-usb.sh @@ -2,12 +2,7 @@ . ../common-script.sh -# Function to display usage instructions -usage() { - printf "%b\n" "${RED} Usage: $0 ${RC}" - printf "%b\n" "No arguments needed. The script will prompt for ISO path and USB device." - exit 1 -} +CONFIGURATION_URL="https://github.com/quickemu-project/quickget_configs/releases/download/daily/quickget_data.json" # Function to display all available block devices list_devices() { @@ -17,53 +12,23 @@ list_devices() { printf "\n" } -# Function to fetch the latest Arch Linux ISO -fetch_arch_latest_iso() { - ARCH_BASE_URL="https://archive.archlinux.org/iso/" - ARCH_LATEST=$(curl -s "$ARCH_BASE_URL" | grep -oP '(?<=href=")[0-9]{4}\.[0-9]{2}\.[0-9]{2}(?=/)' | sort -V | tail -1) - ARCH_URL="${ARCH_BASE_URL}${ARCH_LATEST}/archlinux-${ARCH_LATEST}-x86_64.iso" - printf "%b\n" "${GREEN} Selected Arch Linux (latest) ISO URL: ${RC} $ARCH_URL" -} - -# Function to fetch older Arch Linux ISOs and display in a table format -fetch_arch_older_isos() { - ARCH_BASE_URL="https://archive.archlinux.org/iso/" - ARCH_VERSIONS=$(curl -s "$ARCH_BASE_URL" | grep -oP '(?<=href=")[0-9]{4}\.[0-9]{2}\.[0-9]{2}(?=/)' | sort -V) - - # Filter versions to include only those from 2017-04-01 and later - MIN_DATE="2017.04.01" - ARCH_VERSIONS=$(echo "$ARCH_VERSIONS" | awk -v min_date="$MIN_DATE" '$0 >= min_date') - - if [ -z "$ARCH_VERSIONS" ]; then - printf "%b\n" "${RED}No Arch Linux versions found from ${MIN_DATE} onwards.${RC}" - exit 1 +installDependencies() { + DEPENDENCIES="xz gzip bzip2 jq" + if ! command_exists ${DEPENDENCIES}; then + printf "%b\n" "${YELLOW}Installing dependencies...${RC}" + case "${PACKAGER}" in + apt-get|nala) + "${ESCALATION_TOOL}" "${PACKAGER}" install -y xz-utils gzip bzip2 jq;; + dnf|zypper) + "${ESCALATION_TOOL}" "${PACKAGER}" install -y ${DEPENDENCIES};; + pacman) + "${ESCALATION_TOOL}" "${PACKAGER}" -S --noconfirm --needed ${DEPENDENCIES};; + *) + printf "%b\n" "${RED}Unsupported package manager.${RC}" + exit 1 + ;; + esac fi - - printf "%b\n" "${YELLOW}Available Arch Linux versions from ${MIN_DATE} onwards:${RC}" - - COUNTER=1 - ROW_ITEMS=6 # Number of versions to show per row - for VERSION in $ARCH_VERSIONS; do - printf "%-5s${YELLOW}%-15s ${RC}" "$COUNTER)" "$VERSION" - - if [ $(( COUNTER % ROW_ITEMS )) -eq 0 ]; then - printf "\n" # New line after every 6 versions - fi - - COUNTER=$((COUNTER + 1)) - done - printf "\n" # New line after the last row - printf "%b" "Select an Arch Linux version (1-$((COUNTER - 1))): " - read -r ARCH_OPTION - ARCH_DIR=$(echo "$ARCH_VERSIONS" | sed -n "${ARCH_OPTION}p") - ARCH_URL="${ARCH_BASE_URL}${ARCH_DIR}/archlinux-${ARCH_DIR}-x86_64.iso" - printf "%b\n" "${GREEN}Selected Arch Linux (older) ISO URL: $ARCH_URL${RC}" -} - -# Function to fetch the latest Debian Linux ISO -fetch_debian_latest_iso() { - DEBIAN_URL=$(curl -s https://www.debian.org/distrib/netinst | grep -oP '(?<=href=")[^"]+debian-[0-9.]+-amd64-netinst.iso(?=")' | head -1) - printf "%b\n" "${GREEN} Selected Debian Linux (latest) ISO URL: ${RC} $DEBIAN_URL" } # Function to ask whether to use local or online ISO @@ -77,7 +42,7 @@ choose_iso_source() { case $ISO_SOURCE_OPTION in 1) - fetch_iso_urls # Call the function to fetch online ISO URLs + get_online_iso ;; 2) printf "Enter the path to the already downloaded ISO file: " @@ -94,45 +59,156 @@ choose_iso_source() { esac } -# Function to fetch ISO URLs -fetch_iso_urls() { - clear - printf "%b\n" "${YELLOW}Available ISOs for download:${RC}" - printf "%b\n" "1) Arch Linux (latest)" - printf "%b\n" "2) Arch Linux (older versions)" - printf "%b\n" "3) Debian Linux (latest)" - printf "\n" - printf "%b" "Select the ISO you want to download (1-3): " - read -r ISO_OPTION - - case $ISO_OPTION in - 1) - fetch_arch_latest_iso - ISO_URL=$ARCH_URL - ;; - 2) - fetch_arch_older_isos - ISO_URL=$ARCH_URL - ;; - 3) - fetch_debian_latest_iso - ISO_URL=$DEBIAN_URL - ;; - *) - printf "%b\n" "${RED}Invalid option selected.${RC}" +decompress_iso() { + printf "%b\n" "${YELLOW}Decompressing ISO file...${RC}" + case "${ISO_ARCHIVE_FORMAT}" in + xz) + xz -d "${ISO_PATH}" + ISO_PATH="$(echo "${ISO_PATH}" | sed 's/\.xz//')";; + gz) + gzip -d "${ISO_PATH}" + ISO_PATH="$(echo "${ISO_PATH}" | sed 's/\.gz//')";; + bz2) + bzip2 -d "${ISO_PATH}" + ISO_PATH="$(echo "${ISO_PATH}" | sed 's/\.bz2//')";; + *) + printf "%b\n" "${RED}Unsupported archive format. Try manually decompressing the ISO and choosing it as a local file instead.${RC}" exit 1 ;; esac - ISO_PATH=$(basename "$ISO_URL") - printf "%b\n" "${YELLOW}Downloading ISO...${RC}" - curl -L -o "$ISO_PATH" "$ISO_URL" - if [ $? -ne 0 ]; then + printf "%b\n" "${GREEN}ISO file decompressed successfully.${RC}" +} + +check_hash() { + case "${#ISO_CHECKSUM}" in + 32) HASH_ALGO="md5sum";; + 40) HASH_ALGO="sha1sum";; + 64) HASH_ALGO="sha256sum";; + 128) HASH_ALGO="sha512sum";; + *) printf "%b\n" "${RED}Invalid checksum length. Skipping checksum verification.${RC}" + return;; + esac + printf "%b\n" "Checking ISO integrity using ${HASH_ALGO}..." + if ! echo "${ISO_CHECKSUM} ${ISO_PATH}" | "${HASH_ALGO}" --check --status; then + printf "%b\n" "${RED}Checksum verification failed.${RC}" + exit 1 + else + printf "%b\n" "${GREEN}Checksum verification successful.${RC}" + fi +} + +download_iso() { + printf "\n%b\n" "${YELLOW}Found URL: ${ISO_URL}${RC}" + printf "%b\n" "${YELLOW}Downloading ISO to ${ISO_PATH}...${RC}" + if ! curl -L -o "$ISO_PATH" "$ISO_URL"; then printf "%b\n" "${RED}Failed to download the ISO file.${RC}" exit 1 fi } +get_architecture() { + printf "%b\n" "${YELLOW}Select the architecture of the ISO to flash${RC}" + printf "%b\n" "1) x86_64" + printf "%b\n" "2) AArch64" + printf "%b\n" "3) riscv64" + printf "%b" "Select an option (1-3): " + read -r ARCH + case "${ARCH}" in + 1) ARCH="x86_64";; + 2) ARCH="aarch64";; + 3) ARCH="riscv64";; + *) + printf "%b\n" "${RED}Invalid architecture selected. ${RC}" + exit 1 + ;; + esac +} + +comma_delimited_list() { + echo "${1}" | tr '\n' ',' | sed 's/,/, /g; s/, $//' +} + +get_online_iso() { + get_architecture + printf "%b\n" "${YELLOW}Fetching available operating systems...${RC}" + clear + + # Download available operating systems, filter to to those that match requirements + # Remove entries with more than 1 ISO or any other medium, they could cause issues + OS_JSON="$(curl -L -s "$CONFIGURATION_URL" | jq -c "[.[] | \ + .releases |= map(select( \ + (.arch // \"x86_64\") == "\"${ARCH}\"" \ + and (.iso | length == 1) and (.iso[0] | has(\"web\")) \ + and .img == null and .fixed_iso == null and .floppy == null and .disk_images == null)) \ + | select(.releases | length > 0)]")" + + if echo "${OS_JSON}" | jq -e 'length == 0' >/dev/null; then + printf "%b\n" "${RED}No operating systems found.${RC}" + exit 1 + fi + + printf "%b\n" "${YELLOW}Available Operating Systems:${RC}" + comma_delimited_list "$(echo "${OS_JSON}" | jq -r '.[].name')" + printf "\n%b" "Select an operating system: " + read -r OS + + OS_JSON="$(echo "${OS_JSON}" | jq --arg os "${OS}" -c '.[] | select(.name == $os)')" + if [ -z "${OS_JSON}" ]; then + printf "%b\n" "${RED}Invalid operating system selected.${RC}" + exit 1 + fi + PRETTY_NAME="$(echo "${OS_JSON}" | jq -r '.pretty_name')" + + printf "\n%b\n" "${YELLOW}Available releases for ${PRETTY_NAME}:${RC}" + comma_delimited_list "$(echo "${OS_JSON}" | jq -r '.releases[].release' | sort -Vur)" + printf "\n%b" "Select a release: " + read -r RELEASE + printf "\n" + + OS_JSON="$(echo "${OS_JSON}" | jq --arg release "${RELEASE}" -c '.releases |= map(select(.release == $release))')" + if echo "${OS_JSON}" | jq -e '.releases | length == 0' >/dev/null; then + printf "%b\n" "${RED}Invalid release selected.${RC}" + exit 1 + fi + + if echo "${OS_JSON}" | jq -e '.releases[] | select(.edition != null) | any' >/dev/null; then + printf "%b\n" "${YELLOW}Available editions for ${PRETTY_NAME} ${RELEASE}:${RC}" + comma_delimited_list "$(echo "${OS_JSON}" | jq -r '.releases[].edition' | sort -Vur)" + printf "\n%b" "Select an edition: " + read -r EDITION + ENTRY="$(echo "${OS_JSON}" | jq --arg edition "${EDITION}" -c '.releases[] | select(.edition == $edition)')" + else + ENTRY="$(echo "${OS_JSON}" | jq -c '.releases[0]')" + fi + + if [ -z "${ENTRY}" ]; then + printf "%b\n" "${RED}Invalid edition selected.${RC}" + exit 1 + fi + + WEB_DATA="$(echo "${ENTRY}" | jq -c '.iso[0].web')" + + ISO_URL="$(echo "${WEB_DATA}" | jq -r '.url')" + ISO_CHECKSUM="$(echo "${WEB_DATA}" | jq -r '.checksum')" + ISO_ARCHIVE_FORMAT="$(echo "${WEB_DATA}" | jq -r '.archive_format')" + + ISO_FILENAME="$(echo "${WEB_DATA}" | jq -r '.file_name')" + if [ "${ISO_FILENAME}" = "null" ]; then + ISO_FILENAME="$(basename "${ISO_URL}")" + fi + + ISO_PATH="${HOME}/Downloads/${ISO_FILENAME}" + download_iso + + if [ "${ISO_CHECKSUM}" != "null" ]; then + check_hash + fi + if [ "${ISO_ARCHIVE_FORMAT}" != "null" ]; then + decompress_iso + fi +} + write_iso(){ clear @@ -191,4 +267,5 @@ write_iso(){ checkEnv checkEscalationTool -write_iso \ No newline at end of file +installDependencies +write_iso From abcf7fc376b140c685711adb71c2ee858dad67f0 Mon Sep 17 00:00:00 2001 From: hexis <71829613+hexisXz@users.noreply.github.com> Date: Thu, 31 Oct 2024 18:04:55 +0000 Subject: [PATCH 03/27] added waterfox browser (#700) * added waterfox browser * added waterfox browser * added waterfox browser * added waterfox browser * added waterfox browser * added waterfox browser * added waterfox browser * added waterfox browser * fixed things * fixed things * added FI * flatpak fix * added lapce IDE * . --- .../applications-setup/browsers/waterfox.sh | 25 +++++++++++++++++++ core/tabs/applications-setup/tab_data.toml | 6 +++++ 2 files changed, 31 insertions(+) create mode 100644 core/tabs/applications-setup/browsers/waterfox.sh diff --git a/core/tabs/applications-setup/browsers/waterfox.sh b/core/tabs/applications-setup/browsers/waterfox.sh new file mode 100644 index 00000000..3cef5106 --- /dev/null +++ b/core/tabs/applications-setup/browsers/waterfox.sh @@ -0,0 +1,25 @@ +#!/bin/sh -e + +. ../../common-script.sh + +installWaterfox() { + if ! command_exists waterfox; then + printf "%b\n" "${YELLOW}Installing waterfox...${RC}" + case "$PACKAGER" in + pacman) + "$AUR_HELPER" -S --needed --noconfirm waterfox-bin + ;; + *) + . ../setup-flatpak.sh + flatpak install -y flathub net.waterfox.waterfox + ;; + esac + else + printf "%b\n" "${GREEN}Waterfox is already installed.${RC}" + fi +} + +checkEnv +checkEscalationTool +checkAURHelper +installWaterfox diff --git a/core/tabs/applications-setup/tab_data.toml b/core/tabs/applications-setup/tab_data.toml index ef6af7de..d2c59461 100644 --- a/core/tabs/applications-setup/tab_data.toml +++ b/core/tabs/applications-setup/tab_data.toml @@ -186,6 +186,12 @@ description = "Vivaldi is a freeware, cross-platform web browser developed by Vi script = "browsers/vivaldi.sh" task_list = "I" +[[data.entries]] +name = "waterfox" +description = "Waterfox is the privacy-focused web browser engineered to give you speed, control, and peace of mind on the internet." +script = "browsers/waterfox.sh" +task_list = "FI" + [[data]] name = "Alacritty" description = "Alacritty is a modern terminal emulator that comes with sensible defaults, but allows for extensive configuration. By integrating with other applications, rather than reimplementing their functionality, it manages to provide a flexible set of features with high performance. The supported platforms currently consist of BSD, Linux, macOS and Windows.\nThis command installs and condifures alacritty terminal emulator." From e29ca044c0e421b38083ca90b1cabe54eecf8d1d Mon Sep 17 00:00:00 2001 From: JEEVITHA KANNAN K S Date: Thu, 31 Oct 2024 23:36:17 +0530 Subject: [PATCH 04/27] Fix bash deps (#763) --- core/tabs/applications-setup/mybash-setup.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/core/tabs/applications-setup/mybash-setup.sh b/core/tabs/applications-setup/mybash-setup.sh index 7cda9942..c09df01e 100644 --- a/core/tabs/applications-setup/mybash-setup.sh +++ b/core/tabs/applications-setup/mybash-setup.sh @@ -5,16 +5,16 @@ gitpath="$HOME/.local/share/mybash" installDepend() { - if ! command_exists bash bash-completion tar bat tree unzip fontconfig git; then - printf "%b\n" "${YELLOW}Installing Bash...${RC}" - case "$PACKAGER" in - pacman) - "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm bash bash-completion tar bat tree unzip fontconfig git - ;; - *) - "$ESCALATION_TOOL" "$PACKAGER" install -y bash bash-completion tar bat tree unzip fontconfig git - ;; - esac + if [ ! -f "/usr/share/bash-completion/bash_completion" ] || ! command_exists bash tar bat tree unzip fc-list git; then + printf "%b\n" "${YELLOW}Installing Bash...${RC}" + case "$PACKAGER" in + pacman) + "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm bash bash-completion tar bat tree unzip fontconfig git + ;; + *) + "$ESCALATION_TOOL" "$PACKAGER" install -y bash bash-completion tar bat tree unzip fontconfig git + ;; + esac fi } From a9fdfd1784df9bb656054cf72c7aa67d4d0fbd7e Mon Sep 17 00:00:00 2001 From: nyx Date: Thu, 31 Oct 2024 14:06:46 -0400 Subject: [PATCH 05/27] make command_exists interpret multiple values (#762) Co-authored-by: nyx --- core/tabs/common-script.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/tabs/common-script.sh b/core/tabs/common-script.sh index 12ab1146..396f358d 100644 --- a/core/tabs/common-script.sh +++ b/core/tabs/common-script.sh @@ -9,7 +9,10 @@ CYAN='\033[36m' GREEN='\033[32m' command_exists() { - command -v "$1" >/dev/null 2>&1 + for cmd in "$@"; do + command -v "$cmd" >/dev/null 2>&1 || return 1 + done + return 0 } checkAURHelper() { From 663992b15d39f462b85a941acd7ae1697937defb Mon Sep 17 00:00:00 2001 From: Adam Perkowski Date: Thu, 31 Oct 2024 19:07:50 +0100 Subject: [PATCH 06/27] =?UTF-8?q?=E2=9A=96=EF=B8=8F=20docs:=20fix=20the=20?= =?UTF-8?q?security=20policy=20(#883)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs: fix the security policy * better grammar and stuff * add a version matrix * LATEST hyprlink --- .github/SECURITY.md | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/.github/SECURITY.md b/.github/SECURITY.md index 1a258e69..374f09aa 100644 --- a/.github/SECURITY.md +++ b/.github/SECURITY.md @@ -2,13 +2,20 @@ ## Supported Versions -It is recommended that you run the stable version as this is more tested and used by most. The dev branch is bleed-edge commits that are not well tested and aren't meant to be used in production environments +It is recommended that you use the stable branch as it's tested and used by most. The dev branch may contain bleeding-edge commits that are not well tested and are not meant to be used in production environments.
+Version tags lower than the [latest stable release](https://github.com/ChrisTitusTech/linutil/releases/latest) are **not** supported. -| Version | Supported | -| ------- | ------------------ | -| latest | :white_check_mark: | -| dev | :x: | +| Branch | Supported | +| ------- | ---------------------- | +| Stable | :white_check_mark: YES | +| Dev | :x: NO | + +| Version | Supported | +| -------------------------------------------------- | ---------------------- | +| [![LATEST](https://img.shields.io/github/v/release/ChrisTitusTech/linutil?color=%230567ff&label=Latest&style=for-the-badge)](https://github.com/ChrisTitusTech/linutil/releases/latest) | :white_check_mark: YES | +| Below LATEST | :x: NO | +| Above LATEST | :x: NO | ## Reporting a Vulnerability -I'd recommend making an Issue for reporting a bug. If you would like privately submit the bug you can email me at contact@christitus.com +If you have any reason to believe there are security vulnerabilities in Linutil, fill out the [report form](https://github.com/christitustech/linutil/security/advisories/new) or e-mail [contact@christitus.com](mailto:contact@christitus.com). From c7d7cd389124da9116bbd6609a6125dc4139a37b Mon Sep 17 00:00:00 2001 From: Adam Perkowski Date: Thu, 31 Oct 2024 19:10:45 +0100 Subject: [PATCH 07/27] fix: github release notes not working (#884) so apparently you can't mix stuff like `labels` and `label` in YAML (f YAML) if i try to create a release now (yes i can), it just won't generate the notes. this will fix it --- .github/release.yml | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/.github/release.yml b/.github/release.yml index ada1b3e6..8668f1c3 100644 --- a/.github/release.yml +++ b/.github/release.yml @@ -1,23 +1,35 @@ changelog: categories: - title: '🚀 Features' - label: 'enhancement' + labels: + - 'enhancement' - title: '🐛 Bug Fixes' - label: 'bug' + labels: + - 'bug' - title: '⚙️ Refactoring' - label: 'refactor' + labels: + - 'refactor' - title: '🧩 UI/UX' - label: 'UI/UX' + labels: + - 'UI/UX' - title: '📚 Documentation' - label: 'documentation' + labels: + - 'documentation' - title: '🔒 Security' - label: 'security' + labels: + - 'security' - title: '🧰 GitHub Actions' - label: 'github_actions' + labels: + - 'github_actions' - title: '🦀 Rust' - label: 'rust' + labels: + - 'rust' - title: '📃 Scripting' - label: 'script' + labels: + - 'script' + - title: 'Other Changes' + labels: + - "*" exclude: labels: - - 'skip-changelog' \ No newline at end of file + - 'skip-changelog' From a2bdd8fb4c70d39dc84cde35bb86b1aa19697da2 Mon Sep 17 00:00:00 2001 From: Adam Perkowski Date: Thu, 31 Oct 2024 19:11:24 +0100 Subject: [PATCH 08/27] fix(waydroid-setup): not installing `dkms` on arch (#881) took some code from #797 Co-authored-by: JEEVITHA KANNAN K S --- core/tabs/applications-setup/waydroid-setup.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/core/tabs/applications-setup/waydroid-setup.sh b/core/tabs/applications-setup/waydroid-setup.sh index 255a4cbe..8cac399f 100755 --- a/core/tabs/applications-setup/waydroid-setup.sh +++ b/core/tabs/applications-setup/waydroid-setup.sh @@ -15,10 +15,17 @@ installWaydroid() { case "$PACKAGER" in pacman) "$AUR_HELPER" -S --needed --noconfirm waydroid - if command_exists dkms; then - "$AUR_HELPER" -S --needed --noconfirm binder_linux-dkms - "$ESCALATION_TOOL" modprobe binder-linux device=binder,hwbinder,vndbinder + if ! command_exists dkms; then + installed_kernels=$("$PACKAGER" -Q | grep -E '^linux(| |-rt|-rt-lts|-hardened|-zen|-lts)[^-headers]' | cut -d ' ' -f 1) + for kernel in $installed_kernels; do + header="${kernel}-headers" + printf "%b\n" "${CYAN}Installing headers for $kernel...${RC}" + "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm "$header" + done + "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm dkms fi + "$AUR_HELPER" -S --needed --noconfirm binder_linux-dkms + "$ESCALATION_TOOL" modprobe binder-linux device=binder,hwbinder,vndbinder ;; apt-get|nala) curl https://repo.waydro.id | "$ESCALATION_TOOL" sh From 6e1d7a67685e04c546f780fc62b5a52db8779459 Mon Sep 17 00:00:00 2001 From: JEEVITHA KANNAN K S Date: Thu, 31 Oct 2024 23:45:02 +0530 Subject: [PATCH 09/27] Update roadmap.md (#875) * Update roadmap.md * Update docs/roadmap.md Co-authored-by: Adam Perkowski * Update docs/roadmap.md Co-authored-by: Adam Perkowski * Update docs/roadmap.md Co-authored-by: Adam Perkowski --------- Co-authored-by: Adam Perkowski --- docs/roadmap.md | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/docs/roadmap.md b/docs/roadmap.md index 8f41056e..cc334348 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -5,19 +5,23 @@ ## Goals - [ ] Focus on tasks that take time in Linux and automate them. (Example: Removing a user, adding a user, etc. - but mostly BASH scripts with POSIX compliance.) -- [ ] Remove Binary linutil from being tracked in git and make it a github action. +- [x] Remove Binary linutil from being tracked in git and make it a github action. - [ ] Document every function and feature of linutil. (Preview panel description addition) - [x] Create a discord server for linutil and invite the community. -- [ ] Power Optimizations for Laptops +- [x] Power Optimizations for Laptops ## Milestones -### Q3 2024 -- [ ] Finish the foundation of the project in CLI mode. -- [ ] DENY ALL GUI Pull Requests while CLI and foundation is being established. - ### Q4 2024 +- [x] Finish the foundation of the project's CLI +- [ ] Implement CLI arguments and configuration support +- [ ] Add an option for logging script executions + +### Q1 2025 - [ ] GUI Brainstorming and Planning -- [ ] GUI Implementation towards the end of Q4 +- [ ] Basic GUI Implementation + +### Q2 2025 +- [ ] Full GUI Implementation ## Community Feedback - Encourage community input and suggestions for future development. From 67f6a4989fe9e17e233bed81bf860613f741015c Mon Sep 17 00:00:00 2001 From: JEEVITHA KANNAN K S Date: Thu, 31 Oct 2024 23:51:06 +0530 Subject: [PATCH 10/27] Update rust.yml (#866) Run workflow in all Cargo.toml changes --- .github/workflows/rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index fd9e190e..88657c59 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -5,7 +5,7 @@ on: branches: ["main"] paths: - '**/*.rs' - - 'Cargo.toml' + - '**/Cargo.toml' - 'Cargo.lock' env: From b2fb33229b954b5c681058dead4c0472b3f2ecb4 Mon Sep 17 00:00:00 2001 From: "Bernhard M. Wiedemann" Date: Thu, 31 Oct 2024 19:22:17 +0100 Subject: [PATCH 11/27] Replace BUILD_DATE with CARGO_PKG_VERSION (#878) to make builds reproducible. See https://reproducible-builds.org/ for why this is good. --- tui/Cargo.toml | 6 +----- tui/build.rs | 7 ------- tui/src/state.rs | 2 +- 3 files changed, 2 insertions(+), 13 deletions(-) delete mode 100644 tui/build.rs diff --git a/tui/Cargo.toml b/tui/Cargo.toml index 40d3c357..95bd7ae2 100644 --- a/tui/Cargo.toml +++ b/tui/Cargo.toml @@ -7,8 +7,7 @@ edition = "2021" license.workspace = true repository = "https://github.com/ChrisTitusTech/linutil/tree/main/tui" version.workspace = true -include = ["src/*.rs", "Cargo.toml", "build.rs", "cool_tips.txt", "../man/linutil.1"] -build = "build.rs" +include = ["src/*.rs", "Cargo.toml", "cool_tips.txt", "../man/linutil.1"] [features] default = ["tips"] @@ -32,9 +31,6 @@ anstyle = "1.0.8" ansi-to-tui = "6.0.0" zips = "0.1.7" -[build-dependencies] -chrono = "0.4.33" - [[bin]] name = "linutil" path = "src/main.rs" diff --git a/tui/build.rs b/tui/build.rs deleted file mode 100644 index 121931c1..00000000 --- a/tui/build.rs +++ /dev/null @@ -1,7 +0,0 @@ -fn main() { - // Add current date as a variable to be displayed in the 'Linux Toolbox' text. - println!( - "cargo:rustc-env=BUILD_DATE={}", - chrono::Local::now().format("%Y-%m-%d") - ); -} diff --git a/tui/src/state.rs b/tui/src/state.rs index 4e398ee7..7807dd75 100644 --- a/tui/src/state.rs +++ b/tui/src/state.rs @@ -24,7 +24,7 @@ use temp_dir::TempDir; const MIN_WIDTH: u16 = 77; const MIN_HEIGHT: u16 = 19; -const TITLE: &str = concat!("Linux Toolbox - ", env!("BUILD_DATE")); +const TITLE: &str = concat!("Linux Toolbox - ", env!("CARGO_PKG_VERSION")); const ACTIONS_GUIDE: &str = "List of important tasks performed by commands' names: D - disk modifications (ex. partitioning) (privileged) From a5fd25f6af4a7976d5da65eee2be9f6692e538fa Mon Sep 17 00:00:00 2001 From: nyx Date: Thu, 31 Oct 2024 14:25:16 -0400 Subject: [PATCH 12/27] organize shortcut list into a grid-like-pattern (#721) * organize shortcut list into a grid-like-pattern * increase minimum size * add newline back to satisfy lint * decrease to 25 * optimization Co-authored-by: Adam Perkowski * satisfy lint * implement some changes proposed by adam Co-authored-by: Adam Perkowski --------- Co-authored-by: nyx Co-authored-by: Adam Perkowski --- tui/src/hint.rs | 54 +++++++++++++++++++++--------------------------- tui/src/state.rs | 4 ++-- 2 files changed, 25 insertions(+), 33 deletions(-) diff --git a/tui/src/hint.rs b/tui/src/hint.rs index 8e16e749..b5f096ca 100644 --- a/tui/src/hint.rs +++ b/tui/src/hint.rs @@ -27,41 +27,33 @@ pub fn create_shortcut_list( shortcuts: impl IntoIterator, render_width: u16, ) -> Box<[Line<'static>]> { - let hints = shortcuts.into_iter().collect::>(); + let shortcut_spans: Vec>> = + shortcuts.into_iter().map(|h| h.to_spans()).collect(); - let mut shortcut_spans: Vec>> = hints.iter().map(|h| h.to_spans()).collect(); + let max_shortcut_width = shortcut_spans + .iter() + .map(|s| span_vec_len(s)) + .max() + .unwrap_or(0); - let mut lines: Vec> = vec![]; + let columns = (render_width as usize / (max_shortcut_width + 4)).max(1); + let rows = (shortcut_spans.len() + columns - 1) / columns; - loop { - let split_idx = shortcut_spans - .iter() - .scan(0usize, |total_len, s| { - // take at least one so that we guarantee that we drain the list - // otherwise, this might lock up if there's a shortcut that exceeds the window width - if *total_len == 0 { - *total_len += span_vec_len(s) + 4; - Some(()) - } else { - *total_len += span_vec_len(s); - if *total_len > render_width as usize { - None - } else { - *total_len += 4; - Some(()) - } - } + let mut lines: Vec> = Vec::new(); + + for row in 0..rows { + let row_spans: Vec<_> = (0..columns) + .filter_map(|col| { + let index = row * columns + col; + shortcut_spans.get(index).map(|span| { + let padding = max_shortcut_width - span_vec_len(span); + let mut span_clone = span.clone(); + span_clone.push(Span::raw(" ".repeat(padding))); + span_clone + }) }) - .count(); - - let rest = shortcut_spans.split_off(split_idx); - lines.push(add_spacing(shortcut_spans)); - - if rest.is_empty() { - break; - } else { - shortcut_spans = rest; - } + .collect(); + lines.push(add_spacing(row_spans)); } lines.into_boxed_slice() diff --git a/tui/src/state.rs b/tui/src/state.rs index 7807dd75..e0f66da7 100644 --- a/tui/src/state.rs +++ b/tui/src/state.rs @@ -22,8 +22,8 @@ use ratatui::{ use std::rc::Rc; use temp_dir::TempDir; -const MIN_WIDTH: u16 = 77; -const MIN_HEIGHT: u16 = 19; +const MIN_WIDTH: u16 = 100; +const MIN_HEIGHT: u16 = 25; const TITLE: &str = concat!("Linux Toolbox - ", env!("CARGO_PKG_VERSION")); const ACTIONS_GUIDE: &str = "List of important tasks performed by commands' names: From 0c8977192fbbfa8623716bb541c0348d430f05be Mon Sep 17 00:00:00 2001 From: nyx Date: Thu, 31 Oct 2024 14:27:13 -0400 Subject: [PATCH 13/27] fix color bleeding (#723) Co-authored-by: nyx --- tui/src/floating_text.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tui/src/floating_text.rs b/tui/src/floating_text.rs index 879fcbc5..da988afd 100644 --- a/tui/src/floating_text.rs +++ b/tui/src/floating_text.rs @@ -205,7 +205,8 @@ impl FloatContent for FloatingText { .title_style(Style::default().reversed()) .style(Style::default()); - // Draw the Block first + frame.render_widget(Clear, area); + frame.render_widget(block.clone(), area); // Calculate the inner area to ensure text is not drawn over the border @@ -253,9 +254,6 @@ impl FloatContent for FloatingText { .block(Block::default()) .highlight_style(Style::default().reversed()); - // Clear the text underneath the floats rendered area - frame.render_widget(Clear, inner_area); - // Render the list inside the bordered area frame.render_widget(list, inner_area); } From 2d14a0a7b60a2dfef2013831724f92fc72a69095 Mon Sep 17 00:00:00 2001 From: nyx Date: Thu, 31 Oct 2024 14:30:22 -0400 Subject: [PATCH 14/27] return user to their previous position if they exit a subdir (#725) * return user to their previous position if they enter a subdir * fix lint * implement changes proposed by adam Co-authored-by: Adam Perkowski * add newline back * coalesce `visit_stack` and `position_stack` (#6) --------- Co-authored-by: nyx Co-authored-by: Adam Perkowski Co-authored-by: cartercanedy <99052281+cartercanedy@users.noreply.github.com> --- tui/src/state.rs | 95 +++++++++++++++++++++++++++++++----------------- 1 file changed, 61 insertions(+), 34 deletions(-) diff --git a/tui/src/state.rs b/tui/src/state.rs index e0f66da7..77ddf906 100644 --- a/tui/src/state.rs +++ b/tui/src/state.rs @@ -52,7 +52,7 @@ pub struct AppState { current_tab: ListState, /// This stack keeps track of our "current directory". You can think of it as `pwd`. but not /// just the current directory, all paths that took us here, so we can "cd .." - visit_stack: Vec, + visit_stack: Vec<(NodeId, usize)>, /// This is the state associated with the list widget, used to display the selection in the /// widget selection: ListState, @@ -78,6 +78,13 @@ pub struct ListEntry { pub has_children: bool, } +enum SelectedItem { + UpDir, + Directory, + Command, + None, +} + impl AppState { pub fn new(theme: Theme, override_validation: bool) -> Self { let (temp_dir, tabs) = linutil_core::get_tabs(!override_validation); @@ -89,7 +96,7 @@ impl AppState { focus: Focus::List, tabs, current_tab: ListState::default().with_selected(Some(0)), - visit_stack: vec![root_id], + visit_stack: vec![(root_id, 0usize)], selection: ListState::default().with_selected(Some(0)), filter: Filter::new(), multi_select: false, @@ -554,7 +561,7 @@ impl AppState { self.filter.update_items( &self.tabs, self.current_tab.selected().unwrap(), - *self.visit_stack.last().unwrap(), + self.visit_stack.last().unwrap().0, ); if !self.is_current_tab_multi_selectable() { self.multi_select = false; @@ -578,9 +585,10 @@ impl AppState { } fn enter_parent_directory(&mut self) { - self.visit_stack.pop(); - self.selection.select(Some(0)); - self.update_items(); + if let Some((_, previous_position)) = self.visit_stack.pop() { + self.selection.select(Some(previous_position)); + self.update_items(); + } } fn get_selected_node(&self) -> Option> { @@ -607,20 +615,22 @@ impl AppState { } pub fn go_to_selected_dir(&mut self) { - let mut selected_index = self.selection.selected().unwrap_or(0); + let selected_index = self.selection.selected().unwrap_or(0); if !self.at_root() && selected_index == 0 { self.enter_parent_directory(); return; } - if !self.at_root() { - selected_index = selected_index.saturating_sub(1); - } + let actual_index = if self.at_root() { + selected_index + } else { + selected_index - 1 + }; - if let Some(item) = self.filter.item_list().get(selected_index) { + if let Some(item) = self.filter.item_list().get(actual_index) { if item.has_children { - self.visit_stack.push(item.id); + self.visit_stack.push((item.id, selected_index)); self.selection.select(Some(0)); self.update_items(); } @@ -652,7 +662,6 @@ impl AppState { pub fn selected_item_is_up_dir(&self) -> bool { let selected_index = self.selection.selected().unwrap_or(0); - !self.at_root() && selected_index == 0 } @@ -673,24 +682,39 @@ impl AppState { } } - fn handle_enter(&mut self) { - if self.selected_item_is_cmd() { - if self.selected_commands.is_empty() { - if let Some(node) = self.get_selected_node() { - self.selected_commands.push(node); - } - } - - let cmd_names = self - .selected_commands - .iter() - .map(|node| node.name.as_str()) - .collect::>(); - - let prompt = ConfirmPrompt::new(&cmd_names[..]); - self.focus = Focus::ConfirmationPrompt(Float::new(Box::new(prompt), 40, 40)); + fn get_selected_item_type(&self) -> SelectedItem { + if self.selected_item_is_up_dir() { + SelectedItem::UpDir + } else if self.selected_item_is_dir() { + SelectedItem::Directory + } else if self.selected_item_is_cmd() { + SelectedItem::Command } else { - self.go_to_selected_dir(); + SelectedItem::None + } + } + + fn handle_enter(&mut self) { + match self.get_selected_item_type() { + SelectedItem::UpDir => self.enter_parent_directory(), + SelectedItem::Directory => self.go_to_selected_dir(), + SelectedItem::Command => { + if self.selected_commands.is_empty() { + if let Some(node) = self.get_selected_node() { + self.selected_commands.push(node); + } + } + + let cmd_names = self + .selected_commands + .iter() + .map(|node| node.name.as_str()) + .collect::>(); + + let prompt = ConfirmPrompt::new(&cmd_names[..]); + self.focus = Focus::ConfirmationPrompt(Float::new(Box::new(prompt), 40, 40)); + } + SelectedItem::None => {} } } @@ -724,10 +748,13 @@ impl AppState { } fn refresh_tab(&mut self) { - self.visit_stack = vec![self.tabs[self.current_tab.selected().unwrap()] - .tree - .root() - .id()]; + self.visit_stack = vec![( + self.tabs[self.current_tab.selected().unwrap()] + .tree + .root() + .id(), + 0usize, + )]; self.selection.select(Some(0)); self.update_items(); } From 66a4334aee15f39d1b9a1ae329d3654ebaf7418e Mon Sep 17 00:00:00 2001 From: nyx Date: Thu, 31 Oct 2024 14:33:12 -0400 Subject: [PATCH 15/27] sort entries alphabetically (#726) Co-authored-by: nyx --- core/tabs/applications-setup/tab_data.toml | 126 ++++++++++----------- 1 file changed, 63 insertions(+), 63 deletions(-) diff --git a/core/tabs/applications-setup/tab_data.toml b/core/tabs/applications-setup/tab_data.toml index d2c59461..c102a5ce 100644 --- a/core/tabs/applications-setup/tab_data.toml +++ b/core/tabs/applications-setup/tab_data.toml @@ -1,50 +1,5 @@ name = "Applications Setup" -[[data]] -name = "Developer Tools" - -[[data.entries]] -name = "Github Desktop" -description = "GitHub Desktop is a user-friendly application that simplifies the process of managing Git repositories and interacting with GitHub, providing a graphical interface for tasks like committing, branching, and syncing changes." -script = "Developer-tools/githubdesktop-setup.sh" -task_list = "I" - -[[data.entries]] -name = "Neovim" -description = "Neovim is a refactor, and sometimes redactor, in the tradition of Vim.\nIt is not a rewrite but a continuation and extension of Vim.\nThis command configures neovim from CTT's neovim configuration.\nhttps://github.com/ChrisTitusTech/neovim" -script = "Developer-tools/neovim-setup.sh" -task_list = "I FM" - -[[data.entries]] -name = "Sublime Text" -description = "Sublime Text is a fast, lightweight, and customizable text editor known for its simplicity, powerful features, and wide range of plugins for various programming languages." -script = "Developer-tools/sublime-setup.sh" -task_list = "I" - -[[data.entries]] -name = "VS Code" -description = "Visual Studio Code (VS Code) is a lightweight, open-source code editor with built-in support for debugging, version control, and extensions for various programming languages and frameworks." -script = "Developer-tools/vscode-setup.sh" -task_list = "I" - -[[data.entries]] -name = "VS Codium" -description = "VSCodium is a free, open-source version of Visual Studio Code (VS Code) that removes Microsoft-specific telemetry and branding." -script = "Developer-tools/vscodium-setup.sh" -task_list = "I" - -[[data.entries]] -name = "Meld" -description = "Meld is a visual diff and merge tool that helps compare files, directories, and version-controlled projects." -script = "Developer-tools/meld-setup.sh" -task_list = "I FI" - -[[data.entries]] -name = "Ngrok" -description = "Ngrok is a tool that creates secure, temporary tunnels to expose local servers to the internet for testing and development." -script = "Developer-tools/ngrok-setup.sh" -task_list = "I" - [[data]] name = "Communication Apps" @@ -78,21 +33,71 @@ description = "Telegram is a cloud-based messaging app known for its speed and s script = "communication-apps/telegram-setup.sh" task_list = "I" -[[data.entries]] -name = "Zoom" -description = "Zoom is a widely-used video conferencing platform that allows users to host virtual meetings, webinars, and online collaboration with features like screen sharing and recording." -script = "communication-apps/zoom-setup.sh" -task_list = "I" - [[data.entries]] name = "Thunderbird" description = "Thunderbird is a free, open-source email client that offers powerful features like customizable email management, a built-in calendar, and extensive add-ons for enhanced functionality." script = "communication-apps/thunderbird-setup.sh" task_list = "I" +[[data.entries]] +name = "Zoom" +description = "Zoom is a widely-used video conferencing platform that allows users to host virtual meetings, webinars, and online collaboration with features like screen sharing and recording." +script = "communication-apps/zoom-setup.sh" +task_list = "I" + +[[data]] +name = "Developer Tools" + +[[data.entries]] +name = "Github Desktop" +description = "GitHub Desktop is a user-friendly application that simplifies the process of managing Git repositories and interacting with GitHub, providing a graphical interface for tasks like committing, branching, and syncing changes." +script = "Developer-tools/githubdesktop-setup.sh" +task_list = "I" + +[[data.entries]] +name = "Meld" +description = "Meld is a visual diff and merge tool that helps compare files, directories, and version-controlled projects." +script = "Developer-tools/meld-setup.sh" +task_list = "I FI" + +[[data.entries]] +name = "Neovim" +description = "Neovim is a refactor, and sometimes redactor, in the tradition of Vim.\nIt is not a rewrite but a continuation and extension of Vim.\nThis command configures neovim from CTT's neovim configuration.\nhttps://github.com/ChrisTitusTech/neovim" +script = "Developer-tools/neovim-setup.sh" +task_list = "I FM" + +[[data.entries]] +name = "Ngrok" +description = "Ngrok is a tool that creates secure, temporary tunnels to expose local servers to the internet for testing and development." +script = "Developer-tools/ngrok-setup.sh" +task_list = "I" + +[[data.entries]] +name = "Sublime Text" +description = "Sublime Text is a fast, lightweight, and customizable text editor known for its simplicity, powerful features, and wide range of plugins for various programming languages." +script = "Developer-tools/sublime-setup.sh" +task_list = "I" + +[[data.entries]] +name = "VS Code" +description = "Visual Studio Code (VS Code) is a lightweight, open-source code editor with built-in support for debugging, version control, and extensions for various programming languages and frameworks." +script = "Developer-tools/vscode-setup.sh" +task_list = "I" + +[[data.entries]] +name = "VS Codium" +description = "VSCodium is a free, open-source version of Visual Studio Code (VS Code) that removes Microsoft-specific telemetry and branding." +script = "Developer-tools/vscodium-setup.sh" +task_list = "I" + [[data]] name = "Office Suites" +[[data.entries]] +name = "FreeOffice" +script = "office-suites/freeoffice.sh" +task_list = "I" + [[data.entries]] name = "LibreOffice" script = "office-suites/libreoffice.sh" @@ -103,11 +108,6 @@ name = "OnlyOffice" script = "office-suites/onlyoffice.sh" task_list = "I" -[[data.entries]] -name = "FreeOffice" -script = "office-suites/freeoffice.sh" -task_list = "I" - [[data.entries]] name = "WPS Office" script = "office-suites/wpsoffice.sh" @@ -216,18 +216,18 @@ description = "Bottles allows Windows software, like applications and games, to script = "bottles-setup.sh" task_list = "FI" -[[data]] -name = "DWM-Titus" -description = "DWM is a dynamic window manager for X.\nIt manages windows in tiled, monocle and floating layouts.\nAll of the layouts can be applied dynamically, optimising the environment for the application in use and the task performed.\nThis command installs and configures DWM and a desktop manager.\nThe list of patches applied can be found in CTT's DWM repository\nhttps://github.com/ChrisTitusTech/dwm-titus" -script = "dwmtitus-setup.sh" -task_list = "I PFM SS" - [[data]] name = "Docker" description = "Docker is an open platform that uses OS-level virtualization to deliver software in packages called containers." script = "docker-setup.sh" task_list = "I SS" +[[data]] +name = "DWM-Titus" +description = "DWM is a dynamic window manager for X.\nIt manages windows in tiled, monocle and floating layouts.\nAll of the layouts can be applied dynamically, optimising the environment for the application in use and the task performed.\nThis command installs and configures DWM and a desktop manager.\nThe list of patches applied can be found in CTT's DWM repository\nhttps://github.com/ChrisTitusTech/dwm-titus" +script = "dwmtitus-setup.sh" +task_list = "I PFM SS" + [[data]] name = "Fastfetch" description = "Fastfetch is a neofetch-like tool for fetching system information and displaying it prettily.\nIt is written mainly in C, with performance and customizability in mind.\nThis command installs fastfetch and configures from CTT's mybash repository.\nhttps://github.com/ChrisTitusTech/mybash" @@ -294,4 +294,4 @@ values = [ "wayland", "Wayland" ] name = "ZSH Prompt" description = "The Z shell is a Unix shell that can be used as an interactive login shell and as a command interpreter for shell scripting. Zsh is an extended Bourne shell with many improvements, including some features of Bash, ksh, and tcsh.\nThis command installs ZSH prompt and provides basic configuration." script = "zsh-setup.sh" -task_list = "I FM" +task_list = "I FM" \ No newline at end of file From 1dcc3f3c99644c9aaf174b2bb9599ce8849545d1 Mon Sep 17 00:00:00 2001 From: nyx Date: Thu, 31 Oct 2024 14:35:53 -0400 Subject: [PATCH 16/27] allow scrolling past last entry / first entry (#727) * allow scrolling past last entry * Update tui/src/state.rs Co-authored-by: Liam <33645555+lj3954@users.noreply.github.com> * Update tui/src/state.rs Co-authored-by: Liam <33645555+lj3954@users.noreply.github.com> * apply changes proposed by adam Co-authored-by: Adam Perkowski * apply changes proposed by adam round 2 Co-authored-by: Adam Perkowski * undo changes proposed by adam in scroll up and down funcs --------- Co-authored-by: nyx Co-authored-by: Liam <33645555+lj3954@users.noreply.github.com> Co-authored-by: Adam Perkowski --- tui/src/state.rs | 69 +++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 57 insertions(+), 12 deletions(-) diff --git a/tui/src/state.rs b/tui/src/state.rs index 77ddf906..d0c548bf 100644 --- a/tui/src/state.rs +++ b/tui/src/state.rs @@ -491,17 +491,9 @@ impl AppState { Focus::TabList => match key.code { KeyCode::Enter | KeyCode::Char('l') | KeyCode::Right => self.focus = Focus::List, - KeyCode::Char('j') | KeyCode::Down - if self.current_tab.selected().unwrap() + 1 < self.tabs.len() => - { - self.current_tab.select_next(); - self.refresh_tab(); - } + KeyCode::Char('j') | KeyCode::Down => self.scroll_tab_down(), - KeyCode::Char('k') | KeyCode::Up => { - self.current_tab.select_previous(); - self.refresh_tab(); - } + KeyCode::Char('k') | KeyCode::Up => self.scroll_tab_up(), KeyCode::Char('/') => self.enter_search(), KeyCode::Char('t') => self.theme.next(), @@ -511,8 +503,8 @@ impl AppState { }, Focus::List if key.kind != KeyEventKind::Release => match key.code { - KeyCode::Char('j') | KeyCode::Down => self.selection.select_next(), - KeyCode::Char('k') | KeyCode::Up => self.selection.select_previous(), + KeyCode::Char('j') | KeyCode::Down => self.scroll_down(), + KeyCode::Char('k') | KeyCode::Up => self.scroll_up(), KeyCode::Char('p') | KeyCode::Char('P') => self.enable_preview(), KeyCode::Char('d') | KeyCode::Char('D') => self.enable_description(), KeyCode::Enter | KeyCode::Char('l') | KeyCode::Right => self.handle_enter(), @@ -531,6 +523,34 @@ impl AppState { true } + fn scroll_down(&mut self) { + let len = self.filter.item_list().len(); + if len == 0 { + return; + } + let current = self.selection.selected().unwrap_or(0); + let max_index = if self.at_root() { len - 1 } else { len }; + let next = if current + 1 > max_index { + 0 + } else { + current + 1 + }; + + self.selection.select(Some(next)); + } + + fn scroll_up(&mut self) { + let len = self.filter.item_list().len(); + if len == 0 { + return; + } + let current = self.selection.selected().unwrap_or(0); + let max_index = if self.at_root() { len - 1 } else { len }; + let next = if current == 0 { max_index } else { current - 1 }; + + self.selection.select(Some(next)); + } + fn toggle_multi_select(&mut self) { if self.is_current_tab_multi_selectable() { self.multi_select = !self.multi_select; @@ -567,6 +587,13 @@ impl AppState { self.multi_select = false; self.selected_commands.clear(); } + let len = self.filter.item_list().len(); + if len > 0 { + let current = self.selection.selected().unwrap_or(0); + self.selection.select(Some(current.min(len - 1))); + } else { + self.selection.select(None); + } } /// Checks either the current tree node is the root node (can we go up the tree or no) @@ -766,6 +793,24 @@ impl AppState { 80, ); } + + fn scroll_tab_down(&mut self) { + let len = self.tabs.len(); + let current = self.current_tab.selected().unwrap_or(0); + let next = if current + 1 >= len { 0 } else { current + 1 }; + + self.current_tab.select(Some(next)); + self.refresh_tab(); + } + + fn scroll_tab_up(&mut self) { + let len = self.tabs.len(); + let current = self.current_tab.selected().unwrap_or(0); + let next = if current == 0 { len - 1 } else { current - 1 }; + + self.current_tab.select(Some(next)); + self.refresh_tab(); + } } #[cfg(feature = "tips")] From 38138334b712d1cff80be05f58a8c9469cbd795a Mon Sep 17 00:00:00 2001 From: nyx Date: Thu, 31 Oct 2024 14:37:01 -0400 Subject: [PATCH 17/27] dont allow scrolling when last line is visible (#729) * dont allow scrolling when last line is visible * apply changes proposed by adam Co-authored-by: Adam Perkowski --------- Co-authored-by: nyx Co-authored-by: Adam Perkowski --- tui/src/floating_text.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tui/src/floating_text.rs b/tui/src/floating_text.rs index da988afd..be22958c 100644 --- a/tui/src/floating_text.rs +++ b/tui/src/floating_text.rs @@ -30,6 +30,7 @@ pub struct FloatingText { v_scroll: usize, h_scroll: usize, mode_title: String, + frame_height: usize, } macro_rules! style { @@ -137,6 +138,7 @@ impl FloatingText { max_line_width, v_scroll: 0, h_scroll: 0, + frame_height: 0, } } @@ -167,11 +169,13 @@ impl FloatingText { max_line_width, h_scroll: 0, v_scroll: 0, + frame_height: 0, }) } fn scroll_down(&mut self) { - if self.v_scroll + 1 < self.src.len() { + let visible_lines = self.frame_height.saturating_sub(2); + if self.v_scroll + visible_lines < self.src.len() { self.v_scroll += 1; } } @@ -197,6 +201,8 @@ impl FloatingText { impl FloatContent for FloatingText { fn draw(&mut self, frame: &mut Frame, area: Rect) { + self.frame_height = area.height as usize; + // Define the Block with a border and background color let block = Block::default() .borders(Borders::ALL) From f9d7ed94b13ea6a153a836a48a53510a3a638ba4 Mon Sep 17 00:00:00 2001 From: nyx Date: Thu, 31 Oct 2024 14:37:41 -0400 Subject: [PATCH 18/27] fix bug in ssh commands (#733) Co-authored-by: nyx --- core/tabs/utils/ssh.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core/tabs/utils/ssh.sh b/core/tabs/utils/ssh.sh index 1e402546..e5a899ef 100644 --- a/core/tabs/utils/ssh.sh +++ b/core/tabs/utils/ssh.sh @@ -4,14 +4,15 @@ # Check if ~/.ssh/config exists, if not, create it if [ ! -f ~/.ssh/config ]; then - touch ~/.ssh/config - chmod 600 ~/.ssh/config + mkdir -p "$HOME/.ssh" + touch "$HOME/.ssh/config" + chmod 600 "$HOME/.ssh/config" fi # Function to show available hosts from ~/.ssh/config show_available_hosts() { printf "%b\n" "Available Systems:" - grep -E "^Host " ~/.ssh/config | awk '{print $2}' + grep -E "^Host " "$HOME/.ssh/config" | awk '{print $2}' printf "%b\n" "-------------------" } From ded7fcb735927c688f231f9fa3b22257fe6f5783 Mon Sep 17 00:00:00 2001 From: nyx Date: Thu, 31 Oct 2024 14:39:26 -0400 Subject: [PATCH 19/27] fix issues with set brightness (#747) Co-authored-by: nnyyxxxx --- core/tabs/utils/monitor-control/set_brightness.sh | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) mode change 100644 => 100755 core/tabs/utils/monitor-control/set_brightness.sh diff --git a/core/tabs/utils/monitor-control/set_brightness.sh b/core/tabs/utils/monitor-control/set_brightness.sh old mode 100644 new mode 100755 index db745ab8..0b7a2a83 --- a/core/tabs/utils/monitor-control/set_brightness.sh +++ b/core/tabs/utils/monitor-control/set_brightness.sh @@ -6,8 +6,6 @@ adjust_monitor_brightness() { while true; do monitor_list=$(detect_connected_monitors) - monitor_array=$(echo "$monitor_list" | tr '\n' ' ') - set -- "$monitor_array" count=1 clear @@ -15,7 +13,7 @@ adjust_monitor_brightness() { printf "%b\n" "${YELLOW} Adjust Monitor Brightness${RC}" printf "%b\n" "${YELLOW}=========================================${RC}" printf "%b\n" "${YELLOW}Choose a monitor to adjust brightness:${RC}" - for monitor in "$@"; do + echo "$monitor_list" | while IFS= read -r monitor; do echo "$count. $monitor" count=$((count + 1)) done @@ -35,18 +33,18 @@ adjust_monitor_brightness() { continue fi - if [ "$monitor_choice" -lt 1 ] || [ "$monitor_choice" -gt "$#" ]; then + monitor_count=$(echo "$monitor_list" | wc -l) + if [ "$monitor_choice" -lt 1 ] || [ "$monitor_choice" -gt "$monitor_count" ]; then printf "%b\n" "${RED}Invalid selection. Please try again.${RC}" printf "Press [Enter] to continue..." read -r dummy continue fi - monitor_name=$(eval echo "\${$monitor_choice}") + monitor_name=$(echo "$monitor_list" | sed -n "${monitor_choice}p") current_brightness=$(get_current_brightness "$monitor_name") - # Correctly calculate the brightness percentage - current_brightness_percentage=$(awk "BEGIN {printf \"%.0f\", $current_brightness * 100}") + current_brightness_percentage=$(awk -v brightness="$current_brightness" 'BEGIN {printf "%.0f", brightness * 100}') printf "%b\n" "${YELLOW}Current brightness for $monitor_name${RC}: ${GREEN}$current_brightness_percentage%${RC}" while true; do From 9353849e1637d3019325a081e340085c67ed0c7d Mon Sep 17 00:00:00 2001 From: nyx Date: Thu, 31 Oct 2024 14:40:07 -0400 Subject: [PATCH 20/27] use bin for faster installation (#748) Co-authored-by: nyx --- core/tabs/system-setup/arch/paru-setup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/tabs/system-setup/arch/paru-setup.sh b/core/tabs/system-setup/arch/paru-setup.sh index fba445ef..c08e5d8d 100755 --- a/core/tabs/system-setup/arch/paru-setup.sh +++ b/core/tabs/system-setup/arch/paru-setup.sh @@ -8,8 +8,8 @@ installDepend() { if ! command_exists paru; then printf "%b\n" "${YELLOW}Installing paru as AUR helper...${RC}" "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm base-devel git - cd /opt && "$ESCALATION_TOOL" git clone https://aur.archlinux.org/paru.git && "$ESCALATION_TOOL" chown -R "$USER": ./paru - cd paru && makepkg --noconfirm -si + cd /opt && "$ESCALATION_TOOL" git clone https://aur.archlinux.org/paru-bin.git && "$ESCALATION_TOOL" chown -R "$USER": ./paru-bin + cd paru-bin && makepkg --noconfirm -si printf "%b\n" "${GREEN}Paru installed${RC}" else printf "%b\n" "${GREEN}Paru already installed${RC}" From 52565e5ea1eb3b00023e15096d2b2e2a77b70fe2 Mon Sep 17 00:00:00 2001 From: nyx Date: Thu, 31 Oct 2024 14:41:03 -0400 Subject: [PATCH 21/27] clear the search bar if the user changes categories (#752) Co-authored-by: nyx --- tui/src/filter.rs | 4 ++++ tui/src/state.rs | 1 + 2 files changed, 5 insertions(+) diff --git a/tui/src/filter.rs b/tui/src/filter.rs index 984d5d68..20192b03 100644 --- a/tui/src/filter.rs +++ b/tui/src/filter.rs @@ -164,4 +164,8 @@ impl Filter { self.search_input.remove(current); } } + pub fn clear_search(&mut self) { + self.search_input.clear(); + self.input_position = 0; + } } diff --git a/tui/src/state.rs b/tui/src/state.rs index d0c548bf..0f0b6fe5 100644 --- a/tui/src/state.rs +++ b/tui/src/state.rs @@ -783,6 +783,7 @@ impl AppState { 0usize, )]; self.selection.select(Some(0)); + self.filter.clear_search(); self.update_items(); } From 72dfb2996965b66d11001cf3c2847e30c0ba8a87 Mon Sep 17 00:00:00 2001 From: nyx Date: Thu, 31 Oct 2024 14:42:06 -0400 Subject: [PATCH 22/27] dont allow the user to bring up the command desc if there is none (#753) * dont allow the user to bring up the command desc if there is none * obey our god lints --------- Co-authored-by: nyx --- tui/src/state.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tui/src/state.rs b/tui/src/state.rs index 0f0b6fe5..be120436 100644 --- a/tui/src/state.rs +++ b/tui/src/state.rs @@ -704,8 +704,10 @@ impl AppState { fn enable_description(&mut self) { if let Some(command_description) = self.get_selected_description() { - let description = FloatingText::new(command_description, "Command Description"); - self.spawn_float(description, 80, 80); + if !command_description.is_empty() { + let description = FloatingText::new(command_description, "Command Description"); + self.spawn_float(description, 80, 80); + } } } From fc2d7317540a2f592c60a531c4fce35e3391143c Mon Sep 17 00:00:00 2001 From: nyx Date: Thu, 31 Oct 2024 14:49:08 -0400 Subject: [PATCH 23/27] do not exit linutil in confirmation prompt when q is pressed (#758) * do not exit linutil in confirmation prompt when q is pressed * remove cap support * add ``ctrl + c`` exiting Co-authored-by: Adam Perkowski --------- Co-authored-by: nyx Co-authored-by: Adam Perkowski --- tui/src/confirmation.rs | 10 +++++----- tui/src/state.rs | 14 +++++++++----- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/tui/src/confirmation.rs b/tui/src/confirmation.rs index 28732e35..d883fd2f 100644 --- a/tui/src/confirmation.rs +++ b/tui/src/confirmation.rs @@ -88,7 +88,7 @@ impl FloatContent for ConfirmPrompt { use KeyCode::*; self.status = match key.code { Char('y') | Char('Y') => ConfirmStatus::Confirm, - Char('n') | Char('N') | Esc => ConfirmStatus::Abort, + Char('n') | Char('N') | Esc | Char('q') => ConfirmStatus::Abort, Char('j') => { self.scroll_down(); ConfirmStatus::None @@ -116,10 +116,10 @@ impl FloatContent for ConfirmPrompt { "Confirmation prompt", Box::new([ Shortcut::new("Continue", ["Y", "y"]), - Shortcut::new("Abort", ["N", "n"]), - Shortcut::new("Scroll up", ["j"]), - Shortcut::new("Scroll down", ["k"]), - Shortcut::new("Close linutil", ["CTRL-c", "q"]), + Shortcut::new("Abort", ["N", "n", "q", "Esc"]), + Shortcut::new("Scroll up", ["k"]), + Shortcut::new("Scroll down", ["j"]), + Shortcut::new("Close linutil", ["CTRL-c"]), ]), ) } diff --git a/tui/src/state.rs b/tui/src/state.rs index be120436..fbd21ac8 100644 --- a/tui/src/state.rs +++ b/tui/src/state.rs @@ -420,11 +420,15 @@ impl AppState { // This should be defined first to allow closing // the application even when not drawable ( If terminal is small ) // Exit on 'q' or 'Ctrl-c' input - if matches!( - self.focus, - Focus::TabList | Focus::List | Focus::ConfirmationPrompt(_) - ) && (key.code == KeyCode::Char('q') - || key.modifiers.contains(KeyModifiers::CONTROL) && key.code == KeyCode::Char('c')) + if matches!(self.focus, Focus::TabList | Focus::List) + && (key.code == KeyCode::Char('q') + || key.modifiers.contains(KeyModifiers::CONTROL) && key.code == KeyCode::Char('c')) + { + return false; + } + + if matches!(self.focus, Focus::ConfirmationPrompt(_)) + && (key.modifiers.contains(KeyModifiers::CONTROL) && key.code == KeyCode::Char('c')) { return false; } From f612a38762c287c0f84dc78ec74081de2a4a273b Mon Sep 17 00:00:00 2001 From: nyx Date: Thu, 31 Oct 2024 14:57:59 -0400 Subject: [PATCH 24/27] fix fedora timeshift (#774) --- core/tabs/utils/tab_data.toml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/tabs/utils/tab_data.toml b/core/tabs/utils/tab_data.toml index ba7c0e1b..00b68edf 100644 --- a/core/tabs/utils/tab_data.toml +++ b/core/tabs/utils/tab_data.toml @@ -164,6 +164,11 @@ name = "Timeshift Backup" script = "timeshift.sh" task_list = "I" +[[data.preconditions]] +matches = false +data = "command_exists" +values = [ "dnf" ] + [[data]] name = "WiFi Manager" description = "This utility is designed to manage wifi in your system" From 1d617787362a2c3488ee893c2c67db55b546b20e Mon Sep 17 00:00:00 2001 From: Angaddeep Singh <159604852+Angxddeep@users.noreply.github.com> Date: Fri, 1 Nov 2024 00:31:04 +0530 Subject: [PATCH 25/27] feat(fedora): release upgrade script (#886) * 1st commit * Update tab_data.toml * bashism fix * Update core/tabs/system-setup/fedora/fedora-upgrade.sh Co-authored-by: Adam Perkowski * Update core/tabs/system-setup/fedora/fedora-upgrade.sh Co-authored-by: Adam Perkowski * Update core/tabs/system-setup/fedora/fedora-upgrade.sh Co-authored-by: Adam Perkowski * Update core/tabs/system-setup/fedora/fedora-upgrade.sh Co-authored-by: Adam Perkowski * Update core/tabs/system-setup/tab_data.toml Co-authored-by: Adam Perkowski * Update core/tabs/system-setup/fedora/fedora-upgrade.sh Co-authored-by: Adam Perkowski * Update core/tabs/system-setup/fedora/fedora-upgrade.sh Co-authored-by: Adam Perkowski * Update core/tabs/system-setup/fedora/fedora-upgrade.sh Co-authored-by: Adam Perkowski * Update core/tabs/system-setup/fedora/fedora-upgrade.sh Co-authored-by: Adam Perkowski * update * Apply suggestions from code review Co-authored-by: JEEVITHA KANNAN K S * Update fedora-upgrade.sh --------- Co-authored-by: Adam Perkowski Co-authored-by: JEEVITHA KANNAN K S --- .../system-setup/fedora/fedora-upgrade.sh | 83 +++++++++++++++++++ core/tabs/system-setup/tab_data.toml | 6 ++ 2 files changed, 89 insertions(+) create mode 100644 core/tabs/system-setup/fedora/fedora-upgrade.sh diff --git a/core/tabs/system-setup/fedora/fedora-upgrade.sh b/core/tabs/system-setup/fedora/fedora-upgrade.sh new file mode 100644 index 00000000..47f1e061 --- /dev/null +++ b/core/tabs/system-setup/fedora/fedora-upgrade.sh @@ -0,0 +1,83 @@ +#!/bin/sh -e + +. ../../common-script.sh + +current_version=$(rpm -E '%{fedora}') +next_version=$((current_version + 1)) + +update() { + printf "%b\n" "${YELLOW}Make sure your system is fully updated; if not, update it first and reboot once.${RC}" + printf "%b\n" "${CYAN}Your current Fedora version is $current_version.${RC}" + printf "%b\n" "${CYAN}The next available version is $next_version.${RC}" + + printf "%b\n" "${YELLOW}Do you want to update to $next_version? (y/n): ${RC}" + read -r response + + case "$response" in + y|Y) + printf "%b\n" "${CYAN}Preparing to update to $next_version...${RC}" + + if ! "$ESCALATION_TOOL" "$PACKAGER" install dnf-plugin-system-upgrade -y; then + printf "%b\n" "${RED}Failed to install dnf-plugin-system-upgrade.${RC}" + exit 1 + fi + + if ! "$ESCALATION_TOOL" "$PACKAGER" system-upgrade download --releasever="$next_version" -y ; then + printf "%b\n" "${RED}Failed to download the upgrade packages.${RC}" + exit 1 + fi + + printf "%b\n" "${YELLOW}Do you want to reboot now to apply the upgrade? (y/n): ${RC}" + read -r reboot_response + + case "$reboot_response" in + y|Y) + printf "%b\n" "${YELLOW}Rebooting to apply the upgrade...${RC}" + "$ESCALATION_TOOL" "$PACKAGER" system-upgrade reboot + ;; + *) + printf "%b\n" "${YELLOW}You can reboot later to apply the upgrade.${RC}" + ;; + esac + ;; + *) + printf "%b\n" "${RED}No upgrade performed.${RC}" + ;; + esac +} + +post_upgrade() { + printf "%b\n" "${YELLOW}Running post-upgrade tasks...${RC}" + + case "$PACKAGER" in + dnf) + "$ESCALATION_TOOL" "$PACKAGER" autoremove + "$ESCALATION_TOOL" "$PACKAGER" distro-sync -y + ;; + *) + printf "%b\n" "${RED}Unsupported package manager: $PACKAGER.${RC}" + exit 1 + ;; + esac +} + +checkEnv +checkEscalationTool + +printf "%b\n" "${YELLOW}Select an option:${RC}" +printf "%b\n" "${GREEN}1. Upgrade to the next Fedora version${RC}" +printf "%b\n" "${GREEN}2. Run post-upgrade tasks${RC}" +read -r choice + +case "$choice" in + 1) + update + ;; + 2) + post_upgrade + ;; + *) + printf "%b\n" "${RED}Invalid option. Please select 1 or 2.${RC}" + exit 1 + ;; +esac diff --git a/core/tabs/system-setup/tab_data.toml b/core/tabs/system-setup/tab_data.toml index 080c06d9..850ef38e 100644 --- a/core/tabs/system-setup/tab_data.toml +++ b/core/tabs/system-setup/tab_data.toml @@ -59,6 +59,12 @@ description = "RPM Fusion provides software that the Fedora Project or Red Hat d script = "fedora/rpm-fusion-setup.sh" task_list = "MP" +[[data.entries]] +name = "Upgrade to a New Fedora Release" +description = "Upgrades system to the next Fedora release" +script = "fedora/fedora-upgrade.sh" +task_list = "MP" + [[data.entries]] name = "Virtualization" description = "Enables Virtualization through dnf" From f4c20c80f047c879a87279d1db3d6a2f930085b2 Mon Sep 17 00:00:00 2001 From: Angelos Giannourakos Date: Thu, 31 Oct 2024 21:02:25 +0200 Subject: [PATCH 26/27] fix(nala): remove autoclean from `system-cleanup.sh` (#697) * Removing autoclean for apt | nala Removing autoclean command for apt | nala because there is no such command on debian especially for nala * Update system-cleanup.sh * Update system-cleanup.sh * Update system-cleanup.sh --- core/tabs/system-setup/system-cleanup.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/core/tabs/system-setup/system-cleanup.sh b/core/tabs/system-setup/system-cleanup.sh index 2641a14f..57b827b9 100755 --- a/core/tabs/system-setup/system-cleanup.sh +++ b/core/tabs/system-setup/system-cleanup.sh @@ -7,10 +7,8 @@ cleanup_system() { case "$PACKAGER" in apt-get|nala) "$ESCALATION_TOOL" "$PACKAGER" clean - "$ESCALATION_TOOL" "$PACKAGER" autoremove -y - "$ESCALATION_TOOL" "$PACKAGER" autoclean + "$ESCALATION_TOOL" "$PACKAGER" autoremove -y "$ESCALATION_TOOL" du -h /var/cache/apt - "$ESCALATION_TOOL" "$PACKAGER" clean ;; zypper) "$ESCALATION_TOOL" "$PACKAGER" clean -a From ad678b2d4b2c138ab60b373484e7529c13b07d39 Mon Sep 17 00:00:00 2001 From: JEEVITHA KANNAN K S Date: Fri, 1 Nov 2024 00:37:20 +0530 Subject: [PATCH 27/27] Fix common script paths (#717) --- core/tabs/applications-setup/office-suites/freeoffice.sh | 2 +- core/tabs/applications-setup/office-suites/libreoffice.sh | 2 +- core/tabs/applications-setup/office-suites/onlyoffice.sh | 2 +- core/tabs/applications-setup/office-suites/wpsoffice.sh | 2 +- core/tabs/applications-setup/pdf-suites/evince.sh | 2 +- core/tabs/applications-setup/pdf-suites/okular.sh | 2 +- core/tabs/applications-setup/pdf-suites/pdfstudio.sh | 2 +- core/tabs/applications-setup/pdf-suites/pdfstudioviewer.sh | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/core/tabs/applications-setup/office-suites/freeoffice.sh b/core/tabs/applications-setup/office-suites/freeoffice.sh index 7effa3fb..d289165e 100644 --- a/core/tabs/applications-setup/office-suites/freeoffice.sh +++ b/core/tabs/applications-setup/office-suites/freeoffice.sh @@ -1,6 +1,6 @@ #!/bin/sh -e -. ../common-script.sh +. ../../common-script.sh installFreeOffice() { if ! command_exists softmaker-freeoffice-2024 freeoffice softmaker; then diff --git a/core/tabs/applications-setup/office-suites/libreoffice.sh b/core/tabs/applications-setup/office-suites/libreoffice.sh index a9850fdc..165730c1 100644 --- a/core/tabs/applications-setup/office-suites/libreoffice.sh +++ b/core/tabs/applications-setup/office-suites/libreoffice.sh @@ -1,6 +1,6 @@ #!/bin/sh -e -. ../common-script.sh +. ../../common-script.sh installLibreOffice() { if ! command_exists libreoffice; then diff --git a/core/tabs/applications-setup/office-suites/onlyoffice.sh b/core/tabs/applications-setup/office-suites/onlyoffice.sh index aaea7547..9e80fd31 100644 --- a/core/tabs/applications-setup/office-suites/onlyoffice.sh +++ b/core/tabs/applications-setup/office-suites/onlyoffice.sh @@ -1,6 +1,6 @@ #!/bin/sh -e -. ../common-script.sh +. ../../common-script.sh installOnlyOffice() { if ! command_exists onlyoffice-desktopeditors; then diff --git a/core/tabs/applications-setup/office-suites/wpsoffice.sh b/core/tabs/applications-setup/office-suites/wpsoffice.sh index ce1bbc72..5e75e800 100644 --- a/core/tabs/applications-setup/office-suites/wpsoffice.sh +++ b/core/tabs/applications-setup/office-suites/wpsoffice.sh @@ -1,6 +1,6 @@ #!/bin/sh -e -. ../common-script.sh +. ../../common-script.sh installWpsOffice() { if ! command_exists com.wps.Office; then diff --git a/core/tabs/applications-setup/pdf-suites/evince.sh b/core/tabs/applications-setup/pdf-suites/evince.sh index 9e0d8da0..9118d36d 100644 --- a/core/tabs/applications-setup/pdf-suites/evince.sh +++ b/core/tabs/applications-setup/pdf-suites/evince.sh @@ -1,6 +1,6 @@ #!/bin/sh -e -. ../common-script.sh +. ../../common-script.sh installEvince() { if ! command_exists evince; then diff --git a/core/tabs/applications-setup/pdf-suites/okular.sh b/core/tabs/applications-setup/pdf-suites/okular.sh index 6ed8d4d1..785d512c 100644 --- a/core/tabs/applications-setup/pdf-suites/okular.sh +++ b/core/tabs/applications-setup/pdf-suites/okular.sh @@ -1,6 +1,6 @@ #!/bin/sh -e -. ../common-script.sh +. ../../common-script.sh installOkular() { if ! command_exists okular; then diff --git a/core/tabs/applications-setup/pdf-suites/pdfstudio.sh b/core/tabs/applications-setup/pdf-suites/pdfstudio.sh index 03ba05f4..5dd5fbf9 100644 --- a/core/tabs/applications-setup/pdf-suites/pdfstudio.sh +++ b/core/tabs/applications-setup/pdf-suites/pdfstudio.sh @@ -1,6 +1,6 @@ #!/bin/sh -e -. ../common-script.sh +. ../../common-script.sh installPdfstudio() { if ! command_exists pdfstudio2024; then diff --git a/core/tabs/applications-setup/pdf-suites/pdfstudioviewer.sh b/core/tabs/applications-setup/pdf-suites/pdfstudioviewer.sh index 72013a11..e0ab27cf 100644 --- a/core/tabs/applications-setup/pdf-suites/pdfstudioviewer.sh +++ b/core/tabs/applications-setup/pdf-suites/pdfstudioviewer.sh @@ -1,6 +1,6 @@ #!/bin/sh -e -. ../common-script.sh +. ../../common-script.sh installPdfstudioviewer() { if ! command_exists pdfstudioviewer2024; then