diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 00000000..35049cbc --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,2 @@ +[alias] +xtask = "run --package xtask --" diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 5a2c71b1..f0b02574 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -16,6 +16,7 @@ cd linutil ``` ## 3. Make your changes + - **Edit the files you want to change**: Make your changes to the relevant files. - **Test your changes**: Run `cargo run` to test your modifications in a local environment and ensure everything works as expected. @@ -60,6 +61,7 @@ cd linutil ## 11. Documentation - **Update the documentation**: If your change affects the functionality, please update the relevant documentation files to reflect this. +- **Automatic generation**: If you decide to add functionality through a new shell script, make sure to fill out all fields in `tab_data.toml` and run `cargo xtask docgen`. ## 12. License 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). diff --git a/.github/mkdocs.yml b/.github/mkdocs.yml index b0453a8e..9f7e0038 100644 --- a/.github/mkdocs.yml +++ b/.github/mkdocs.yml @@ -6,7 +6,7 @@ nav: - Introduction: 'index.md' - User Guide: 'userguide.md' - Contributing: - - Contributing Guide: 'contribute.md' + - Contributing Guide: 'contributing.md' - Roadmap: 'roadmap.md' - Documentation: - Known Issues: 'KnownIssues.md' @@ -86,4 +86,4 @@ plugins: minify_html: true htmlmin_opts: remove_comments: true - cache_safe: true \ No newline at end of file + cache_safe: true diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml deleted file mode 100644 index b94fa633..00000000 --- a/.github/release-drafter.yml +++ /dev/null @@ -1,66 +0,0 @@ -tag-prefix: "" -categories: - - title: '🚀 Features' - labels: - - 'feature' - - 'enhancement' - - title: '🐛 Bug Fixes' - labels: - - 'fix' - - 'bugfix' - - 'bug' - - title: '📚 Documentation' - label: 'documentation' - - title: '🔒 Security' - label: 'security' - - title: '🧰 GitHub Actions' - label: 'github actions' -change-template: '- $TITLE @$AUTHOR (#$NUMBER)' -template: | - ## Changes - - $CHANGES - -change-title-escapes: '\<*_&"''' -autolabeler: - - label: 'documentation' - files: - - '*.md' - branch: - - '/docs{0,1}\/.+/' - - label: 'bug' - branch: - - '/fix\/.+/' - title: - - '/fix/i' - - label: 'enhancement' - branch: - - '/feature\/.+/' - body: - - '/[A-Z]+-[0-9]+/' - - label: 'documentation' - files: - - '**/*.md' - - 'docs/**/*' - - label: 'security' - branch: - - '/security\/.+/' - -include-labels: - - 'documentation' - - 'bug' - - 'enhancement' - - 'security' - - 'github actions' - -replacers: - - search: /"/g - replace: '' - - search: /'/g - replace: '' - - search: /`/g - replace: '' -exclude-labels: - - 'skip-changelog' - -filter-by-commitish: false \ No newline at end of file diff --git a/.github/release.yml b/.github/release.yml new file mode 100644 index 00000000..8668f1c3 --- /dev/null +++ b/.github/release.yml @@ -0,0 +1,35 @@ +changelog: + categories: + - title: '🚀 Features' + labels: + - 'enhancement' + - title: '🐛 Bug Fixes' + labels: + - 'bug' + - title: '⚙️ Refactoring' + labels: + - 'refactor' + - title: '🧩 UI/UX' + labels: + - 'UI/UX' + - title: '📚 Documentation' + labels: + - 'documentation' + - title: '🔒 Security' + labels: + - 'security' + - title: '🧰 GitHub Actions' + labels: + - 'github_actions' + - title: '🦀 Rust' + labels: + - 'rust' + - title: '📃 Scripting' + labels: + - 'script' + - title: 'Other Changes' + labels: + - "*" + exclude: + labels: + - 'skip-changelog' diff --git a/.github/workflows/bashisms.yml b/.github/workflows/bashisms.yml index 7226bb5c..ffbe983b 100644 --- a/.github/workflows/bashisms.yml +++ b/.github/workflows/bashisms.yml @@ -3,7 +3,7 @@ name: Check for bashisms on: pull_request: paths: - - core/tabs/** + - 'core/tabs/**/*.sh' merge_group: workflow_dispatch: @@ -15,21 +15,33 @@ jobs: - uses: actions/checkout@v4 - run: git fetch origin ${{ github.base_ref }} - - name: Get a list of changed script files - id: get_sh_files - run: | - sh_files=$(git diff --name-only origin/${{ github.base_ref }} HEAD core/tabs | grep '\.sh$' || true) - echo "::set-output name=sh_files::$sh_files" - - name: Install devscripts - if: steps.get_sh_files.outputs.sh_files != '' - run: sudo apt-get update && sudo apt-get install devscripts + run: sudo apt-get update && sudo apt-get install -y devscripts + + - name: Get changed .sh files (PR only) + id: changed-sh-files + if: github.event_name == 'pull_request' + uses: tj-actions/changed-files@v45 + with: + files: '**/*.sh' + + - name: Get all .sh files (if workflow dispatched) + id: sh-files + if: github.event_name != 'pull_request' + run: | + files=$(find . -type f -name "*.sh" | tr '\n' ' ') + echo "files=${files:-none}" >> $GITHUB_ENV + + - name: Set FILES for bashism check + id: set-files + run: | + if [[ "${{ steps.changed-sh-files.outputs.any_changed }}" == 'true' ]]; then + echo "FILES=${{ steps.changed-sh-files.outputs.all_changed_files }}" >> $GITHUB_ENV + else + echo "FILES=${{ env.files }}" >> $GITHUB_ENV + fi - name: Check for bashisms - if: steps.get_sh_files.outputs.sh_files != '' run: | - for file in ${{ steps.get_sh_files.outputs.sh_files }}; do - if [[ -f "$file" ]]; then - checkbashisms "$file" - fi - done + IFS=' ' read -r -a file_array <<< "$FILES" + checkbashisms "${file_array[@]}" diff --git a/.github/workflows/github-pages.yml b/.github/workflows/github-pages.yml index 0bd2d476..94ca5e3c 100644 --- a/.github/workflows/github-pages.yml +++ b/.github/workflows/github-pages.yml @@ -13,6 +13,10 @@ on: jobs: build-and-deploy: runs-on: ubuntu-latest + environment: linutil_env + permissions: + contents: write + pull-requests: write steps: - name: Checkout Repository @@ -20,6 +24,23 @@ jobs: with: fetch-depth: '0' # Fetch all commit history for all branches as well as tags. + - name: Copy Contributing Guidelines + run: | + echo -e "\n\n$(cat .github/CONTRIBUTING.md)" > 'docs/contributing.md' + + - name: Create Pull Request + uses: peter-evans/create-pull-request@v6 + with: + commit-message: Update Contributing Guidelines + title: 'docs: Update Contributing Guidelines' + body: 'Automated update of Contributing Guidelines from .github/CONTRIBUTING.md' + branch: update-contributing-guidelines + delete-branch: true + base: main + labels: documentation + token: ${{ secrets.PAT_TOKEN }} + if: success() + - name: Setup Python uses: actions/setup-python@v5 with: diff --git a/.github/workflows/linutil.yml b/.github/workflows/linutil.yml index f7f369e8..187f1e54 100644 --- a/.github/workflows/linutil.yml +++ b/.github/workflows/linutil.yml @@ -1,8 +1,6 @@ name: LinUtil Release on: - push: - branches: ["main"] workflow_dispatch: permissions: @@ -48,25 +46,9 @@ jobs: run: cargo build --target-dir=build --release --verbose --target=x86_64-unknown-linux-musl --all-features - name: Build aarch64 binary - run: cross build --target-dir=build --release --verbose --target=aarch64-unknown-linux-musl --all-features - - - name: Move binaries to build directory run: | - mv build/x86_64-unknown-linux-musl/release/linutil build/linutil - mv build/aarch64-unknown-linux-musl/release/linutil build/linutil-aarch64 - - - name: Pull latest changes - run: | - git config --global user.email "github-actions@github.com" - git config --global user.name "GitHub Actions" - git pull origin main - - - uses: stefanzweifel/git-auto-commit-action@v5 - with: - commit_message: Commit Linutil - file_pattern: "build/linutil build/linutil-aarch64" - add_options: '--force' - if: success() + cross build --target-dir=build --release --verbose --target=aarch64-unknown-linux-musl --all-features + mv ./build/aarch64-unknown-linux-musl/release/linutil ./build/aarch64-unknown-linux-musl/release/linutil-aarch64 - name: Extract Version id: extract_version @@ -75,15 +57,6 @@ jobs: echo "version=$version" >> $GITHUB_ENV shell: bash - - name: Generate Release Notes - id: generate_notes - uses: release-drafter/release-drafter@v6 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - config-name: release-drafter.yml - version: ${{ env.version }} - - name: Create and Upload Release id: create_release uses: softprops/action-gh-release@v2 @@ -91,15 +64,14 @@ jobs: tag_name: ${{ env.version }} name: Pre-Release ${{ env.version }} body: | - ${{ steps.generate_notes.outputs.body }} - ![GitHub Downloads (specific asset, specific tag)](https://img.shields.io/github/downloads/ChrisTitusTech/linutil/${{ env.version }}/linutil) ![GitHub Downloads (specific asset, specific tag)](https://img.shields.io/github/downloads/ChrisTitusTech/linutil/${{ env.version }}/linutil-aarch64) - append_body: false + append_body: true + generate_release_notes: true files: | - ./build/linutil - ./build/linutil-aarch64 + ./build/x86_64-unknown-linux-musl/release/linutil + ./build/aarch64-unknown-linux-musl/release/linutil-aarch64 ./start.sh ./startdev.sh prerelease: true diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml new file mode 100644 index 00000000..4967eeef --- /dev/null +++ b/.github/workflows/preview.yml @@ -0,0 +1,78 @@ +name: LinUtil Preview + +on: + workflow_dispatch: + inputs: + tag_name: + description: 'Tag name' + required: true + workflow_run: + workflows: ["LinUtil Release"] + types: + - completed + +jobs: + generate_preview: + runs-on: ubuntu-latest + environment: linutil_env + permissions: + contents: write + pull-requests: write + + steps: + - name: Checkout source + uses: actions/checkout@v4 + + - name: Get tag name ( Workflow Run ) + id: latest_tag + uses: actions/github-script@v7 + if: github.event_name == 'workflow_run' + with: + script: | + const releases = await github.rest.repos.listReleases({ + owner: context.repo.owner, + repo: context.repo.repo, + per_page: 1 + }); + core.setOutput('result', releases.data[0].tag_name); + result-encoding: string + + - name: Set tag name ( Workflow Run ) + if: github.event_name == 'workflow_run' + run: echo "tag_name=${{ steps.latest_tag.outputs.result }}" >> $GITHUB_ENV + + - name: Set tag name ( Workflow Dispatch ) + if: ${{ github.event_name }} == 'workflow_dispatch' + run: echo "tag_name=${{ github.event.inputs.tag_name }}" >> $GITHUB_ENV + + - name: Download binary + run: | + curl -LO "https://github.com/${{ github.repository }}/releases/download/${{ env.tag_name }}/linutil" + + - name: Set env + run: | + chmod +x linutil + mkdir -p build + mv linutil build/linutil + echo "${{ github.workspace }}/build" >> $GITHUB_PATH + + - name: Generate preview + uses: charmbracelet/vhs-action@v2.1.0 + with: + path: "docs/assets/preview.tape" + + - name: Move preview + run: mv preview.gif docs/assets/preview.gif + + - name: Create PR + uses: peter-evans/create-pull-request@v7.0.5 + with: + commit-message: Preview for ${{ env.tag_name }} + file-pattern: "docs/assets/preview.gif" + add-options: "--force" + token: ${{ secrets.PAT_TOKEN }} + branch: feature/preview-${{ env.tag_name }} + title: "Update preview for ${{ env.tag_name }}" + body: | + Automated PR to update preview gif for version ${{ env.tag_name }} + if: success() 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: diff --git a/.github/workflows/shellcheck.yml b/.github/workflows/shellcheck.yml index e91ad941..bfcc3bc8 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,20 +11,25 @@ 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 and set up shellcheck - run : | - wget https://github.com/koalaman/shellcheck/releases/download/v0.10.0/shellcheck-v0.10.0.linux.x86_64.tar.xz - tar -xf shellcheck-v0.10.0.linux.x86_64.tar.xz - cd shellcheck-v0.10.0 - chmod +x shellcheck + - name: Run ShellCheck + uses: reviewdog/action-shellcheck@v1 + with: + shellcheck_flags: '--source-path=${{ github.workspace }}/.shellcheckrc' + reviewdog_flags: '-fail-level=any' - - name: Run shellcheck - run: | - for file in $(git diff --name-only origin/${{ github.base_ref }} HEAD core/tabs); do - if [[ "$file" == *.sh ]] && [[ -f "$file" ]]; then - ./shellcheck-v0.10.0/shellcheck -S error "$file" - fi - done + shfmt: + name: Shell Fomatting + runs-on: ubuntu-latest + needs: shellcheck + steps: + - name: Checkout sources + uses: actions/checkout@v4 + + - name: Run shfmt + uses: reviewdog/action-shfmt@v1 + with: + shfmt_flags: '-i 4 -ci' + reviewdog_flags: '-fail-level=any' diff --git a/.github/workflows/typos.yml b/.github/workflows/typos.yml new file mode 100644 index 00000000..864dfc3b --- /dev/null +++ b/.github/workflows/typos.yml @@ -0,0 +1,15 @@ +name: Check for typos + +on: + [push, pull_request, workflow_dispatch] + +jobs: + check-typos: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - run: git fetch origin ${{ github.base_ref }} + + - name: Run spellcheck + uses: crate-ci/typos@v1.26.0 diff --git a/.github/workflows/xtask.yml b/.github/workflows/xtask.yml new file mode 100644 index 00000000..fab93937 --- /dev/null +++ b/.github/workflows/xtask.yml @@ -0,0 +1,58 @@ +name: XTasks + +on: + pull_request: + paths: + - "xtask" + - "Cargo.toml" + - "Cargo.lock" + - ".cargo" + - "core/tabs" + - "docs" + push: + paths: + - "xtask" + - "Cargo.toml" + - "Cargo.lock" + - ".cargo" + - "core/tabs" + - "docs" + +env: + CARGO_TERM_COLOR: always + +jobs: + docgen: + name: DocGen + runs-on: ubuntu-latest + + steps: + - name: Checkout sources + uses: actions/checkout@v4 + + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + + - name: Cache Cargo registry + uses: actions/cache@v4 + with: + path: ~/.cargo/registry + key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} + restore-keys: ${{ runner.os }}-cargo-registry- + + - name: Cache Cargo index + uses: actions/cache@v4 + with: + path: ~/.cargo/git + key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} + restore-keys: ${{ runner.os }}-cargo-index- + + - name: Run cargo xtask docgen + run: cargo xtask docgen + + - name: Check uncommitted documentation changes + run: | + git diff + git diff-files --quiet \ + || (echo "Run 'cargo xtask docgen' and push the changes" \ + && exit 1) diff --git a/.shellcheckrc b/.shellcheckrc new file mode 100644 index 00000000..0b882066 --- /dev/null +++ b/.shellcheckrc @@ -0,0 +1,2 @@ +external-sources=true +source=core/tabs/common-script.sh \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index a92903b9..fc49af4c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -29,26 +29,11 @@ version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" -[[package]] -name = "android-tzdata" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" - -[[package]] -name = "android_system_properties" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" -dependencies = [ - "libc", -] - [[package]] name = "ansi-to-tui" -version = "6.0.0" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00c4af0bef1b514c9b6a32a773caf604c1390fa7913f4eaa23bfe76f251d6a42" +checksum = "67555e1f1ece39d737e28c8a017721287753af3f93225e4a445b29ccb0f5912c" dependencies = [ "nom", "ratatui", @@ -136,12 +121,6 @@ version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" -[[package]] -name = "bumpalo" -version = "3.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" - [[package]] name = "byteorder" version = "1.5.0" @@ -165,9 +144,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.18" +version = "1.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b62ac837cdb5cb22e10a256099b4fc502b1dfe560cb282963a974d7abd80e476" +checksum = "2e80e3b6a3ab07840e1cae9b0666a63970dc28e8ed5ffbcdacbfc760c281bfc1" dependencies = [ "shlex", ] @@ -178,25 +157,11 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "chrono" -version = "0.4.38" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" -dependencies = [ - "android-tzdata", - "iana-time-zone", - "js-sys", - "num-traits", - "wasm-bindgen", - "windows-targets", -] - [[package]] name = "clap" -version = "4.5.17" +version = "4.5.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e5a21b8495e732f1b3c364c9949b201ca7bae518c502c80256c96ad79eaf6ac" +checksum = "b97f376d85a664d5837dbae44bf546e6477a679ff6610010f17276f686d867e8" dependencies = [ "clap_builder", "clap_derive", @@ -204,9 +169,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.17" +version = "4.5.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cf2dd12af7a047ad9d6da2b6b249759a22a7abc0f474c1dae1777afa4b21a73" +checksum = "19bc80abd44e4bed93ca373a0704ccbd1b710dc5749406201bb018272808dc54" dependencies = [ "anstream", "anstyle", @@ -216,9 +181,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.13" +version = "4.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "501d359d5f3dcaf6ecdeee48833ae73ec6e42723a1e52419c79abf9507eec0a0" +checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" dependencies = [ "heck", "proc-macro2", @@ -252,12 +217,6 @@ dependencies = [ "static_assertions", ] -[[package]] -name = "core-foundation-sys" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" - [[package]] name = "crossterm" version = "0.28.1" @@ -328,12 +287,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "fuchsia-cprng" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" - [[package]] name = "getrandom" version = "0.2.15" @@ -376,29 +329,6 @@ dependencies = [ "windows-sys", ] -[[package]] -name = "iana-time-zone" -version = "0.1.60" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" -dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "wasm-bindgen", - "windows-core", -] - -[[package]] -name = "iana-time-zone-haiku" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" -dependencies = [ - "cc", -] - [[package]] name = "include_dir" version = "0.7.4" @@ -428,6 +358,12 @@ dependencies = [ "hashbrown", ] +[[package]] +name = "indoc" +version = "2.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b248f5224d1d606005e02c97f5aa4e88eeb230488bcc03bc9ca4d7991399f2b5" + [[package]] name = "instability" version = "0.3.2" @@ -468,15 +404,6 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" -[[package]] -name = "js-sys" -version = "0.3.70" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" -dependencies = [ - "wasm-bindgen", -] - [[package]] name = "lazy_static" version = "1.5.0" @@ -491,35 +418,35 @@ checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" [[package]] name = "linutil_core" -version = "24.9.23" +version = "24.9.28" dependencies = [ "ego-tree", "include_dir", "serde", - "tempdir", + "temp-dir", "toml", "which", ] [[package]] name = "linutil_tui" -version = "24.9.23" +version = "24.9.28" dependencies = [ "ansi-to-tui", "anstyle", - "chrono", "clap", "crossterm", "ego-tree", "linutil_core", "oneshot", "portable-pty", - "rand 0.8.5", + "rand", "ratatui", + "temp-dir", "tree-sitter-bash", "tree-sitter-highlight", "tui-term", - "unicode-width", + "unicode-width 0.2.0", "zips", ] @@ -612,15 +539,6 @@ dependencies = [ "minimal-lexical", ] -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", -] - [[package]] name = "once_cell" version = "1.19.0" @@ -716,19 +634,6 @@ dependencies = [ "proc-macro2", ] -[[package]] -name = "rand" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293" -dependencies = [ - "fuchsia-cprng", - "libc", - "rand_core 0.3.1", - "rdrand", - "winapi", -] - [[package]] name = "rand" version = "0.8.5" @@ -737,7 +642,7 @@ checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", "rand_chacha", - "rand_core 0.6.4", + "rand_core", ] [[package]] @@ -747,24 +652,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core 0.6.4", + "rand_core", ] -[[package]] -name = "rand_core" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" -dependencies = [ - "rand_core 0.4.2", -] - -[[package]] -name = "rand_core" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" - [[package]] name = "rand_core" version = "0.6.4" @@ -776,32 +666,23 @@ dependencies = [ [[package]] name = "ratatui" -version = "0.28.1" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdef7f9be5c0122f890d58bdf4d964349ba6a6161f705907526d891efabba57d" +checksum = "eabd94c2f37801c20583fc49dd5cd6b0ba68c716787c2dd6ed18571e1e63117b" dependencies = [ "bitflags 2.6.0", "cassowary", "compact_str", "crossterm", + "indoc", "instability", "itertools", "lru", "paste", "strum", - "strum_macros", "unicode-segmentation", "unicode-truncate", - "unicode-width", -] - -[[package]] -name = "rdrand" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" -dependencies = [ - "rand_core 0.3.1", + "unicode-width 0.2.0", ] [[package]] @@ -842,15 +723,6 @@ version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" -[[package]] -name = "remove_dir_all" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" -dependencies = [ - "winapi", -] - [[package]] name = "rustix" version = "0.38.37" @@ -1023,6 +895,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" +[[package]] +name = "streaming-iterator" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b2231b7c3057d5e4ad0156fb3dc807d900806020c5ffa3ee6ff2c8c76fb8520" + [[package]] name = "strsim" version = "0.11.1" @@ -1063,14 +941,10 @@ dependencies = [ ] [[package]] -name = "tempdir" -version = "0.3.7" +name = "temp-dir" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15f2b5fb00ccdf689e0149d1b1b3c03fead81c2b37735d812fa8bddbbf41b6d8" -dependencies = [ - "rand 0.4.6", - "remove_dir_all", -] +checksum = "bc1ee6eef34f12f765cb94725905c6312b6610ab2b0940889cfe58dae7bc3c72" [[package]] name = "termios" @@ -1083,18 +957,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.63" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" +checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.63" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" +checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" dependencies = [ "proc-macro2", "quote", @@ -1137,13 +1011,14 @@ dependencies = [ [[package]] name = "tree-sitter" -version = "0.23.0" +version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20f4cd3642c47a85052a887d86704f4eac272969f61b686bdd3f772122aabaff" +checksum = "f9871f16d6cf5c4757dcf30d5d2172a2df6987c510c017bbb7abfb7f9aa24d06" dependencies = [ "cc", "regex", "regex-syntax", + "streaming-iterator", "tree-sitter-language", ] @@ -1159,12 +1034,13 @@ dependencies = [ [[package]] name = "tree-sitter-highlight" -version = "0.23.0" +version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "395d7a477a4504fd7d5e4d003e0dd41bd5b9c4985d53592a943a8354ec452dae" +checksum = "48859aa39513716018d81904220960f415dbb72e071234a721304d20bf245e4c" dependencies = [ "lazy_static", "regex", + "streaming-iterator", "thiserror", "tree-sitter", ] @@ -1177,9 +1053,9 @@ checksum = "2545046bd1473dac6c626659cc2567c6c0ff302fc8b84a56c4243378276f7f57" [[package]] name = "tui-term" -version = "0.1.13" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d07f0233f0d4795d2dc6663cfc3ce56b87bebcee66d6bcc088aa6aff5c072361" +checksum = "72af159125ce32b02ceaced6cffae6394b0e6b6dfd4dc164a6c59a2db9b3c0b0" dependencies = [ "ratatui", "vt100", @@ -1205,14 +1081,20 @@ checksum = "b3644627a5af5fa321c95b9b235a72fd24cd29c648c2c379431e6628655627bf" dependencies = [ "itertools", "unicode-segmentation", - "unicode-width", + "unicode-width 0.1.14", ] [[package]] name = "unicode-width" -version = "0.1.13" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" +checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" + +[[package]] +name = "unicode-width" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd" [[package]] name = "utf8parse" @@ -1229,12 +1111,11 @@ checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "vt100" version = "0.15.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84cd863bf0db7e392ba3bd04994be3473491b31e66340672af5d11943c6274de" +source = "git+https://github.com/ChrisTitusTech/vt100-rust#e41fb3d8fb5fd01dd2d076c9a25823a31656012f" dependencies = [ "itoa", "log", - "unicode-width", + "unicode-width 0.1.14", "vte", ] @@ -1265,61 +1146,6 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" -[[package]] -name = "wasm-bindgen" -version = "0.2.93" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" -dependencies = [ - "cfg-if", - "once_cell", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.93" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" -dependencies = [ - "bumpalo", - "log", - "once_cell", - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.93" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.93" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.93" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" - [[package]] name = "which" version = "6.0.3" @@ -1354,15 +1180,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -[[package]] -name = "windows-core" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" -dependencies = [ - "windows-targets", -] - [[package]] name = "windows-sys" version = "0.52.0" @@ -1460,6 +1277,13 @@ version = "0.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d135d17ab770252ad95e9a872d365cf3090e3be864a34ab46f48555993efc904" +[[package]] +name = "xtask" +version = "24.9.28" +dependencies = [ + "linutil_core", +] + [[package]] name = "zerocopy" version = "0.7.35" diff --git a/Cargo.toml b/Cargo.toml index 7d33d10b..ef31b2a9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,14 +1,19 @@ [workspace.package] license = "MIT" -version = "24.9.23" +version = "24.9.28" +edition = "2021" [workspace.dependencies] ego-tree = "0.6.2" [workspace] -members = ["tui", "core"] +members = ["tui", "core", "xtask"] +default-members = ["tui", "core"] resolver = "2" +[patch.crates-io] +vt100 = { git = "https://github.com/ChrisTitusTech/vt100-rust" } + [profile.release] opt-level = "z" debug = false diff --git a/README.md b/README.md index b2f33406..f8aa0ea3 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ [![Crates.io Version](https://img.shields.io/crates/v/linutil_tui?style=for-the-badge&color=%23af3a03)](https://crates.io/crates/linutil_tui) [![linutil AUR Version](https://img.shields.io/aur/version/linutil?style=for-the-badge&label=%5BAUR%5D%20linutil&color=%23230567ff)](https://aur.archlinux.org/packages/linutil) [![linutil-bin AUR Version](https://img.shields.io/aur/version/linutil-bin?style=for-the-badge&label=%5BAUR%5D%20linutil-bin&color=%23230567ff)](https://aur.archlinux.org/packages/linutil-bin) -![Preview](docs/assets/preview.png) +![Preview](docs/assets/preview.gif) **Linutil** is a distro-agnostic toolbox designed to simplify everyday Linux tasks. It helps you set up applications and optimize your system for specific use cases. The utility is actively developed in Rust 🦀, providing performance and reliability. @@ -49,7 +49,7 @@ makepkg -si Replace `` with your preferred package. -If you use [yay](https://github.com/Jguer/yay), [paru](https://github.com/Morganamilo/paru) or any other [AUR Helper](https://wiki.archlinux.org/title/AUR_helpers), it's even simplier: +If you use [yay](https://github.com/Jguer/yay), [paru](https://github.com/Morganamilo/paru) or any other [AUR Helper](https://wiki.archlinux.org/title/AUR_helpers), it's even simpler: ```bash paru -S linutil diff --git a/_typos.toml b/_typos.toml new file mode 100644 index 00000000..38770ffe --- /dev/null +++ b/_typos.toml @@ -0,0 +1,7 @@ +[files] +extend-exclude = ["tui/cool_tips.txt"] + +[default] +extend-ignore-identifiers-re = [ + "ratatui", +] diff --git a/cargo-lock-merge.txt b/cargo-lock-merge.txt deleted file mode 100644 index 649a99cf..00000000 --- a/cargo-lock-merge.txt +++ /dev/null @@ -1,5 +0,0 @@ -What to do when you have a Cargo.lock merge conflict? -1. `git checkout origin/main -- Cargo.lock` to get the original Cargo.lock -2. `cargo build` to update Cargo.lock -3. `git add Cargo.lock` -4. continue the merge as normal \ No newline at end of file diff --git a/core/Cargo.toml b/core/Cargo.toml index 8605c94c..d3f42011 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -13,7 +13,7 @@ include = [ [dependencies] include_dir = "0.7.4" -tempdir = "0.3.7" +temp-dir = "0.1.14" serde = { version = "1.0.205", features = ["derive"], default-features = false } toml = { version = "0.8.19", features = ["parse"], default-features = false } which = "6.0.3" diff --git a/core/src/inner.rs b/core/src/inner.rs index 2e34954e..ed810b06 100644 --- a/core/src/inner.rs +++ b/core/src/inner.rs @@ -1,61 +1,56 @@ -use crate::{Command, ListNode, Tab}; -use ego_tree::{NodeMut, Tree}; -use include_dir::{include_dir, Dir}; -use serde::Deserialize; use std::{ fs::File, io::{BufRead, BufReader, Read}, os::unix::fs::PermissionsExt, path::{Path, PathBuf}, + rc::Rc, }; -use tempdir::TempDir; + +use crate::{Command, ListNode, Tab}; +use ego_tree::{NodeMut, Tree}; +use include_dir::{include_dir, Dir}; +use serde::Deserialize; +use temp_dir::TempDir; const TAB_DATA: Dir = include_dir!("$CARGO_MANIFEST_DIR/tabs"); -pub fn get_tabs(validate: bool) -> Vec { - let tab_files = TabList::get_tabs(); - let tabs = tab_files.into_iter().map(|path| { - let directory = path.parent().unwrap().to_owned(); - let data = std::fs::read_to_string(path).expect("Failed to read tab data"); - let mut tab_data: TabEntry = toml::from_str(&data).expect("Failed to parse tab data"); +pub fn get_tabs(validate: bool) -> (TempDir, Vec) { + let (temp_dir, tab_files) = TabList::get_tabs(); - if validate { - filter_entries(&mut tab_data.data); - } - (tab_data, directory) - }); + let tabs: Vec<_> = tab_files + .into_iter() + .map(|path| { + let directory = path.parent().unwrap().to_owned(); + let data = std::fs::read_to_string(path).expect("Failed to read tab data"); + let mut tab_data: TabEntry = toml::from_str(&data).expect("Failed to parse tab data"); + + if validate { + filter_entries(&mut tab_data.data); + } + (tab_data, directory) + }) + .collect(); let tabs: Vec = tabs - .map( - |( - TabEntry { - name, - data, - multi_selectable, - }, - directory, - )| { - let mut tree = Tree::new(ListNode { - name: "root".to_string(), - description: String::new(), - command: Command::None, - task_list: String::new(), - }); - let mut root = tree.root_mut(); - create_directory(data, &mut root, &directory, validate); - Tab { - name, - tree, - multi_selectable, - } - }, - ) + .into_iter() + .map(|(TabEntry { name, data }, directory)| { + let mut tree = Tree::new(Rc::new(ListNode { + name: "root".to_string(), + description: String::new(), + command: Command::None, + task_list: String::new(), + multi_select: false, + })); + let mut root = tree.root_mut(); + create_directory(data, &mut root, &directory, validate, true); + Tab { name, tree } + }) .collect(); if tabs.is_empty() { panic!("No tabs found"); } - tabs + (temp_dir, tabs) } #[derive(Deserialize)] @@ -67,12 +62,6 @@ struct TabList { struct TabEntry { name: String, data: Vec, - #[serde(default = "default_multi_selectable")] - multi_selectable: bool, -} - -fn default_multi_selectable() -> bool { - true } #[derive(Deserialize)] @@ -87,6 +76,12 @@ struct Entry { entry_type: EntryType, #[serde(default)] task_list: String, + #[serde(default = "default_true")] + multi_select: bool, +} + +fn default_true() -> bool { + true } #[derive(Deserialize)] @@ -164,28 +159,33 @@ fn filter_entries(entries: &mut Vec) { fn create_directory( data: Vec, - node: &mut NodeMut, + node: &mut NodeMut>, command_dir: &Path, validate: bool, + parent_multi_select: bool, ) { for entry in data { + let multi_select = parent_multi_select && entry.multi_select; + match entry.entry_type { EntryType::Entries(entries) => { - let mut node = node.append(ListNode { + let mut node = node.append(Rc::new(ListNode { name: entry.name, description: entry.description, command: Command::None, task_list: String::new(), - }); - create_directory(entries, &mut node, command_dir, validate); + multi_select, + })); + create_directory(entries, &mut node, command_dir, validate, multi_select); } EntryType::Command(command) => { - node.append(ListNode { + node.append(Rc::new(ListNode { name: entry.name, description: entry.description, command: Command::Raw(command), task_list: String::new(), - }); + multi_select, + })); } EntryType::Script(script) => { let script = command_dir.join(script); @@ -194,7 +194,7 @@ fn create_directory( } if let Some((executable, args)) = get_shebang(&script, validate) { - node.append(ListNode { + node.append(Rc::new(ListNode { name: entry.name, description: entry.description, command: Command::LocalFile { @@ -203,7 +203,8 @@ fn create_directory( file: script, }, task_list: entry.task_list, - }); + multi_select, + })); } } } @@ -246,19 +247,20 @@ fn is_executable(path: &Path) -> bool { } impl TabList { - fn get_tabs() -> Vec { - let temp_dir = TempDir::new("linutil_scripts").unwrap().into_path(); + fn get_tabs() -> (TempDir, Vec) { + let temp_dir = TempDir::new().unwrap(); TAB_DATA .extract(&temp_dir) .expect("Failed to extract the saved directory"); - let tab_files = - std::fs::read_to_string(temp_dir.join("tabs.toml")).expect("Failed to read tabs.toml"); + let tab_files = std::fs::read_to_string(temp_dir.path().join("tabs.toml")) + .expect("Failed to read tabs.toml"); let data: Self = toml::from_str(&tab_files).expect("Failed to parse tabs.toml"); - - data.directories + let tab_paths = data + .directories .iter() - .map(|path| temp_dir.join(path).join("tab_data.toml")) - .collect() + .map(|path| temp_dir.path().join(path).join("tab_data.toml")) + .collect(); + (temp_dir, tab_paths) } } diff --git a/core/src/lib.rs b/core/src/lib.rs index 22ef602b..4e795dd3 100644 --- a/core/src/lib.rs +++ b/core/src/lib.rs @@ -1,5 +1,7 @@ mod inner; +use std::rc::Rc; + use ego_tree::Tree; use std::path::PathBuf; @@ -20,8 +22,7 @@ pub enum Command { #[derive(Clone, Hash, Eq, PartialEq)] pub struct Tab { pub name: String, - pub tree: Tree, - pub multi_selectable: bool, + pub tree: Tree>, } #[derive(Clone, Hash, Eq, PartialEq)] @@ -30,4 +31,5 @@ pub struct ListNode { pub description: String, pub command: Command, pub task_list: String, + pub multi_select: bool, } diff --git a/core/tabs/applications-setup/Developer-tools/jetbrains-toolbox.sh b/core/tabs/applications-setup/Developer-tools/jetbrains-toolbox.sh new file mode 100644 index 00000000..79ce360e --- /dev/null +++ b/core/tabs/applications-setup/Developer-tools/jetbrains-toolbox.sh @@ -0,0 +1,48 @@ +#!/bin/sh -e + +. ../../common-script.sh + +manualInstall() { + JETBRAINS_TOOLBOX_DIR="/opt/jetbrains-toolbox" + + case "$ARCH" in + x86_64) ARCHIVE_URL=$(curl -s "https://data.services.jetbrains.com/products/releases?code=TBA&latest=true&type=release" | jq -r ".TBA[0].downloads.linux.link") ;; + aarch64) ARCHIVE_URL=$(curl -s "https://data.services.jetbrains.com/products/releases?code=TBA&latest=true&type=release" | jq -r ".TBA[0].downloads.linuxARM64.link") ;; + esac + + curl -fSL "$ARCHIVE_URL" -o "jetbrains-toolbox.tar.gz" + + if [ -d "$JETBRAINS_TOOLBOX_DIR" ]; then + "$ESCALATION_TOOL" rm -rf "$JETBRAINS_TOOLBOX_DIR" + fi + + "$ESCALATION_TOOL" mkdir -p "$JETBRAINS_TOOLBOX_DIR" + "$ESCALATION_TOOL" tar -xzf "jetbrains-toolbox.tar.gz" -C "$JETBRAINS_TOOLBOX_DIR" --strip-components=1 + "$ESCALATION_TOOL" ln -sf "$JETBRAINS_TOOLBOX_DIR/jetbrains-toolbox" "/usr/bin/jetbrains-toolbox" +} + +installJetBrainsToolBox() { + if ! command_exists jetbrains-toolbox; then + printf "%b\n" "${YELLOW}Installing Jetbrains Toolbox...${RC}" + case "$PACKAGER" in + pacman) + "$AUR_HELPER" -S --needed --noconfirm jetbrains-toolbox + ;; + dnf) + manualInstall + ;; + *) + "$ESCALATION_TOOL" "$PACKAGER" install -y libfuse2 + manualInstall + ;; + esac + printf "%b\n" "${GREEN}Successfully installed Jetbrains Toolbox.${RC}" + else + printf "%b\n" "${GREEN}Jetbrains toolbox is already installed.${RC}" + fi +} + +checkEnv +checkEscalationTool +checkAURHelper +installJetBrainsToolBox diff --git a/core/tabs/applications-setup/Developer-tools/meld-setup.sh b/core/tabs/applications-setup/Developer-tools/meld-setup.sh index 8881ba1f..031a09ae 100644 --- a/core/tabs/applications-setup/Developer-tools/meld-setup.sh +++ b/core/tabs/applications-setup/Developer-tools/meld-setup.sh @@ -3,10 +3,25 @@ . ../../common-script.sh installMeld() { - cd "$HOME" && git clone https://gitlab.gnome.org/GNOME/meld.git - echo "PATH=\$PATH:$HOME/meld/bin" | "$ESCALATION_TOOL" tee -a /etc/environment + if ! command_exists org.gnome.meld && ! command_exists meld; then + printf "%b\n" "${YELLOW}Installing Meld...${RC}" + case "$PACKAGER" in + pacman) + "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm meld + ;; + apt-get|nala) + "$ESCALATION_TOOL" "$PACKAGER" -y install meld + ;; + *) + checkFlatpak + flatpak install -y flathub org.gnome.meld + ;; + esac + else + printf "%b\n" "${GREEN}Meld is already installed.${RC}" + fi } checkEnv checkEscalationTool -installMeld +installMeld \ No newline at end of file diff --git a/core/tabs/applications-setup/Developer-tools/neovim-setup.sh b/core/tabs/applications-setup/Developer-tools/neovim-setup.sh index 04cfdb9e..ac0d2637 100755 --- a/core/tabs/applications-setup/Developer-tools/neovim-setup.sh +++ b/core/tabs/applications-setup/Developer-tools/neovim-setup.sh @@ -4,15 +4,6 @@ gitpath="$HOME/.local/share/neovim" -checkNeovimVer() { - # lazy.nvim requires nvim >= 0.8.0 - nvim_version=$(nvim --version | head -n 1 | awk '{print $2}') - if [ "$(printf "%s\n" "$nvim_version" "0.8.0" | sort -V | head -n 1)" != "0.8.0" ]; then - printf "%b\n" "${RED}Neovim version $nvim_version not supported.${RC}" - exit 1 - fi -} - cloneNeovim() { # Check if the dir exists before attempting to clone into it. if [ -d "$gitpath" ]; then @@ -30,7 +21,10 @@ installNeovim() { "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm neovim ripgrep fzf python-virtualenv luarocks go shellcheck git ;; apt-get|nala) - "$ESCALATION_TOOL" "$PACKAGER" install -y neovim ripgrep fd-find python3-venv luarocks golang-go shellcheck git + "$ESCALATION_TOOL" "$PACKAGER" install -y ripgrep fd-find python3-venv luarocks golang-go shellcheck git + curl -sSLo /tmp/nvim.appimage https://github.com/neovim/neovim/releases/latest/download/nvim.appimage + chmod u+x /tmp/nvim.appimage + "$ESCALATION_TOOL" mv /tmp/nvim.appimage /usr/local/bin/nvim ;; dnf|zypper) "$ESCALATION_TOOL" "$PACKAGER" install -y neovim ripgrep fzf python3-virtualenv luarocks golang ShellCheck git @@ -60,7 +54,6 @@ linkNeovimConfig() { checkEnv checkEscalationTool installNeovim -checkNeovimVer cloneNeovim backupNeovimConfig linkNeovimConfig diff --git a/core/tabs/applications-setup/Developer-tools/sublime-setup.sh b/core/tabs/applications-setup/Developer-tools/sublime-setup.sh index 0bbe87b7..16c03497 100644 --- a/core/tabs/applications-setup/Developer-tools/sublime-setup.sh +++ b/core/tabs/applications-setup/Developer-tools/sublime-setup.sh @@ -3,37 +3,37 @@ . ../../common-script.sh installSublime() { - if ! command_exists sublime; then - printf "%b\n" "${YELLOW}Installing Sublime...${RC}" - case "$PACKAGER" in - apt-get|nala) - curl -fsSL https://download.sublimetext.com/sublimehq-pub.gpg | "$ESCALATION_TOOL" apt-key add - - echo "deb https://download.sublimetext.com/ apt/stable/" | "$ESCALATION_TOOL" tee /etc/apt/sources.list.d/sublime-text.list - "$ESCALATION_TOOL" "$PACKAGER" update - "$ESCALATION_TOOL" "$PACKAGER" install -y sublime-text - ;; - zypper) - "$ESCALATION_TOOL" rpm -v --import https://download.sublimetext.com/sublimehq-rpm-pub.gpg - "$ESCALATION_TOOL" "$PACKAGER" addrepo -g -f https://download.sublimetext.com/rpm/dev/x86_64/sublime-text.repo - "$ESCALATION_TOOL" "$PACKAGER" refresh - "$ESCALATION_TOOL" "$PACKAGER" --non-interactive install sublime-text - ;; - pacman) - "$AUR_HELPER" -S --needed --noconfirm sublime-text-4 - ;; - dnf) - "$ESCALATION_TOOL" rpm -v --import https://download.sublimetext.com/sublimehq-rpm-pub.gpg - "$ESCALATION_TOOL" "$PACKAGER" config-manager --add-repo https://download.sublimetext.com/rpm/stable/x86_64/sublime-text.repo - "$ESCALATION_TOOL" "$PACKAGER" install -y sublime-text - ;; - *) - printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" - exit 1 - ;; - esac - else - printf "%b\n" "${GREEN}Sublime is already installed.${RC}" - fi + if ! command_exists sublime; then + printf "%b\n" "${YELLOW}Installing Sublime...${RC}" + case "$PACKAGER" in + apt-get|nala) + curl -fsSL https://download.sublimetext.com/sublimehq-pub.gpg | "$ESCALATION_TOOL" apt-key add - + echo "deb https://download.sublimetext.com/ apt/stable/" | "$ESCALATION_TOOL" tee /etc/apt/sources.list.d/sublime-text.list + "$ESCALATION_TOOL" "$PACKAGER" update + "$ESCALATION_TOOL" "$PACKAGER" install -y sublime-text + ;; + zypper) + "$ESCALATION_TOOL" rpm -v --import https://download.sublimetext.com/sublimehq-rpm-pub.gpg + "$ESCALATION_TOOL" "$PACKAGER" addrepo -g -f https://download.sublimetext.com/rpm/dev/x86_64/sublime-text.repo + "$ESCALATION_TOOL" "$PACKAGER" refresh + "$ESCALATION_TOOL" "$PACKAGER" --non-interactive install sublime-text + ;; + pacman) + "$AUR_HELPER" -S --needed --noconfirm sublime-text-4 + ;; + dnf) + "$ESCALATION_TOOL" rpm -v --import https://download.sublimetext.com/sublimehq-rpm-pub.gpg + "$ESCALATION_TOOL" "$PACKAGER" config-manager --add-repo https://download.sublimetext.com/rpm/stable/x86_64/sublime-text.repo + "$ESCALATION_TOOL" "$PACKAGER" install -y sublime-text + ;; + *) + printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" + exit 1 + ;; + esac + else + printf "%b\n" "${GREEN}Sublime is already installed.${RC}" + fi } diff --git a/core/tabs/applications-setup/Developer-tools/vscodium-setup.sh b/core/tabs/applications-setup/Developer-tools/vscodium-setup.sh index 6e3ef18d..5b5615ca 100644 --- a/core/tabs/applications-setup/Developer-tools/vscodium-setup.sh +++ b/core/tabs/applications-setup/Developer-tools/vscodium-setup.sh @@ -17,7 +17,6 @@ installVsCodium() { printf "%b\n" "[gitlab.com_paulcarroty_vscodium_repo]\nname=gitlab.com_paulcarroty_vscodium_repo\nbaseurl=https://download.vscodium.com/rpms/\nenabled=1\ngpgcheck=1\nrepo_gpgcheck=1\ngpgkey=https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/-/raw/master/pub.gpg\nmetadata_expire=1h" | "$ESCALATION_TOOL" tee -a /etc/zypp/repos.d/vscodium.repo "$ESCALATION_TOOL" "$PACKAGER" refresh "$ESCALATION_TOOL" "$PACKAGER" --non-interactive install codium - ;; pacman) "$AUR_HELPER" -S --noconfirm vscodium-bin diff --git a/core/tabs/applications-setup/bottles-setup.sh b/core/tabs/applications-setup/bottles-setup.sh index 02fef60b..0b29bedb 100755 --- a/core/tabs/applications-setup/bottles-setup.sh +++ b/core/tabs/applications-setup/bottles-setup.sh @@ -3,14 +3,9 @@ . ../common-script.sh installBottles() { - if ! command_exists flatpak; then - printf "%b\n" "${YELLOW}Installing Bottles...${RC}" - case "$PACKAGER" in - *) - . ./setup-flatpak.sh - flatpak install -y flathub com.usebottles.bottles - ;; - esac + if ! command_exists com.usebottles.bottles; then + printf "%b\n" "${YELLOW}Installing Bottles...${RC}" + flatpak install -y flathub com.usebottles.bottles else printf "%b\n" "${GREEN}Bottles is already installed.${RC}" fi @@ -18,4 +13,5 @@ installBottles() { checkEnv checkEscalationTool +checkFlatpak installBottles \ No newline at end of file diff --git a/core/tabs/applications-setup/browser-setup.sh b/core/tabs/applications-setup/browser-setup.sh deleted file mode 100755 index dcd58c0a..00000000 --- a/core/tabs/applications-setup/browser-setup.sh +++ /dev/null @@ -1,246 +0,0 @@ -#!/bin/sh -e - -. ../common-script.sh - -install_chrome() { - if ! command_exists google-chrome; then - printf "%b\n" "${YELLOW}Installing Google Chrome..${RC}." - case "$PACKAGER" in - apt-get|nala) - curl -O https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb - "$ESCALATION_TOOL" "$PACKAGER" install -y ./google-chrome-stable_current_amd64.deb - ;; - zypper) - "$ESCALATION_TOOL" "$PACKAGER" addrepo http://dl.google.com/linux/chrome/rpm/stable/x86_64 Google-Chrome - "$ESCALATION_TOOL" "$PACKAGER" refresh - "$ESCALATION_TOOL" "$PACKAGER" --non-interactive install google-chrome-stable - ;; - pacman) - "$AUR_HELPER" -S --noconfirm google-chrome - ;; - dnf) - "$ESCALATION_TOOL" "$PACKAGER" install -y fedora-workstation-repositories - "$ESCALATION_TOOL" "$PACKAGER" config-manager --set-enabled google-chrome - "$ESCALATION_TOOL" "$PACKAGER" install -y google-chrome-stable - ;; - *) - printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" - ;; - esac - else - printf "%b\n" "${GREEN}Google Chrome Browser is already installed.${RC}" - fi -} - -install_thorium() { - if ! command_exists thorium-browser; then - printf "%b\n" "${YELLOW}Installing Thorium Browser...${RC}" - case "$PACKAGER" in - apt-get|nala) - "$ESCALATION_TOOL" rm -fv /etc/apt/sources.list.d/thorium.list - "$ESCALATION_TOOL" curl http://dl.thorium.rocks/debian/dists/stable/thorium.list -o /etc/apt/sources.list.d/thorium.list - "$ESCALATION_TOOL" "$PACKAGER" update - "$ESCALATION_TOOL" "$PACKAGER" install -y thorium-browser - ;; - zypper|dnf) - url=$(curl -s https://api.github.com/repos/Alex313031/Thorium/releases/latest | grep -oP '(?<=browser_download_url": ")[^"]*\.rpm') - echo "$url" && curl -L "$url" -o thorium-latest.rpm - "$ESCALATION_TOOL" "$PACKAGER" install -y thorium-latest.rpm && rm thorium-latest.rpm - ;; - pacman) - "$AUR_HELPER" -S --needed --noconfirm thorium-browser-bin - ;; - *) - printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" - ;; - esac - else - printf "%b\n" "${GREEN}Thorium Browser is already installed.${RC}" - fi -} - -install_firefox() { - if ! command_exists firefox; then - printf "%b\n" "${YELLOW}Installing Mozilla Firefox...${RC}" - case "$PACKAGER" in - apt-get|nala) - "$ESCALATION_TOOL" "$PACKAGER" install -y firefox-esr - ;; - zypper) - "$ESCALATION_TOOL" "$PACKAGER" --non-interactive install MozillaFirefox - ;; - pacman) - "$ESCALATION_TOOL" "$PACKAGER" -S --noconfirm firefox - ;; - dnf) - "$ESCALATION_TOOL" "$PACKAGER" install -y firefox - ;; - *) - printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" - exit 1 - ;; - esac - else - printf "%b\n" "${GREEN}Firefox Browser is already installed.${RC}" - fi -} - -install_librewolf() { - if ! command_exists librewolf; then - printf "%b\n" "${YELLOW}Installing Librewolf...${RC}" - case "$PACKAGER" in - apt-get|nala) - "$ESCALATION_TOOL" "$PACKAGER" install -y gnupg lsb-release apt-transport-https ca-certificates - distro=`if echo " una bookworm vanessa focal jammy bullseye vera uma " | grep -q " $(lsb_release -sc) "; then lsb_release -sc; else echo focal; fi` - curl -fsSL https://deb.librewolf.net/keyring.gpg | "$ESCALATION_TOOL" gpg --dearmor -o /usr/share/keyrings/librewolf.gpg - echo "Types: deb -URIs: https://deb.librewolf.net -Suites: $distro -Components: main -Architectures: amd64 -Signed-By: /usr/share/keyrings/librewolf.gpg" | "$ESCALATION_TOOL" tee /etc/apt/sources.list.d/librewolf.sources > /dev/null - "$ESCALATION_TOOL" "$PACKAGER" update - "$ESCALATION_TOOL" "$PACKAGER" install -y librewolf - ;; - dnf) - curl -fsSL https://rpm.librewolf.net/librewolf-repo.repo | pkexec tee /etc/yum.repos.d/librewolf.repo > /dev/null - "$ESCALATION_TOOL" "$PACKAGER" install -y librewolf - ;; - zypper) - "$ESCALATION_TOOL" rpm --import https://rpm.librewolf.net/pubkey.gpg - "$ESCALATION_TOOL" zypper ar -ef https://rpm.librewolf.net librewolf - "$ESCALATION_TOOL" zypper refresh - "$ESCALATION_TOOL" zypper --non-interactive install librewolf - ;; - pacman) - "$AUR_HELPER" -S --needed --noconfirm librewolf-bin - ;; - *) - printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" - exit 1 - ;; - esac - else - printf "%b\n" "${GREEN}LibreWolf Browser is already installed.${RC}" - fi -} - -install_brave() { - if ! command_exists brave; then - printf "%b\n" "${YELLOW}Installing Brave...${RC}" - case "$PACKAGER" in - apt-get|nala) - "$ESCALATION_TOOL" "$PACKAGER" install -y curl - "$ESCALATION_TOOL" curl -fsSLo /usr/share/keyrings/brave-browser-archive-keyring.gpg https://brave-browser-apt-release.s3.brave.com/brave-browser-archive-keyring.gpg - echo "deb [signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg] https://brave-browser-apt-release.s3.brave.com/ stable main"| "$ESCALATION_TOOL" tee /etc/apt/sources.list.d/brave-browser-release.list - "$ESCALATION_TOOL" "$PACKAGER" update - "$ESCALATION_TOOL" "$PACKAGER" install -y brave-browser - ;; - zypper) - "$ESCALATION_TOOL" "$PACKAGER" install -y curl - "$ESCALATION_TOOL" rpm --import https://brave-browser-rpm-release.s3.brave.com/brave-core.asc - "$ESCALATION_TOOL" "$PACKAGER" addrepo https://brave-browser-rpm-release.s3.brave.com/brave-browser.repo - "$ESCALATION_TOOL" "$PACKAGER" refresh - "$ESCALATION_TOOL" "$PACKAGER" --non-interactive install brave-browser - ;; - pacman) - "$AUR_HELPER" -S --noconfirm brave-bin - ;; - dnf) - "$ESCALATION_TOOL" "$PACKAGER" install -y dnf-plugins-core - "$ESCALATION_TOOL" "$PACKAGER" config-manager --add-repo https://brave-browser-rpm-release.s3.brave.com/brave-browser.repo - "$ESCALATION_TOOL" rpm --import https://brave-browser-rpm-release.s3.brave.com/brave-core.asc - "$ESCALATION_TOOL" "$PACKAGER" install -y brave-browser - ;; - *) - printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" - exit 1 - ;; - esac - else - printf "%b\n" "${GREEN}Brave Browser is already installed.${RC}" - fi -} - -install_vivaldi() { - if ! command_exists vivaldi; then - printf "%b\n" "${YELLOW}Installing Vivaldi...${RC}" - curl -fsSL https://downloads.vivaldi.com/snapshot/install-vivaldi.sh | sh - if [ $? -eq 0 ]; then - printf "%b\n" "${GREEN}Vivaldi installed successfully!${RC}" - else - printf "%b\n" "${RED}Vivaldi installation failed!${RC}" - fi - else - printf "%b\n" "${GREEN}Vivaldi Browser is already installed.${RC}" - fi -} - -install_chromium() { - if ! command_exists chromium; then - printf "%b\n" "${YELLOW}Installing Chromium...${RC}" - case "$PACKAGER" in - pacman) - "$ESCALATION_TOOL" "$PACKAGER" -S --noconfirm chromium - ;; - *) - "$ESCALATION_TOOL" "$PACKAGER" install -y chromium - ;; - esac - else - printf "%b\n" "${GREEN}Chromium Browser is already installed.${RC}" - fi -} - -install_lynx() { - if ! command_exists lynx; then - printf "%b\n" "${YELLOW}Installing Lynx...${RC}" - case "$PACKAGER" in - pacman) - "$ESCALATION_TOOL" "$PACKAGER" -S --noconfirm lynx - ;; - *) - "$ESCALATION_TOOL" "$PACKAGER" install -y lynx - ;; - esac - else - printf "%b\n" "${GREEN}Lynx TUI Browser is already installed.${RC}" - fi -} - -browserSetup() { - clear - printf "%b\n" "Browser Installation Script" - printf "%b\n" "----------------------------" - printf "%b\n" "Select the browsers you want to install:" - printf "%b\n" "1. Google Chrome" - printf "%b\n" "2. Mozilla Firefox" - printf "%b\n" "3. Librewolf" - printf "%b\n" "4. Brave" - printf "%b\n" "5. Vivaldi" - printf "%b\n" "6. Chromium" - printf "%b\n" "7. Thorium" - printf "%b\n" "8. Lynx" - printf "%b\n" "----------------------------" - printf "%b" "Enter your choices (e.g. 1 3 5): " - read -r choice - for ch in $choice; do - case $ch in - 1) install_chrome ;; - 2) install_firefox ;; - 3) install_librewolf ;; - 4) install_brave ;; - 5) install_vivaldi ;; - 6) install_chromium ;; - 7) install_thorium ;; - 8) install_lynx;; - *) printf "%b\n" "${RED}Invalid option: $ch ${RC}" ;; - esac - done - printf "%b\n" "${GREEN}Installation complete!${RC}" -} - -checkEnv -checkEscalationTool -checkAURHelper -browserSetup diff --git a/core/tabs/applications-setup/browsers/brave.sh b/core/tabs/applications-setup/browsers/brave.sh new file mode 100644 index 00000000..8a7eab40 --- /dev/null +++ b/core/tabs/applications-setup/browsers/brave.sh @@ -0,0 +1,45 @@ +#!/bin/sh -e + +. ../../common-script.sh + +installBrave() { + if ! command_exists brave; then + printf "%b\n" "${YELLOW}Installing Brave...${RC}" + case "$PACKAGER" in + apt-get|nala) + "$ESCALATION_TOOL" "$PACKAGER" install -y curl + "$ESCALATION_TOOL" curl -fsSLo /usr/share/keyrings/brave-browser-archive-keyring.gpg https://brave-browser-apt-release.s3.brave.com/brave-browser-archive-keyring.gpg + echo "deb [signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg] https://brave-browser-apt-release.s3.brave.com/ stable main" | "$ESCALATION_TOOL" tee /etc/apt/sources.list.d/brave-browser-release.list + "$ESCALATION_TOOL" "$PACKAGER" update + "$ESCALATION_TOOL" "$PACKAGER" install -y brave-browser + ;; + zypper) + "$ESCALATION_TOOL" "$PACKAGER" install -y curl + "$ESCALATION_TOOL" rpm --import https://brave-browser-rpm-release.s3.brave.com/brave-core.asc + "$ESCALATION_TOOL" "$PACKAGER" addrepo https://brave-browser-rpm-release.s3.brave.com/brave-browser.repo + "$ESCALATION_TOOL" "$PACKAGER" refresh + "$ESCALATION_TOOL" "$PACKAGER" --non-interactive install brave-browser + ;; + pacman) + "$AUR_HELPER" -S --needed --noconfirm brave-bin + ;; + dnf) + "$ESCALATION_TOOL" "$PACKAGER" install -y dnf-plugins-core + "$ESCALATION_TOOL" "$PACKAGER" config-manager --add-repo https://brave-browser-rpm-release.s3.brave.com/brave-browser.repo + "$ESCALATION_TOOL" rpm --import https://brave-browser-rpm-release.s3.brave.com/brave-core.asc + "$ESCALATION_TOOL" "$PACKAGER" install -y brave-browser + ;; + *) + printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" + exit 1 + ;; + esac + else + printf "%b\n" "${GREEN}Brave Browser is already installed.${RC}" + fi +} + +checkEnv +checkEscalationTool +checkAURHelper +installBrave \ No newline at end of file diff --git a/core/tabs/applications-setup/browsers/chromium.sh b/core/tabs/applications-setup/browsers/chromium.sh new file mode 100644 index 00000000..e929dbc9 --- /dev/null +++ b/core/tabs/applications-setup/browsers/chromium.sh @@ -0,0 +1,23 @@ +#!/bin/sh -e + +. ../../common-script.sh + +installChromium() { +if ! command_exists chromium; then + printf "%b\n" "${YELLOW}Installing Chromium...${RC}" + case "$PACKAGER" in + pacman) + "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm chromium + ;; + *) + "$ESCALATION_TOOL" "$PACKAGER" install -y chromium + ;; + esac +else + printf "%b\n" "${GREEN}Chromium Browser is already installed.${RC}" +fi +} + +checkEnv +checkEscalationTool +installChromium \ No newline at end of file diff --git a/core/tabs/applications-setup/browsers/firefox.sh b/core/tabs/applications-setup/browsers/firefox.sh new file mode 100644 index 00000000..67980858 --- /dev/null +++ b/core/tabs/applications-setup/browsers/firefox.sh @@ -0,0 +1,33 @@ +#!/bin/sh -e + +. ../../common-script.sh + +installFirefox() { + if ! command_exists firefox; then + printf "%b\n" "${YELLOW}Installing Mozilla Firefox...${RC}" + case "$PACKAGER" in + apt-get|nala) + "$ESCALATION_TOOL" "$PACKAGER" install -y firefox-esr + ;; + zypper) + "$ESCALATION_TOOL" "$PACKAGER" --non-interactive install MozillaFirefox + ;; + pacman) + "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm firefox + ;; + dnf) + "$ESCALATION_TOOL" "$PACKAGER" install -y firefox + ;; + *) + printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" + exit 1 + ;; + esac + else + printf "%b\n" "${GREEN}Firefox Browser is already installed.${RC}" + fi +} + +checkEnv +checkEscalationTool +installFirefox diff --git a/core/tabs/applications-setup/browsers/google-chrome.sh b/core/tabs/applications-setup/browsers/google-chrome.sh new file mode 100644 index 00000000..d66ec9a5 --- /dev/null +++ b/core/tabs/applications-setup/browsers/google-chrome.sh @@ -0,0 +1,39 @@ +#!/bin/sh -e + +. ../../common-script.sh + +installChrome() { + if ! command_exists google-chrome; then + printf "%b\n" "${YELLOW}Installing Google Chrome...${RC}" + case "$PACKAGER" in + apt-get|nala) + curl -O https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb + "$ESCALATION_TOOL" "$PACKAGER" install -y ./google-chrome-stable_current_amd64.deb + ;; + zypper) + "$ESCALATION_TOOL" "$PACKAGER" addrepo http://dl.google.com/linux/chrome/rpm/stable/x86_64 Google-Chrome + "$ESCALATION_TOOL" "$PACKAGER" refresh + "$ESCALATION_TOOL" "$PACKAGER" --non-interactive install google-chrome-stable + ;; + pacman) + "$AUR_HELPER" -S --needed --noconfirm google-chrome + ;; + dnf) + "$ESCALATION_TOOL" "$PACKAGER" install -y fedora-workstation-repositories + "$ESCALATION_TOOL" "$PACKAGER" config-manager --set-enabled google-chrome + "$ESCALATION_TOOL" "$PACKAGER" install -y google-chrome-stable + ;; + *) + printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" + exit 1 + ;; + esac + else + printf "%b\n" "${GREEN}Google Chrome Browser is already installed.${RC}" + fi +} + +checkEnv +checkEscalationTool +checkAURHelper +installChrome \ No newline at end of file diff --git a/core/tabs/applications-setup/browsers/librewolf.sh b/core/tabs/applications-setup/browsers/librewolf.sh new file mode 100644 index 00000000..a630b9c7 --- /dev/null +++ b/core/tabs/applications-setup/browsers/librewolf.sh @@ -0,0 +1,48 @@ +#!/bin/sh -e + +. ../../common-script.sh + +installLibreWolf() { + if ! command_exists librewolf; then + printf "%b\n" "${YELLOW}Installing Librewolf...${RC}" + case "$PACKAGER" in + apt-get|nala) + "$ESCALATION_TOOL" "$PACKAGER" install -y gnupg lsb-release apt-transport-https ca-certificates + distro=`if echo " una bookworm vanessa focal jammy bullseye vera uma " | grep -q " $(lsb_release -sc) "; then lsb_release -sc; else echo focal; fi` + curl -fsSL https://deb.librewolf.net/keyring.gpg | "$ESCALATION_TOOL" gpg --dearmor -o /usr/share/keyrings/librewolf.gpg + echo "Types: deb +URIs: https://deb.librewolf.net +Suites: $distro +Components: main +Architectures: amd64 +Signed-By: /usr/share/keyrings/librewolf.gpg" | "$ESCALATION_TOOL" tee /etc/apt/sources.list.d/librewolf.sources > /dev/null + "$ESCALATION_TOOL" "$PACKAGER" update + "$ESCALATION_TOOL" "$PACKAGER" install -y librewolf + ;; + dnf) + curl -fsSL https://rpm.librewolf.net/librewolf-repo.repo | pkexec tee /etc/yum.repos.d/librewolf.repo > /dev/null + "$ESCALATION_TOOL" "$PACKAGER" install -y librewolf + ;; + zypper) + "$ESCALATION_TOOL" rpm --import https://rpm.librewolf.net/pubkey.gpg + "$ESCALATION_TOOL" zypper ar -ef https://rpm.librewolf.net librewolf + "$ESCALATION_TOOL" zypper refresh + "$ESCALATION_TOOL" zypper --non-interactive install librewolf + ;; + pacman) + "$AUR_HELPER" -S --needed --noconfirm librewolf-bin + ;; + *) + printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" + exit 1 + ;; + esac + else + printf "%b\n" "${GREEN}LibreWolf Browser is already installed.${RC}" + fi +} + +checkEnv +checkEscalationTool +checkAURHelper +installLibreWolf \ No newline at end of file diff --git a/core/tabs/applications-setup/browsers/lynx.sh b/core/tabs/applications-setup/browsers/lynx.sh new file mode 100644 index 00000000..002ff7e3 --- /dev/null +++ b/core/tabs/applications-setup/browsers/lynx.sh @@ -0,0 +1,23 @@ +#!/bin/sh -e + +. ../../common-script.sh + +installLynx() { + if ! command_exists lynx; then + printf "%b\n" "${YELLOW}Installing Lynx...${RC}" + case "$PACKAGER" in + pacman) + "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm lynx + ;; + *) + "$ESCALATION_TOOL" "$PACKAGER" install -y lynx + ;; + esac + else + printf "%b\n" "${GREEN}Lynx TUI Browser is already installed.${RC}" + fi +} + +checkEnv +checkEscalationTool +installLynx \ No newline at end of file diff --git a/core/tabs/applications-setup/browsers/thorium.sh b/core/tabs/applications-setup/browsers/thorium.sh new file mode 100644 index 00000000..c45ebc80 --- /dev/null +++ b/core/tabs/applications-setup/browsers/thorium.sh @@ -0,0 +1,35 @@ +#!/bin/sh -e + +. ../../common-script.sh + +installThrorium() { + if ! command_exists thorium-browser; then + printf "%b\n" "${YELLOW}Installing Thorium Browser...${RC}" + case "$PACKAGER" in + apt-get|nala) + "$ESCALATION_TOOL" rm -fv /etc/apt/sources.list.d/thorium.list + "$ESCALATION_TOOL" curl http://dl.thorium.rocks/debian/dists/stable/thorium.list -o /etc/apt/sources.list.d/thorium.list + "$ESCALATION_TOOL" "$PACKAGER" update + "$ESCALATION_TOOL" "$PACKAGER" install -y thorium-browser + ;; + zypper|dnf) + url=$(curl -s https://api.github.com/repos/Alex313031/Thorium/releases/latest | grep -oP '(?<=browser_download_url": ")[^"]*\.rpm') + echo "$url" && curl -L "$url" -o thorium-latest.rpm + "$ESCALATION_TOOL" "$PACKAGER" install -y thorium-latest.rpm && rm thorium-latest.rpm + ;; + pacman) + "$AUR_HELPER" -S --needed --noconfirm thorium-browser-bin + ;; + *) + printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" + ;; + esac + else + printf "%b\n" "${GREEN}Thorium Browser is already installed.${RC}" + fi +} + +checkEnv +checkEscalationTool +checkAURHelper +installThrorium \ No newline at end of file diff --git a/core/tabs/applications-setup/browsers/vivaldi.sh b/core/tabs/applications-setup/browsers/vivaldi.sh new file mode 100644 index 00000000..311816d0 --- /dev/null +++ b/core/tabs/applications-setup/browsers/vivaldi.sh @@ -0,0 +1,40 @@ +#!/bin/sh -e + +. ../../common-script.sh + +installVivaldi() { + if ! command_exists vivaldi; then + printf "%b\n" "${YELLOW}Installing Vivaldi...${RC}" + case "$PACKAGER" in + apt-get|nala) + "$ESCALATION_TOOL" "$PACKAGER" install -y curl + "$ESCALATION_TOOL" curl -fsSL https://repo.vivaldi.com/archive/linux_signing_key.pub | gpg --dearmor | sudo dd of=/usr/share/keyrings/vivaldi-browser.gpg + "$ESCALATION_TOOL" echo "deb [signed-by=/usr/share/keyrings/vivaldi-browser.gpg arch=$(dpkg --print-architecture)] https://repo.vivaldi.com/archive/deb/ stable main" | sudo dd of=/etc/apt/sources.list.d/vivaldi-archive.list + "$ESCALATION_TOOL" "$PACKAGER" update + "$ESCALATION_TOOL" "$PACKAGER" install -y vivaldi-stable + ;; + dnf) + "$ESCALATION_TOOL" "$PACKAGER" install -y dnf-plugins-core + "$ESCALATION_TOOL" "$PACKAGER" config-manager --add-repo https://repo.vivaldi.com/stable/vivaldi-fedora.repo + "$ESCALATION_TOOL" "$PACKAGER" install -y vivaldi-stable + ;; + zypper) + "$ESCALATION_TOOL" zypper ar https://repo.vivaldi.com/archive/vivaldi-suse.repo + "$ESCALATION_TOOL" zypper --non-interactive --gpg-auto-import-keys in vivaldi-stable + ;; + pacman) + "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm vivaldi + ;; + *) + printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" + exit 1 + ;; + esac + else + printf "%b\n" "${GREEN}Vivaldi Browser is already installed.${RC}" + fi +} + +checkEnv +checkEscalationTool +installVivaldi 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/communication-apps/signal-setup.sh b/core/tabs/applications-setup/communication-apps/signal-setup.sh index 7f5d70fc..cdd71b55 100644 --- a/core/tabs/applications-setup/communication-apps/signal-setup.sh +++ b/core/tabs/applications-setup/communication-apps/signal-setup.sh @@ -3,7 +3,7 @@ . ../../common-script.sh installSignal() { - if ! command_exists signal; then + if ! command_exists org.signal.Signal && ! command_exists signal; then printf "%b\n" "${YELLOW}Installing Signal...${RC}" case "$PACKAGER" in apt-get|nala) @@ -20,8 +20,8 @@ installSignal() { "$ESCALATION_TOOL" "$PACKAGER" -S --noconfirm signal-desktop ;; dnf) - "$ESCALATION_TOOL" "$PACKAGER" copr enable luminoso/Signal-Desktop - "$ESCALATION_TOOL" "$PACKAGER" install -y signal-desktop + checkFlatpak + flatpak install -y flathub org.signal.Signal ;; *) printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" diff --git a/core/tabs/applications-setup/communication-apps/slack-setup.sh b/core/tabs/applications-setup/communication-apps/slack-setup.sh index 5ecdd27f..24d6e532 100644 --- a/core/tabs/applications-setup/communication-apps/slack-setup.sh +++ b/core/tabs/applications-setup/communication-apps/slack-setup.sh @@ -3,14 +3,14 @@ . ../../common-script.sh installSlack() { - if ! command_exists slack; then + if ! command_exists com.slack.Slack && ! command_exists slack; then printf "%b\n" "${YELLOW}Installing Slack...${RC}" case "$PACKAGER" in pacman) "$AUR_HELPER" -S --needed --noconfirm slack-desktop ;; *) - . ./setup-flatpak.sh + checkFlatpak flatpak install -y flathub com.slack.Slack ;; esac diff --git a/core/tabs/applications-setup/communication-apps/zoom-setup.sh b/core/tabs/applications-setup/communication-apps/zoom-setup.sh index 4b50013a..19d7e407 100644 --- a/core/tabs/applications-setup/communication-apps/zoom-setup.sh +++ b/core/tabs/applications-setup/communication-apps/zoom-setup.sh @@ -3,14 +3,14 @@ . ../../common-script.sh installZoom() { - if ! command_exists zoom; then + if ! command_exists us.zoom.Zoom && ! command_exists zoom; then printf "%b\n" "${YELLOW}Installing Zoom...${RC}" case "$PACKAGER" in pacman) "$AUR_HELPER" -S --needed --noconfirm zoom ;; *) - . ./setup-flatpak.sh + checkFlatpak flatpak install -y flathub us.zoom.Zoom ;; esac diff --git a/core/tabs/applications-setup/docker-setup.sh b/core/tabs/applications-setup/docker-setup.sh index afcd1572..4844d10e 100755 --- a/core/tabs/applications-setup/docker-setup.sh +++ b/core/tabs/applications-setup/docker-setup.sh @@ -26,6 +26,12 @@ install_docker() { apt-get|nala) curl -fsSL https://get.docker.com | sh ;; + dnf) + "$ESCALATION_TOOL" "$PACKAGER" -y install dnf-plugins-core + "$ESCALATION_TOOL" "$PACKAGER" config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo + "$ESCALATION_TOOL" "$PACKAGER" -y install docker-ce docker-ce-cli containerd.io docker-buildx-plugin + "$ESCALATION_TOOL" systemctl enable --now docker + ;; zypper) "$ESCALATION_TOOL" "$PACKAGER" --non-interactive install docker "$ESCALATION_TOOL" systemctl enable docker @@ -49,6 +55,11 @@ install_docker_compose() { apt-get|nala) "$ESCALATION_TOOL" "$PACKAGER" install -y docker-compose-plugin ;; + dnf) + "$ESCALATION_TOOL" "$PACKAGER" -y install dnf-plugins-core + "$ESCALATION_TOOL" "$PACKAGER" config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo + "$ESCALATION_TOOL" "$PACKAGER" install -y docker-compose-plugin + ;; zypper) "$ESCALATION_TOOL" "$PACKAGER" --non-interactive install docker-compose ;; diff --git a/core/tabs/applications-setup/dwmtitus-setup.sh b/core/tabs/applications-setup/dwmtitus-setup.sh index b17c3545..89bf649b 100755 --- a/core/tabs/applications-setup/dwmtitus-setup.sh +++ b/core/tabs/applications-setup/dwmtitus-setup.sh @@ -218,6 +218,9 @@ setupDisplayManager() { case "$PACKAGER" in pacman) "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm "$DM" + if [ "$DM" = "lightdm" ]; then + "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm lightdm-gtk-greeter + fi ;; apt-get|nala) "$ESCALATION_TOOL" "$PACKAGER" install -y "$DM" diff --git a/core/tabs/applications-setup/grub-theme.sh b/core/tabs/applications-setup/grub-theme.sh index d0b35420..9b79b39b 100644 --- a/core/tabs/applications-setup/grub-theme.sh +++ b/core/tabs/applications-setup/grub-theme.sh @@ -4,8 +4,12 @@ themeinstall(){ mkdir -p "$HOME/.local/share" - cd "$HOME/.local/share" && git clone "https://github.com/ChrisTitusTech/Top-5-Bootloader-Themes" - cd "$HOME/.local/share/Top-5-Bootloader-Themes" + cd "$HOME/.local/share" + if [ -d 'Top-5-Bootloader-Themes' ]; then + rm -rf 'Top-5-Bootloader-Themes' + fi + git clone "https://github.com/ChrisTitusTech/Top-5-Bootloader-Themes" + cd "Top-5-Bootloader-Themes" "$ESCALATION_TOOL" ./install.sh } diff --git a/core/tabs/applications-setup/linutil-installer.sh b/core/tabs/applications-setup/linutil-installer.sh index 28e180e0..fd925e0b 100755 --- a/core/tabs/applications-setup/linutil-installer.sh +++ b/core/tabs/applications-setup/linutil-installer.sh @@ -15,9 +15,9 @@ installLinutil() { printf "%b" "Enter your choice: " read -r choice case $choice in - 1) "$AUR_HELPER" -S --noconfirm linutil ;; - 2) "$AUR_HELPER" -S --noconfirm linutil-bin ;; - 3) "$AUR_HELPER" -S --noconfirm linutil-git ;; + 1) "$AUR_HELPER" -S --needed --noconfirm linutil ;; + 2) "$AUR_HELPER" -S --needed --noconfirm linutil-bin ;; + 3) "$AUR_HELPER" -S --needed --noconfirm linutil-git ;; *) printf "%b\n" "${RED}Invalid choice:${RC} $choice" exit 1 @@ -35,10 +35,10 @@ installLinutil() { printf "%b\n" "${YELLOW}Installing rustup...${RC}" case "$PACKAGER" in pacman) - "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm rustup + "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm curl rustup man-db ;; dnf) - "$ESCALATION_TOOL" "$PACKAGER" install -y rustup + "$ESCALATION_TOOL" "$PACKAGER" install -y curl rustup man-pages man-db man ;; zypper) "$ESCALATION_TOOL" "$PACKAGER" install -n curl gcc make @@ -54,12 +54,23 @@ installLinutil() { rustup default stable cargo install --force linutil_tui printf "%b\n" "${GREEN}Installed successfully.${RC}" + installExtra ;; *) printf "%b\n" "${RED}Linutil not installed.${RC}" ;; esac esac } +installExtra() { + printf "%b\n" "${YELLOW}Installing the manpage...${RC}" + "$ESCALATION_TOOL" mkdir -p /usr/share/man/man1 + curl 'https://raw.githubusercontent.com/ChrisTitusTech/linutil/refs/heads/main/man/linutil.1' | "$ESCALATION_TOOL" tee '/usr/share/man/man1/linutil.1' > /dev/null + printf "%b\n" "${YELLOW}Creating a Desktop Entry...${RC}" + "$ESCALATION_TOOL" mkdir -p /usr/share/applications + curl 'https://raw.githubusercontent.com/ChrisTitusTech/linutil/refs/heads/main/linutil.desktop' | "$ESCALATION_TOOL" tee /usr/share/applications/linutil.desktop > /dev/null + printf "%b\n" "${GREEN}Done.${RC}" +} + checkEnv checkEscalationTool checkAURHelper diff --git a/core/tabs/applications-setup/mybash-setup.sh b/core/tabs/applications-setup/mybash-setup.sh index 76160e93..a12ca318 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 } diff --git a/core/tabs/applications-setup/office-suite-setup.sh b/core/tabs/applications-setup/office-suite-setup.sh deleted file mode 100644 index 61a08ebd..00000000 --- a/core/tabs/applications-setup/office-suite-setup.sh +++ /dev/null @@ -1,203 +0,0 @@ -#!/bin/sh -e - -. ../common-script.sh - -install_onlyoffice() { - if ! command_exists onlyoffice-desktopeditors; then - printf "%b\n" "${YELLOW}Installing Only Office..${RC}." - case "$PACKAGER" in - apt-get|nala) - curl -O https://download.onlyoffice.com/install/desktop/editors/linux/onlyoffice-desktopeditors_amd64.deb - "$ESCALATION_TOOL" "$PACKAGER" install -y ./onlyoffice-desktopeditors_amd64.deb - ;; - zypper|dnf) - . ./setup-flatpak.sh - flatpak install -y flathub org.onlyoffice.desktopeditors - ;; - pacman) - "$AUR_HELPER" -S --needed --noconfirm onlyoffice - ;; - *) - printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" - exit 1 - ;; - esac - else - printf "%b\n" "${GREEN}Only Office is already installed.${RC}" - fi -} - -install_libreoffice() { - if ! command_exists libreoffice; then - printf "%b\n" "${YELLOW}Installing Libre Office...${RC}" - case "$PACKAGER" in - apt-get|nala) - "$ESCALATION_TOOL" "$PACKAGER" install -y libreoffice-core - ;; - zypper|dnf) - . ./setup-flatpak.sh - flatpak install -y flathub org.libreoffice.LibreOffice - ;; - pacman) - "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm libreoffice-fresh - ;; - *) - printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" - exit 1 - ;; - esac - else - printf "%b\n" "${GREEN}Libre Office is already installed.${RC}" - fi -} - -install_wpsoffice() { - if ! command_exists com.wps.Office; then - printf "%b\n" "${YELLOW}Installing WPS Office...${RC}" - case "$PACKAGER" in - pacman) - "$AUR_HELPER" -S --noconfirm wps-office - ;; - *) - . ./setup-flatpak.sh - flatpak install flathub com.wps.Office - ;; - esac - else - printf "%b\n" "${GREEN}WPS Office is already installed.${RC}" - fi -} - -# needs to be updated every year for latest version -install_freeoffice() { - if ! command_exists softmaker-freeoffice-2024 freeoffice softmaker; then - printf "%b\n" "${YELLOW}Installing Free Office...${RC}" - case "$PACKAGER" in - apt-get|nala) - curl -O https://www.softmaker.net/down/softmaker-freeoffice-2024_1218-01_amd64.deb - "$ESCALATION_TOOL" "$PACKAGER" install -y ./softmaker-freeoffice-2024_1218-01_amd64.deb - ;; - zypper) - "$ESCALATION_TOOL" "$PACKAGER" addrepo -f https://shop.softmaker.com/repo/rpm SoftMaker - "$ESCALATION_TOOL" "$PACKAGER" --gpg-auto-import-keys refresh - "$ESCALATION_TOOL" "$PACKAGER" --non-interactive install softmaker-freeoffice-2024 - ;; - pacman) - "$AUR_HELPER" -S --noconfirm freeoffice - ;; - dnf) - "$ESCALATION_TOOL" curl -O -qO /etc/yum.repos.d/softmaker.repo https://shop.softmaker.com/repo/softmaker.repo - "$ESCALATION_TOOL" "$PACKAGER" install -y softmaker-freeoffice-2024 - ;; - *) - printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" - exit 1 - ;; - esac - else - printf "%b\n" "${GREEN}Free Office is already installed.${RC}" - fi -} - -install_evince() { - if ! command_exists evince; then - printf "%b\n" "${YELLOW}Installing Evince...${RC}" - case "$PACKAGER" in - pacman) - "$ESCALATION_TOOL" "$PACKAGER" -S --noconfirm evince - ;; - *) - "$ESCALATION_TOOL" "$PACKAGER" install -y evince - ;; - esac - else - printf "%b\n" "${GREEN}Evince is already installed.${RC}" - fi -} - -install_okular() { - if ! command_exists okular; then - printf "%b\n" "${YELLOW}Installing Okular...${RC}" - case "$PACKAGER" in - pacman) - "$ESCALATION_TOOL" "$PACKAGER" -S --noconfirm okular - ;; - *) - "$ESCALATION_TOOL" "$PACKAGER" install -y okular - ;; - esac - else - printf "%b\n" "${GREEN}Okular is already installed.${RC}" - fi -} - -install_pdfstudioviewer() { - if ! command_exists pdfstudioviewer2024/pdfstudioviewer2024; then - printf "%b\n" "${YELLOW}Installing PDF Studio Viewer...${RC}" - curl -O https://download.qoppa.com/pdfstudioviewer/PDFStudioViewer_linux64.sh - "$ESCALATION_TOOL" chmod +x PDFStudioViewer_linux64.sh - if sh PDFStudioViewer_linux64.sh; then - printf "%b\n" "${GREEN}PDF Studio Viewer installed successfully!${RC}" - else - printf "%b\n" "${RED}Installation failed!${RC}" - fi - rm PDFStudioViewer_linux64.sh - else - printf "%b\n" "${GREEN}PDF Studio Viewer is already installed.${RC}" - fi -} - -install_pdfstudio() { - if ! command_exists pdfstudio2024/pdfstudio2024; then - printf "%b\n" "${YELLOW}Installing PDF Studio...${RC}" - curl -O https://download.qoppa.com/pdfstudio/PDFStudio_linux64.sh - "$ESCALATION_TOOL" chmod +x PDFStudio_linux64.sh - if sh PDFStudio_linux64.sh; then - printf "%b\n" "${GREEN}PDF Studio installed successfully!${RC}" - else - printf "%b\n" "${RED}PDF Studio installation failed!${RC}" - fi - rm PDFStudio_linux64.sh - else - printf "%b\n" "${GREEN}PDF Studio is already installed.${RC}" - fi -} - -officeSuiteSetup() { - clear - printf "%b\n" "Office Suite Setup Script" - printf "%b\n" "----------------------------" - printf "%b\n" "Select the suite you want to install:" - printf "%b\n" "1. OnlyOffice" - printf "%b\n" "2. LibreOffice" - printf "%b\n" "3. WPS Office" - printf "%b\n" "4. Free Office" - printf "%b\n" "Select the PDF Suite you want to install:" - printf "%b\n" "----------------------------" - printf "%b\n" "5. Evince" - printf "%b\n" "6. Okular" - printf "%b\n" "7. PDF Studio Viewer" - printf "%b\n" "8. PDF Studio (Paid Software)" - printf "%b\n" "----------------------------" - printf "%b" "Enter your choices (e.g., 1 3 5): " - read -r choice - for ch in $choice; do - case $ch in - 1) install_onlyoffice ;; - 2) install_libreoffice ;; - 3) install_wpsoffice ;; - 4) install_freeoffice ;; - 5) install_evince ;; - 6) install_okular ;; - 7) install_pdfstudioviewer ;; - 8) install_pdfstudio ;; - *) printf "%b\n" "${RED}Invalid option: $ch ${RC}" ;; - esac - done - printf "%b\n" "${GREEN}Installation complete!${RC}" -} - -checkEnv -checkEscalationTool -checkAURHelper -officeSuiteSetup diff --git a/core/tabs/applications-setup/office-suites/freeoffice.sh b/core/tabs/applications-setup/office-suites/freeoffice.sh new file mode 100644 index 00000000..d289165e --- /dev/null +++ b/core/tabs/applications-setup/office-suites/freeoffice.sh @@ -0,0 +1,38 @@ +#!/bin/sh -e + +. ../../common-script.sh + +installFreeOffice() { + if ! command_exists softmaker-freeoffice-2024 freeoffice softmaker; then + printf "%b\n" "${YELLOW}Installing Free Office...${RC}" + case "$PACKAGER" in + apt-get|nala) + curl -O https://www.softmaker.net/down/softmaker-freeoffice-2024_1218-01_amd64.deb + "$ESCALATION_TOOL" "$PACKAGER" install -y ./softmaker-freeoffice-2024_1218-01_amd64.deb + ;; + zypper) + "$ESCALATION_TOOL" "$PACKAGER" addrepo -f https://shop.softmaker.com/repo/rpm SoftMaker + "$ESCALATION_TOOL" "$PACKAGER" --gpg-auto-import-keys refresh + "$ESCALATION_TOOL" "$PACKAGER" --non-interactive install softmaker-freeoffice-2024 + ;; + pacman) + "$AUR_HELPER" -S --needed --noconfirm freeoffice + ;; + dnf) + "$ESCALATION_TOOL" curl -O -qO /etc/yum.repos.d/softmaker.repo https://shop.softmaker.com/repo/softmaker.repo + "$ESCALATION_TOOL" "$PACKAGER" install -y softmaker-freeoffice-2024 + ;; + *) + printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" + exit 1 + ;; + esac + else + printf "%b\n" "${GREEN}Free Office is already installed.${RC}" + fi +} + +checkEnv +checkEscalationTool +checkAurHelper +installFreeOffice \ No newline at end of file diff --git a/core/tabs/applications-setup/office-suites/libreoffice.sh b/core/tabs/applications-setup/office-suites/libreoffice.sh new file mode 100644 index 00000000..f389abd8 --- /dev/null +++ b/core/tabs/applications-setup/office-suites/libreoffice.sh @@ -0,0 +1,31 @@ +#!/bin/sh -e + +. ../../common-script.sh + +installLibreOffice() { + if ! command_exists org.libreoffice.LibreOffice && ! command_exists libreoffice; then + printf "%b\n" "${YELLOW}Installing Libre Office...${RC}" + case "$PACKAGER" in + apt-get|nala) + "$ESCALATION_TOOL" "$PACKAGER" install -y libreoffice-core + ;; + zypper|dnf) + checkFlatpak + flatpak install -y flathub org.libreoffice.LibreOffice + ;; + pacman) + "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm libreoffice-fresh + ;; + *) + printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" + exit 1 + ;; + esac + else + printf "%b\n" "${GREEN}Libre Office is already installed.${RC}" + fi +} + +checkEnv +checkEscalationTool +installLibreOffice \ No newline at end of file diff --git a/core/tabs/applications-setup/office-suites/onlyoffice.sh b/core/tabs/applications-setup/office-suites/onlyoffice.sh new file mode 100644 index 00000000..f6fb97f6 --- /dev/null +++ b/core/tabs/applications-setup/office-suites/onlyoffice.sh @@ -0,0 +1,33 @@ +#!/bin/sh -e + +. ../../common-script.sh + +installOnlyOffice() { + if ! command_exists org.onlyoffice.desktopeditors && ! command_exists onlyoffice-desktopeditors; then + printf "%b\n" "${YELLOW}Installing Only Office..${RC}." + case "$PACKAGER" in + apt-get|nala) + curl -O https://download.onlyoffice.com/install/desktop/editors/linux/onlyoffice-desktopeditors_amd64.deb + "$ESCALATION_TOOL" "$PACKAGER" install -y ./onlyoffice-desktopeditors_amd64.deb + ;; + zypper|dnf) + checkFlatpak + flatpak install -y flathub org.onlyoffice.desktopeditors + ;; + pacman) + "$AUR_HELPER" -S --needed --noconfirm onlyoffice + ;; + *) + printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" + exit 1 + ;; + esac + else + printf "%b\n" "${GREEN}Only Office is already installed.${RC}" + fi +} + +checkEnv +checkEscalationTool +checkAurHelper +installOnlyOffice \ No newline at end of file diff --git a/core/tabs/applications-setup/office-suites/wpsoffice.sh b/core/tabs/applications-setup/office-suites/wpsoffice.sh new file mode 100644 index 00000000..4ce1f5c5 --- /dev/null +++ b/core/tabs/applications-setup/office-suites/wpsoffice.sh @@ -0,0 +1,25 @@ +#!/bin/sh -e + +. ../../common-script.sh + +installWpsOffice() { + if ! command_exists com.wps.Office && ! command_exists wps; then + printf "%b\n" "${YELLOW}Installing WPS Office...${RC}" + case "$PACKAGER" in + pacman) + "$AUR_HELPER" -S --needed --noconfirm wps-office + ;; + *) + checkFlatpak + flatpak install flathub com.wps.Office + ;; + esac + else + printf "%b\n" "${GREEN}WPS Office is already installed.${RC}" + fi +} + +checkEnv +checkEscalationTool +checkAurHelper +installWpsOffice \ No newline at end of file diff --git a/core/tabs/applications-setup/pdf-suites/evince.sh b/core/tabs/applications-setup/pdf-suites/evince.sh new file mode 100644 index 00000000..9118d36d --- /dev/null +++ b/core/tabs/applications-setup/pdf-suites/evince.sh @@ -0,0 +1,23 @@ +#!/bin/sh -e + +. ../../common-script.sh + +installEvince() { + if ! command_exists evince; then + printf "%b\n" "${YELLOW}Installing Evince...${RC}" + case "$PACKAGER" in + pacman) + "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm evince + ;; + *) + "$ESCALATION_TOOL" "$PACKAGER" install -y evince + ;; + esac + else + printf "%b\n" "${GREEN}Evince is already installed.${RC}" + fi +} + +checkEnv +checkEscalationTool +installEvince \ No newline at end of file diff --git a/core/tabs/applications-setup/pdf-suites/okular.sh b/core/tabs/applications-setup/pdf-suites/okular.sh new file mode 100644 index 00000000..785d512c --- /dev/null +++ b/core/tabs/applications-setup/pdf-suites/okular.sh @@ -0,0 +1,23 @@ +#!/bin/sh -e + +. ../../common-script.sh + +installOkular() { + if ! command_exists okular; then + printf "%b\n" "${YELLOW}Installing Okular...${RC}" + case "$PACKAGER" in + pacman) + "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm okular + ;; + *) + "$ESCALATION_TOOL" "$PACKAGER" install -y okular + ;; + esac + else + printf "%b\n" "${GREEN}Okular is already installed.${RC}" + fi +} + +checkEnv +checkEscalationTool +installOkular \ No newline at end of file diff --git a/core/tabs/applications-setup/pdf-suites/pdfstudio.sh b/core/tabs/applications-setup/pdf-suites/pdfstudio.sh new file mode 100644 index 00000000..5dd5fbf9 --- /dev/null +++ b/core/tabs/applications-setup/pdf-suites/pdfstudio.sh @@ -0,0 +1,23 @@ +#!/bin/sh -e + +. ../../common-script.sh + +installPdfstudio() { + if ! command_exists pdfstudio2024; then + printf "%b\n" "${YELLOW}Installing PDF Studio...${RC}" + curl -O https://download.qoppa.com/pdfstudio/PDFStudio_linux64.sh + "$ESCALATION_TOOL" chmod +x PDFStudio_linux64.sh + if sh PDFStudio_linux64.sh; then + printf "%b\n" "${GREEN}PDF Studio installed successfully!${RC}" + else + printf "%b\n" "${RED}PDF Studio installation failed!${RC}" + fi + rm PDFStudio_linux64.sh + else + printf "%b\n" "${GREEN}PDF Studio is already installed.${RC}" + fi +} + +checkEnv +checkEscalationTool +installPdfstudio diff --git a/core/tabs/applications-setup/pdf-suites/pdfstudioviewer.sh b/core/tabs/applications-setup/pdf-suites/pdfstudioviewer.sh new file mode 100644 index 00000000..e0ab27cf --- /dev/null +++ b/core/tabs/applications-setup/pdf-suites/pdfstudioviewer.sh @@ -0,0 +1,23 @@ +#!/bin/sh -e + +. ../../common-script.sh + +installPdfstudioviewer() { + if ! command_exists pdfstudioviewer2024; then + printf "%b\n" "${YELLOW}Installing PDF Studio Viewer...${RC}" + curl -O https://download.qoppa.com/pdfstudioviewer/PDFStudioViewer_linux64.sh + "$ESCALATION_TOOL" chmod +x PDFStudioViewer_linux64.sh + if sh PDFStudioViewer_linux64.sh; then + printf "%b\n" "${GREEN}PDF Studio Viewer installed successfully!${RC}" + else + printf "%b\n" "${RED}Installation failed!${RC}" + fi + rm PDFStudioViewer_linux64.sh + else + printf "%b\n" "${GREEN}PDF Studio Viewer is already installed.${RC}" + fi +} + +checkEnv +checkEscalationTool +installPdfstudioviewer diff --git a/core/tabs/applications-setup/setup-flatpak.sh b/core/tabs/applications-setup/setup-flatpak.sh index 75da28af..379467a6 100755 --- a/core/tabs/applications-setup/setup-flatpak.sh +++ b/core/tabs/applications-setup/setup-flatpak.sh @@ -2,9 +2,7 @@ . ../common-script.sh -# Used to detect the desktop environment, Only used for the If statement in the setup_flatpak function. -# Perhaps this should be moved to common-script.sh later on? -detect_de() { +checkDE() { if [ -n "$XDG_CURRENT_DESKTOP" ]; then case "$XDG_CURRENT_DESKTOP" in *GNOME*) @@ -17,42 +15,11 @@ detect_de() { fi } -# Install Flatpak if not already installed. -setup_flatpak() { - if ! command_exists flatpak; then - printf "%b\n" "${YELLOW}Installing Flatpak...${RC}" - case "$PACKAGER" in - pacman) - "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm flatpak - ;; - *) - "$ESCALATION_TOOL" "$PACKAGER" install -y flatpak - ;; - esac - printf "%b\n" "Adding Flathub remote..." - "$ESCALATION_TOOL" flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo - else - if command_exists flatpak; then - if ! flatpak remotes | grep -q "flathub"; then - printf "%b" "${YELLOW}Detected Flatpak package manager but Flathub remote is not added. Would you like to add it? (y/N): ${RC}" - read -r add_remote - case "$add_remote" in - [Yy]*) - printf "%b\n" "Adding Flathub remote..." - "$ESCALATION_TOOL" flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo - ;; - esac - else - # Needed mostly for systems without a polkit agent running (Error: updating: Unable to connect to system bus) - printf "%b\n" "${GREEN}Flathub already setup. You can quit.${RC}" - fi - fi - fi - +installExtra() { if [ "$PACKAGER" = "apt-get" ] || [ "$PACKAGER" = "nala" ]; then - detect_de + checkDE # Only used for Ubuntu GNOME. Ubuntu GNOME doesnt allow flathub to be added as a remote to their store. - # So in case the user wants to use a GUI siftware manager they can setup it here + # So in case the user wants to use a GUI software manager they can setup it here if [ "$DE" = "GNOME" ]; then printf "%b" "${YELLOW}Detected GNOME desktop environment. Would you like to install GNOME Software plugin for Flatpak? (y/N): ${RC}" read -r install_gnome @@ -72,4 +39,5 @@ setup_flatpak() { checkEnv checkEscalationTool -setup_flatpak +checkFlatpak +installExtra \ No newline at end of file diff --git a/core/tabs/applications-setup/tab_data.toml b/core/tabs/applications-setup/tab_data.toml index 9af2ee4f..44b74464 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" - -[[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,18 +33,171 @@ 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 = "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 = "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" +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 = "JetBrains Toolbox" +description = "JetBrains Toolbox is a collection of tools and an app that help developers work with JetBrains products." +script = "Developer-tools/jetbrains-toolbox.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" +task_list = "I" + +[[data.entries]] +name = "OnlyOffice" +script = "office-suites/onlyoffice.sh" +task_list = "I" + +[[data.entries]] +name = "WPS Office" +script = "office-suites/wpsoffice.sh" +task_list = "I" + +[[data]] +name = "PDF Suites" + +[[data.entries]] +name = "Evince" +script = "pdf-suites/evince.sh" +task_list = "I" + +[[data.entries]] +name = "Okular" +script = "pdf-suites/okular.sh" +task_list = "I" + +[[data.entries]] +name = "PDF Studio" +script = "pdf-suites/pdfstudio.sh" +task_list = "I" + +[[data.entries]] +name = "PDF Studio Viewer" +script = "pdf-suites/pdfstudioviewer.sh" + +[[data]] +name = "Web Browsers" + +[[data.entries]] +name = "Brave" +description = "Brave is a free and open-source web browser developed by Brave Software, Inc. based on the Chromium web browser." +script = "browsers/brave.sh" +task_list = "I" + +[[data.entries]] +name = "Chromium" +description = "Chromium is an open-source web browser project started by Google, to provide the source code for the proprietary Google Chrome browser." +script = "browsers/chromium.sh" +task_list = "I" + +[[data.entries]] +name = "Google Chrome" +description = "Google Chrome is a fast, secure, and free web browser, built for the modern web." +script = "browsers/google-chrome.sh" +task_list = "I" + +[[data.entries]] +name = "LibreWolf" +description = "LibreWolf is a fork of Firefox, focused on privacy, security, and freedom." +script = "browsers/librewolf.sh" +task_list = "I" + +[[data.entries]] +name = "Lynx" +description = "Lynx is a highly configurable text-based web browser for use on cursor-addressable character cell terminals." +script = "browsers/lynx.sh" +task_list = "I" + +[[data.entries]] +name = "Mozilla Firefox" +description = "Mozilla Firefox is a free and open-source web browser developed by the Mozilla Foundation." +script = "browsers/firefox.sh" +task_list = "I" + +[[data.entries]] +name = "Thorium" +description = "Thorium is a Chromium-based browser focused on privacy and performance." +script = "browsers/thorium.sh" +task_list = "I" + +[[data.entries]] +name = "Vivaldi" +description = "Vivaldi is a freeware, cross-platform web browser developed by Vivaldi Technologies." +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." @@ -115,10 +223,10 @@ script = "bottles-setup.sh" task_list = "FI" [[data]] -name = "Web Browsers" -description = "An interactive script to install popular browsers." -script = "browser-setup.sh" -task_list = "I" +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" @@ -126,12 +234,6 @@ description = "DWM is a dynamic window manager for X.\nIt manages windows in til 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 = "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" @@ -178,12 +280,6 @@ matches = true data = "command_exists" values = [ "linutil" ] -[[data]] -name = "Office Suite" -description = "An office suite installer is a software package that installs productivity tools such as word processing, spreadsheets, presentations, and pdf viewers for business and personal use." -script = "office-suite-setup.sh" -task_list = "I" - [[data]] name = "Rofi" description = "Rofi is a window switcher, run dialog, ssh-launcher and dmenu replacement that started as a clone of simpleswitcher, written by Sean Pringle and later expanded by Dave Davenport.\nThis command installs and configures rofi with configuration from CTT's DWM repo.\nhttps://github.com/ChrisTitusTech/dwm-titus" @@ -204,4 +300,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 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 diff --git a/core/tabs/applications-setup/zsh-setup.sh b/core/tabs/applications-setup/zsh-setup.sh index 01a93c8a..a85b9240 100644 --- a/core/tabs/applications-setup/zsh-setup.sh +++ b/core/tabs/applications-setup/zsh-setup.sh @@ -44,6 +44,7 @@ RPROMPT='%F{15}(%F{166}%D{%H:%M}%F{15})%f' EOL # Ensure /etc/zsh/zshenv sets ZDOTDIR to the user's config directory + [ ! -f /etc/zsh/zshenv ] && "$ESCALATION_TOOL" mkdir -p /etc/zsh && "$ESCALATION_TOOL" touch /etc/zsh/zshenv echo "export ZDOTDIR=\"$HOME/.config/zsh\"" | "$ESCALATION_TOOL" tee -a /etc/zsh/zshenv } diff --git a/core/tabs/common-script.sh b/core/tabs/common-script.sh index 25c5a71f..d431c488 100644 --- a/core/tabs/common-script.sh +++ b/core/tabs/common-script.sh @@ -9,7 +9,48 @@ CYAN='\033[36m' GREEN='\033[32m' command_exists() { - command -v "$1" >/dev/null 2>&1 +for cmd in "$@"; do + export PATH="$HOME/.local/share/flatpak/exports/bin:/var/lib/flatpak/exports/bin:$PATH" + command -v "$cmd" >/dev/null 2>&1 || return 1 +done +return 0 +} + +checkFlatpak() { + if ! command_exists flatpak; then + printf "%b\n" "${YELLOW}Installing Flatpak...${RC}" + case "$PACKAGER" in + pacman) + "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm flatpak + ;; + apk) + "$ESCALATION_TOOL" "$PACKAGER" add flatpak + ;; + *) + "$ESCALATION_TOOL" "$PACKAGER" install -y flatpak + ;; + esac + printf "%b\n" "${YELLOW}Adding Flathub remote...${RC}" + "$ESCALATION_TOOL" flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo + printf "%b\n" "${YELLOW}Applications installed by Flatpak may not appear on your desktop until the user session is restarted...${RC}" + else + if ! flatpak remotes | grep -q "flathub"; then + printf "%b\n" "${YELLOW}Adding Flathub remote...${RC}" + "$ESCALATION_TOOL" flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo + else + printf "%b\n" "${CYAN}Flatpak is installed${RC}" + fi + fi +} + +checkArch() { + case "$(uname -m)" in + x86_64 | amd64) ARCH="x86_64" ;; + aarch64 | arm64) ARCH="aarch64" ;; + *) printf "%b\n" "${RED}Unsupported architecture: $(uname -m)${RC}" && exit 1 ;; + esac + + printf "%b\n" "${CYAN}System architecture: ${ARCH}${RC}" } checkAURHelper() { @@ -27,7 +68,7 @@ checkAURHelper() { done printf "%b\n" "${YELLOW}Installing yay as AUR helper...${RC}" - "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm base-devel + "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm base-devel git cd /opt && "$ESCALATION_TOOL" git clone https://aur.archlinux.org/yay-bin.git && "$ESCALATION_TOOL" chown -R "$USER":"$USER" ./yay-bin cd yay-bin && makepkg --noconfirm -si @@ -125,11 +166,12 @@ checkDistro() { } checkEnv() { - checkCommandRequirements 'curl groups sudo' + checkArch + checkEscalationTool + checkCommandRequirements "curl groups $ESCALATION_TOOL" checkPackageManager 'nala apt-get dnf pacman zypper' checkCurrentDirectoryWritable checkSuperUser checkDistro - checkEscalationTool checkAURHelper } diff --git a/core/tabs/security/firewall-baselines.sh b/core/tabs/security/firewall-baselines.sh index 7ddfeeeb..9c0810f4 100644 --- a/core/tabs/security/firewall-baselines.sh +++ b/core/tabs/security/firewall-baselines.sh @@ -30,7 +30,7 @@ configureUFW() { printf "%b\n" "${YELLOW}Allowing port 80/tcp (UFW)${RC}" "$ESCALATION_TOOL" ufw allow 80/tcp - printf "%b\n" "${YELLO}Allowing port 443/tcp (UFW)${RC}" + printf "%b\n" "${YELLOW}Allowing port 443/tcp (UFW)${RC}" "$ESCALATION_TOOL" ufw allow 443/tcp printf "%b\n" "${YELLOW}Denying Incoming Packets by Default(UFW)${RC}" diff --git a/core/tabs/system-setup/arch/paru-setup.sh b/core/tabs/system-setup/arch/paru-setup.sh index 54cc695a..c08e5d8d 100755 --- a/core/tabs/system-setup/arch/paru-setup.sh +++ b/core/tabs/system-setup/arch/paru-setup.sh @@ -7,9 +7,9 @@ installDepend() { pacman) if ! command_exists paru; then printf "%b\n" "${YELLOW}Installing paru as AUR helper...${RC}" - "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm base-devel - cd /opt && "$ESCALATION_TOOL" git clone https://aur.archlinux.org/paru.git && "$ESCALATION_TOOL" chown -R "$USER": ./paru - cd paru && makepkg --noconfirm -si + "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm base-devel git + 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}" diff --git a/core/tabs/system-setup/arch/server-setup.sh b/core/tabs/system-setup/arch/server-setup.sh index 0650db38..f530fd79 100755 --- a/core/tabs/system-setup/arch/server-setup.sh +++ b/core/tabs/system-setup/arch/server-setup.sh @@ -130,7 +130,7 @@ echo -ne " ██║ ██║██║ ██║╚██████╗██║ ██║ ██║ ██║ ██║ ╚██████╔╝███████║ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝ ------------------------------------------------------------------------ - Please select presetup settings for your system + Please select presetup settings for your system ------------------------------------------------------------------------ " } @@ -146,7 +146,7 @@ filesystem () { case $? in 0) export FS=btrfs;; 1) export FS=ext4;; - 2) + 2) set_password "LUKS_PASSWORD" export FS=luks ;; @@ -155,14 +155,14 @@ filesystem () { esac } -# @description Detects and sets timezone. +# @description Detects and sets timezone. timezone () { # Added this from arch wiki https://wiki.archlinux.org/title/System_time time_zone="$(curl --fail https://ipapi.co/timezone)" echo -ne " System detected your timezone to be '$time_zone' \n" echo -ne "Is this correct? - " + " options=("Yes" "No") select_option "${options[@]}" @@ -171,14 +171,14 @@ timezone () { echo "${time_zone} set as timezone" export TIMEZONE=$time_zone;; n|N|no|NO|No) - echo "Please enter your desired timezone e.g. Europe/London :" + echo "Please enter your desired timezone e.g. Europe/London :" read -r new_timezone echo "${new_timezone} set as timezone" export TIMEZONE=$new_timezone;; *) echo "Wrong option. Try again";timezone;; esac } -# @description Set user's keyboard mapping. +# @description Set user's keyboard mapping. keymap () { echo -ne " Please select key board layout from this list" @@ -216,7 +216,7 @@ echo -ne " ------------------------------------------------------------------------ THIS WILL FORMAT AND DELETE ALL DATA ON THE DISK Please make sure you know what you are doing because - after formating your disk there is no way to get data back + after formatting your disk there is no way to get data back *****BACKUP YOUR DATA BEFORE CONTINUING***** ***I AM NOT RESPONSIBLE FOR ANY DATA LOSS*** ------------------------------------------------------------------------ @@ -236,18 +236,18 @@ echo -ne " drivessd } -# @description Gather username and password to be used for installation. +# @description Gather username and password to be used for installation. userinfo () { # Loop through user input until the user gives a valid username while true - do + do read -r -p "Please enter username: " username - if echo "$username" | grep -qE '^[a-z_][a-z0-9_-]{0,31}(\$)?$' - then + if echo "$username" | grep -qE '^[a-z_]([a-z0-9_-]{0,31}|[a-z0-9_-]{0,30}\$)$' + then break - fi + fi echo "Incorrect username." - done + done export USERNAME=$username while true @@ -264,7 +264,7 @@ userinfo () { done export PASSWORD=$PASSWORD1 - # Loop through user input until the user gives a valid hostname, but allow the user to force save + # Loop through user input until the user gives a valid hostname, but allow the user to force save while true do printf "%b" "Please name your machine: " @@ -331,7 +331,7 @@ echo -ne " pacman -S --noconfirm --needed gptfdisk btrfs-progs glibc echo -ne " ------------------------------------------------------------------------- - Formating Disk + Formatting Disk ------------------------------------------------------------------------- " umount -A --recursive /mnt # make sure everything is unmounted before we start @@ -354,7 +354,7 @@ echo -ne " Creating Filesystems ------------------------------------------------------------------------- " -# @description Creates the btrfs subvolumes. +# @description Creates the btrfs subvolumes. createsubvolumes () { btrfs subvolume create /mnt/@ btrfs subvolume create /mnt/@home @@ -365,11 +365,11 @@ mountallsubvol () { mount -o "${MOUNT_OPTIONS}",subvol=@home "${partition3}" /mnt/home } -# @description BTRFS subvolulme creation and mounting. +# @description BTRFS subvolulme creation and mounting. subvolumesetup () { # create nonroot subvolumes - createsubvolumes -# unmount root to remount with subvolume + createsubvolumes +# unmount root to remount with subvolume umount /mnt # mount @ subvolume mount -o "${MOUNT_OPTIONS}",subvol=@ "${partition3}" /mnt @@ -389,33 +389,36 @@ fi if [[ "${FS}" == "btrfs" ]]; then mkfs.vfat -F32 -n "EFIBOOT" "${partition2}" - mkfs.btrfs -L ROOT "${partition3}" -f + mkfs.btrfs -f "${partition3}" mount -t btrfs "${partition3}" /mnt subvolumesetup elif [[ "${FS}" == "ext4" ]]; then mkfs.vfat -F32 -n "EFIBOOT" "${partition2}" - mkfs.ext4 -L ROOT "${partition3}" + mkfs.ext4 "${partition3}" mount -t ext4 "${partition3}" /mnt elif [[ "${FS}" == "luks" ]]; then - mkfs.vfat -F32 -n "EFIBOOT" "${partition2}" + mkfs.vfat -F32 "${partition2}" # enter luks password to cryptsetup and format root partition echo -n "${LUKS_PASSWORD}" | cryptsetup -y -v luksFormat "${partition3}" - -# open luks container and ROOT will be place holder +# open luks container and ROOT will be place holder echo -n "${LUKS_PASSWORD}" | cryptsetup open "${partition3}" ROOT - # now format that container - mkfs.btrfs -L ROOT "${partition3}" + mkfs.btrfs "${partition3}" # create subvolumes for btrfs mount -t btrfs "${partition3}" /mnt subvolumesetup + ENCRYPTED_PARTITION_UUID=$(blkid -s UUID -o value "${partition3}") fi +BOOT_UUID=$(blkid -s UUID -o value "${partition2}") + sync if ! mountpoint -q /mnt; then echo "ERROR! Failed to mount ${partition3} to /mnt after multiple attempts." exit 1 fi mkdir -p /mnt/boot/efi -mount -t vfat -L EFIBOOT /mnt/boot/ +mount -t vfat -U "${BOOT_UUID}" /mnt/boot/ if ! grep -qs '/mnt' /proc/mounts; then echo "Drive is not mounted can not continue" @@ -438,8 +441,8 @@ fi echo "keyserver hkp://keyserver.ubuntu.com" >> /mnt/etc/pacman.d/gnupg/gpg.conf cp /etc/pacman.d/mirrorlist /mnt/etc/pacman.d/mirrorlist -genfstab -L /mnt >> /mnt/etc/fstab -echo " +genfstab -U /mnt >> /mnt/etc/fstab +echo " Generated /etc/fstab: " cat /mnt/etc/fstab @@ -469,7 +472,7 @@ if [[ $TOTAL_MEM -lt 8000000 ]]; then mkswap /mnt/opt/swap/swapfile swapon /mnt/opt/swap/swapfile # The line below is written to /mnt/ but doesn't contain /mnt/, since it's just / for the system itself. - echo "/opt/swap/swapfile none swap sw 0 0" >> /mnt/etc/fstab # Add swap to fstab, so it KEEPS working after installation. + echo "/opt/swap/swapfile none swap sw 0 0" >> /mnt/etc/fstab # Add swap to fstab, so it KEEPS working after installation. fi gpu_type=$(lspci | grep -E "VGA|3D|Display") @@ -478,14 +481,14 @@ arch-chroot /mnt /bin/bash -c "KEYMAP='${KEYMAP}' /bin/bash" < /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" "${GREEN}DNF Configured Successfully.${RC}" ;; *) printf "%b\n" "${RED}Unsupported distribution: $DTYPE${RC}" 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/fedora/nvidia-proprietary-driver-setup.sh b/core/tabs/system-setup/fedora/nvidia-proprietary-driver-setup.sh index 1e03a40f..e123e8f0 100755 --- a/core/tabs/system-setup/fedora/nvidia-proprietary-driver-setup.sh +++ b/core/tabs/system-setup/fedora/nvidia-proprietary-driver-setup.sh @@ -3,7 +3,7 @@ . ../../common-script.sh # This script allows user to download proprietary drivers for nvidia in fedora -# It also disables noveau nvidia drivers +# It also disables nouveau nvidia drivers # Installation guide link: https://rpmfusion.org/Howto/NVIDIA @@ -91,4 +91,4 @@ printf "%b\n" "${YELLOW}Warning! This script will enable Nvidia non-free reposit checkEnv checkEscalationTool -userConfirmation \ No newline at end of file +userConfirmation diff --git a/core/tabs/system-setup/gaming-setup.sh b/core/tabs/system-setup/gaming-setup.sh index 86ad21aa..07673952 100755 --- a/core/tabs/system-setup/gaming-setup.sh +++ b/core/tabs/system-setup/gaming-setup.sh @@ -21,36 +21,36 @@ installDepend() { alsa-utils alsa-plugins lib32-alsa-plugins alsa-lib lib32-alsa-lib giflib lib32-giflib libpng lib32-libpng \ libldap lib32-libldap openal lib32-openal libxcomposite lib32-libxcomposite libxinerama lib32-libxinerama \ ncurses lib32-ncurses vulkan-icd-loader lib32-vulkan-icd-loader ocl-icd lib32-ocl-icd libva lib32-libva \ - gst-plugins-base-libs lib32-gst-plugins-base-libs sdl2" + gst-plugins-base-libs lib32-gst-plugins-base-libs sdl2 lib32-sdl2 v4l-utils lib32-v4l-utils sqlite lib32-sqlite" - $AUR_HELPER -S --needed --noconfirm "$DEPENDENCIES" "$DISTRO_DEPS" + $AUR_HELPER -S --needed --noconfirm $DEPENDENCIES $DISTRO_DEPS ;; apt-get|nala) - DISTRO_DEPS="libasound2 libsdl2 wine64 wine32" + DISTRO_DEPS="libasound2-plugins:i386 libsdl2-2.0-0:i386 libdbus-1-3:i386 libsqlite3-0:i386 wine64 wine32" "$ESCALATION_TOOL" "$PACKAGER" update "$ESCALATION_TOOL" dpkg --add-architecture i386 "$ESCALATION_TOOL" "$PACKAGER" install -y software-properties-common "$ESCALATION_TOOL" apt-add-repository contrib -y "$ESCALATION_TOOL" "$PACKAGER" update - "$ESCALATION_TOOL" "$PACKAGER" install -y "$DEPENDENCIES" "$DISTRO_DEPS" + "$ESCALATION_TOOL" "$PACKAGER" install -y $DEPENDENCIES $DISTRO_DEPS ;; dnf) - if [ "$(rpm -E %fedora)" -le 41 ]; then + if [ "$(rpm -E %fedora)" -le 41 ]; then "$ESCALATION_TOOL" "$PACKAGER" install ffmpeg ffmpeg-libs -y - "$ESCALATION_TOOL" "$PACKAGER" install -y "$DEPENDENCIES" + "$ESCALATION_TOOL" "$PACKAGER" install -y $DEPENDENCIES else printf "%b\n" "${CYAN}Fedora < 41 detected. Installing rpmfusion repos.${RC}" "$ESCALATION_TOOL" "$PACKAGER" install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-"$(rpm -E %fedora)".noarch.rpm https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-"$(rpm -E %fedora)".noarch.rpm -y "$ESCALATION_TOOL" "$PACKAGER" config-manager --enable fedora-cisco-openh264 -y - "$ESCALATION_TOOL" "$PACKAGER" install -y "$DEPENDENCIES" + "$ESCALATION_TOOL" "$PACKAGER" install -y $DEPENDENCIES fi ;; zypper) - "$ESCALATION_TOOL" "$PACKAGER" -n install "$DEPENDENCIES" + "$ESCALATION_TOOL" "$PACKAGER" -n install $DEPENDENCIES ;; *) - "$ESCALATION_TOOL" "$PACKAGER" install -y "$DEPENDENCIES" + "$ESCALATION_TOOL" "$PACKAGER" install -y $DEPENDENCIES ;; esac } @@ -59,7 +59,7 @@ installAdditionalDepend() { case "$PACKAGER" in pacman) DISTRO_DEPS='steam lutris goverlay' - "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm "$DISTRO_DEPS" + "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm $DISTRO_DEPS ;; apt-get|nala) version=$(git -c 'versionsort.suffix=-' ls-remote --tags --sort='v:refname' https://github.com/lutris/lutris | @@ -69,7 +69,7 @@ installAdditionalDepend() { version_no_v=$(echo "$version" | tr -d v) curl -sSLo "lutris_${version_no_v}_all.deb" "https://github.com/lutris/lutris/releases/download/${version}/lutris_${version_no_v}_all.deb" - + printf "%b\n" "${YELLOW}Installing Lutris...${RC}" "$ESCALATION_TOOL" "$PACKAGER" install ./lutris_"${version_no_v}"_all.deb diff --git a/core/tabs/system-setup/remove-snaps.sh b/core/tabs/system-setup/remove-snaps.sh index 6ea82934..a46ef323 100644 --- a/core/tabs/system-setup/remove-snaps.sh +++ b/core/tabs/system-setup/remove-snaps.sh @@ -3,27 +3,29 @@ . ../common-script.sh removeSnaps() { - case "$PACKAGER" in - pacman) - "$ESCALATION_TOOL" "$PACKAGER" -Rns snapd - ;; - apt-get|nala) - "$ESCALATION_TOOL" "$PACKAGER" autoremove --purge snapd - if [ "$ID" = ubuntu ]; then - "$ESCALATION_TOOL" apt-mark hold snapd - fi - ;; - dnf) - "$ESCALATION_TOOL" "$PACKAGER" remove snapd - ;; - zypper) - "$ESCALATION_TOOL" "$PACKAGER" remove snapd - ;; - *) - printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" - exit 1 - ;; - esac + if command_exists snap; then + case "$PACKAGER" in + pacman) + "$ESCALATION_TOOL" "$PACKAGER" -Rns snapd + ;; + apt-get|nala) + "$ESCALATION_TOOL" "$PACKAGER" autoremove --purge snapd + if [ "$ID" = ubuntu ]; then + "$ESCALATION_TOOL" apt-mark hold snapd + fi + ;; + dnf|zypper) + "$ESCALATION_TOOL" "$PACKAGER" remove snapd + ;; + *) + printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" + exit 1 + ;; + esac + printf "%b\n" "${GREEN}Successfully removed snaps.${RC}" + else + printf "%b\n" "${GREEN}Snapd is not installed.${RC}" + fi } checkEnv diff --git a/core/tabs/system-setup/system-cleanup.sh b/core/tabs/system-setup/system-cleanup.sh old mode 100644 new mode 100755 index 198a9d68..57b827b9 --- 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 @@ -23,19 +21,24 @@ cleanup_system() { ;; pacman) "$ESCALATION_TOOL" "$PACKAGER" -Sc --noconfirm - "$ESCALATION_TOOL" "$PACKAGER" -Rns "$(pacman -Qtdq)" --noconfirm + "$ESCALATION_TOOL" "$PACKAGER" -Rns $(pacman -Qtdq) --noconfirm > /dev/null 2>&1 ;; *) - printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" - return 1 + printf "%b\n" "${RED}Unsupported package manager: ${PACKAGER}. Skipping.${RC}" ;; esac } common_cleanup() { - "$ESCALATION_TOOL" find /var/tmp -type f -atime +5 -delete - "$ESCALATION_TOOL" find /tmp -type f -atime +5 -delete - "$ESCALATION_TOOL" find /var/log -type f -name "*.log" -exec truncate -s 0 {} \; + if [ -d /var/tmp ]; then + "$ESCALATION_TOOL" find /var/tmp -type f -atime +5 -delete + fi + if [ -d /tmp ]; then + "$ESCALATION_TOOL" find /tmp -type f -atime +5 -delete + fi + if [ -d /var/log ]; then + "$ESCALATION_TOOL" find /var/log -type f -name "*.log" -exec truncate -s 0 {} \; + fi "$ESCALATION_TOOL" journalctl --vacuum-time=3d } @@ -45,8 +48,12 @@ clean_data() { case $clean_response in y|Y) printf "%b\n" "${YELLOW}Cleaning up old cache files and emptying trash...${RC}" - find "$HOME/.cache/" -type f -atime +5 -delete - find "$HOME/.local/share/Trash" -mindepth 1 -delete + if [ -d "$HOME/.cache" ]; then + find "$HOME/.cache/" -type f -atime +5 -delete + fi + if [ -d "$HOME/.local/share/Trash" ]; then + find "$HOME/.local/share/Trash" -mindepth 1 -delete + fi printf "%b\n" "${GREEN}Cache and trash cleanup completed.${RC}" ;; *) diff --git a/core/tabs/system-setup/system-update.sh b/core/tabs/system-setup/system-update.sh index 930fd810..c213156a 100755 --- a/core/tabs/system-setup/system-update.sh +++ b/core/tabs/system-setup/system-update.sh @@ -59,7 +59,7 @@ updateSystem() { printf "%b\n" "${GREEN}Updating system${RC}" case "$PACKAGER" in apt-get|nala) - "$ESCALATION_TOOL" "$PACKAGER" update -y + "$ESCALATION_TOOL" "$PACKAGER" update "$ESCALATION_TOOL" "$PACKAGER" upgrade -y ;; dnf) diff --git a/core/tabs/system-setup/tab_data.toml b/core/tabs/system-setup/tab_data.toml index a68d2fdf..b912cd6c 100644 --- a/core/tabs/system-setup/tab_data.toml +++ b/core/tabs/system-setup/tab_data.toml @@ -1,5 +1,4 @@ name = "System Setup" -multi_selectable = false [[data]] name = "Arch Linux" @@ -14,6 +13,7 @@ name = "Arch Server Setup" description = "This command installs a minimal arch server setup under 5 minutes." script = "arch/server-setup.sh" task_list = "SI D" +multi_select = false [[data.entries]] name = "Paru AUR Helper" @@ -43,11 +43,13 @@ task_list = "PFM" [[data.entries]] name = "Multimedia Codecs" +description = "This script is designed to install multimedia codecs, and to ensure RPM Fusion repositories are installed." script = "fedora/multimedia-codecs.sh" task_list = "I" [[data.entries]] name = "Nvidia Proprietary Drivers" +description = "This script is designed to download the proprietary NVIDIA drivers in Fedora." script = "fedora/nvidia-proprietary-driver-setup.sh" task_list = "I" @@ -57,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" @@ -71,14 +79,17 @@ task_list = "I" [[data]] name = "Full System Cleanup" +description = "This script is designed to remove unnecessary packages, clean old cache files, remove temporary files, and to empty the trash." script = "system-cleanup.sh" task_list = "RP PFM" +multi_select = false [[data]] name = "Full System Update" description = "This command updates your system to the latest packages available for your distro" script = "system-update.sh" task_list = "PFM" +multi_select = false [[data]] name = "Gaming Dependencies" @@ -97,3 +108,9 @@ name = "Remove Snaps" description = "This script is designed to remove snap" script = "remove-snaps.sh" task_list = "RP" + +[[data]] +name = "TTY Fonts" +description = "This Script will set the default TTY font to Terminus size 32 Bold" +script = "terminus-tty.sh" +task_list = "I PFM" diff --git a/core/tabs/system-setup/terminus-tty.sh b/core/tabs/system-setup/terminus-tty.sh new file mode 100755 index 00000000..2c1deaa0 --- /dev/null +++ b/core/tabs/system-setup/terminus-tty.sh @@ -0,0 +1,66 @@ +#!/bin/sh -e + +. ../common-script.sh +InstallTermiusFonts() { + if [ ! -f "/usr/share/kbd/consolefonts/ter-c18b.psf.gz" ] && + [ ! -f "/usr/share/consolefonts/Uni3-TerminusBold18x10.psf.gz" ] && + [ ! -f "/usr/lib/kbd/consolefonts/ter-p32n.psf.gz" ]; then + printf "%b\n" "${YELLOW}Installing Terminus Fonts...${RC}" + case "$PACKAGER" in + pacman) + "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm terminus-font + ;; + apt-get|nala) + "$ESCALATION_TOOL" "$PACKAGER" install -y fonts-terminus + ;; + dnf) + "$ESCALATION_TOOL" "$PACKAGER" install -y terminus-fonts-console + ;; + *) + printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" + exit 1 + ;; + esac + else + printf "%b\n" "${GREEN}Terminus Fonts is already installed.${RC}" + fi +} + +SetTermiusFonts() { + case "$DTYPE" in + arch) + printf "%b\n" "${YELLOW}Updating FONT= line in /etc/vconsole.conf...${RC}" + "$ESCALATION_TOOL" sed -i 's/^FONT=.*/FONT=ter-v32b/' /etc/vconsole.conf + if [ -z "$DISPLAY" ] && [ -z "$WAYLAND_DISPLAY" ]; then + "$ESCALATION_TOOL" setfont -C /dev/tty1 ter-v32b + fi + printf "%b\n" "${GREEN}Terminus font set for TTY.${RC}" + ;; + debian) + + printf "%b\n" "${YELLOW}Updating console-setup configuration...${RC}" + "$ESCALATION_TOOL" sed -i 's/^CODESET=.*/CODESET="guess"/' /etc/default/console-setup + "$ESCALATION_TOOL" sed -i 's/^FONTFACE=.*/FONTFACE="TerminusBold"/' /etc/default/console-setup + "$ESCALATION_TOOL" sed -i 's/^FONTSIZE=.*/FONTSIZE="16x32"/' /etc/default/console-setup + printf "%b\n" "${GREEN}Console-setup configuration updated for Terminus font.${RC}" + # Editing console-setup requires initramfs to be regenerated + "$ESCALATION_TOOL" update-initramfs -u + if [ -z "$DISPLAY" ] && [ -z "$WAYLAND_DISPLAY" ]; then + "$ESCALATION_TOOL" setfont -C /dev/tty1 /usr/share/consolefonts/Uni3-TerminusBold32x16.psf.gz + fi + printf "%b\n" "${GREEN}Terminus font has been set for TTY.${RC}" + ;; + fedora) + printf "%b\n" "${YELLOW}Updating FONT= line in /etc/vconsole.conf...${RC}" + "$ESCALATION_TOOL" sed -i 's/^FONT=.*/FONT=ter-v32b/' /etc/vconsole.conf + if [ -z "$DISPLAY" ] && [ -z "$WAYLAND_DISPLAY" ]; then + "$ESCALATION_TOOL" setfont -C /dev/tty1 ter-v32b + fi + printf "%b\n" "${GREEN}Terminus font has been set for TTY.${RC}" + ;; + esac +} + +checkEnv +InstallTermiusFonts +SetTermiusFonts diff --git a/core/tabs/utils/auto-mount.sh b/core/tabs/utils/auto-mount.sh index 7293f26a..f4eb59b2 100644 --- a/core/tabs/utils/auto-mount.sh +++ b/core/tabs/utils/auto-mount.sh @@ -21,7 +21,7 @@ select_drive() { # Function to get UUID and FSTYPE of the selected drive get_uuid_fstype() { - UUID=$(blkid -s UUID -o value "${partition}") + UUID=$("$ESCALATION_TOOL" blkid -s UUID -o value "${partition}") FSTYPE=$(lsblk -no FSTYPE "${partition}") NAME=$(lsblk -no NAME "${partition}") 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 diff --git a/core/tabs/utils/encrypt_decrypt_tool.sh b/core/tabs/utils/encrypt_decrypt_tool.sh index 0db4a49b..46fead9d 100644 --- a/core/tabs/utils/encrypt_decrypt_tool.sh +++ b/core/tabs/utils/encrypt_decrypt_tool.sh @@ -8,7 +8,7 @@ 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" -S --noconfirm --needed openssl ;; apt-get|nala) "$ESCALATION_TOOL" "$PACKAGER" install -y openssl diff --git a/core/tabs/utils/monitor-control/change_orientation.sh b/core/tabs/utils/monitor-control/change_orientation.sh index d636667d..00ac1b95 100755 --- a/core/tabs/utils/monitor-control/change_orientation.sh +++ b/core/tabs/utils/monitor-control/change_orientation.sh @@ -13,7 +13,7 @@ change_orientation() { printf "%b\n" "${YELLOW}=========================================${RC}" printf "%b\n" "${YELLOW} Change Monitor Orientation${RC}" printf "%b\n" "${YELLOW}=========================================${RC}" - printf "%b" "${YELLOW}Choose a monitor to configure: ${RC}" + printf "%b\n" "${YELLOW}Choose a monitor to configure: ${RC}" i=1 for monitor in $monitor_array; do printf "%b\n" "$i. ${GREEN}$monitor${RC}" diff --git a/core/tabs/utils/monitor-control/disable_monitor.sh b/core/tabs/utils/monitor-control/disable_monitor.sh index d2e1385e..649d71a2 100755 --- a/core/tabs/utils/monitor-control/disable_monitor.sh +++ b/core/tabs/utils/monitor-control/disable_monitor.sh @@ -13,7 +13,7 @@ disable_monitor() { printf "%b\n" "${YELLOW}=========================================${RC}" printf "%b\n" "${YELLOW} Disable Monitor${RC}" printf "%b\n" "${YELLOW}=========================================${RC}" - printf "%b" "Choose a monitor to disable: " + printf "%b\n" "Choose a monitor to disable: " i=1 for monitor in $monitor_array; do printf "%b\n" "$i. ${GREEN}$monitor${RC}" diff --git a/core/tabs/utils/monitor-control/enable_monitor.sh b/core/tabs/utils/monitor-control/enable_monitor.sh index b65af405..ec4db8d6 100755 --- a/core/tabs/utils/monitor-control/enable_monitor.sh +++ b/core/tabs/utils/monitor-control/enable_monitor.sh @@ -13,7 +13,7 @@ enable_monitor() { printf "%b\n" "${YELLOW}=========================================${RC}" printf "%b\n" "${YELLOW} Enable Monitor${RC}" printf "%b\n" "${YELLOW}=========================================${RC}" - printf "%b" "${YELLOW}Choose a monitor to enable: ${RC}" + printf "%b\n" "${YELLOW}Choose a monitor to enable: ${RC}" i=1 for monitor in $monitor_array; do diff --git a/core/tabs/utils/monitor-control/extend_displays.sh b/core/tabs/utils/monitor-control/extend_displays.sh index dca8a1b2..ebe729f3 100755 --- a/core/tabs/utils/monitor-control/extend_displays.sh +++ b/core/tabs/utils/monitor-control/extend_displays.sh @@ -1,6 +1,6 @@ #!/bin/sh -e -. ./utility_functions.sh +. ../utility_functions.sh . ../../common-script.sh diff --git a/core/tabs/utils/monitor-control/manage_arrangement.sh b/core/tabs/utils/monitor-control/manage_arrangement.sh index 35642539..5d73b1ff 100755 --- a/core/tabs/utils/monitor-control/manage_arrangement.sh +++ b/core/tabs/utils/monitor-control/manage_arrangement.sh @@ -13,10 +13,10 @@ manage_arrangement() { printf "%b\n" "${YELLOW}=========================================${RC}" printf "%b\n" "${YELLOW} Manage Monitor Arrangement${RC}" printf "%b\n" "${YELLOW}=========================================${RC}" - printf "%b" "${YELLOW}Choose the monitor to arrange: ${RC}" + printf "%b\n" "${YELLOW}Choose the monitor to arrange: ${RC}" i=1 for monitor in $monitor_array; do - printf "%b\n" "$i. ${YELLOW}$monitor${RC}" + printf "%b\n" "$i. ${GREEN}$monitor${RC}" i=$((i + 1)) done 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 diff --git a/core/tabs/utils/monitor-control/set_primary_monitor.sh b/core/tabs/utils/monitor-control/set_primary_monitor.sh index 1eea6ed9..d38e6b0f 100755 --- a/core/tabs/utils/monitor-control/set_primary_monitor.sh +++ b/core/tabs/utils/monitor-control/set_primary_monitor.sh @@ -16,7 +16,7 @@ set_primary_monitor() { printf "%b\n" "${YELLOW}Choose a monitor to set as primary:${RC}" i=1 for monitor in $monitor_array; do - printf "%b\n" "$i. ${YELLOW}$monitor${RC}" + printf "%b\n" "$i. ${GREEN}$monitor${RC}" i=$((i + 1)) done diff --git a/core/tabs/utils/power-profile.sh b/core/tabs/utils/power-profile.sh index 996db704..536f7c69 100644 --- a/core/tabs/utils/power-profile.sh +++ b/core/tabs/utils/power-profile.sh @@ -34,6 +34,7 @@ installAutoCpufreq() { cd auto-cpufreq printf "%b\n" "${YELLOW}Running auto-cpufreq installer...${RC}" "$ESCALATION_TOOL" ./auto-cpufreq-installer + "$ESCALATION_TOOL" auto-cpufreq --install cd .. fi @@ -94,4 +95,4 @@ apply_or_remove_auto_cpufreq() { checkEnv checkEscalationTool installAutoCpufreq -apply_or_remove_auto_cpufreq \ No newline at end of file +apply_or_remove_auto_cpufreq diff --git a/core/tabs/utils/ssh.sh b/core/tabs/utils/ssh.sh index 40bf63dd..7769134c 100644 --- a/core/tabs/utils/ssh.sh +++ b/core/tabs/utils/ssh.sh @@ -4,6 +4,7 @@ # Check if $HOME/.ssh/config exists, if not, create it if [ ! -f "$HOME/.ssh/config" ]; then + mkdir -p "$HOME/.ssh"\ touch "$HOME/.ssh/config" chmod 600 "$HOME/.ssh/config" fi diff --git a/core/tabs/utils/tab_data.toml b/core/tabs/utils/tab_data.toml index 7cfc3ed7..a0f6d50e 100644 --- a/core/tabs/utils/tab_data.toml +++ b/core/tabs/utils/tab_data.toml @@ -1,8 +1,8 @@ name = "Utilities" -multi_selectable = false [[data]] name = "Monitor Control" +multi_select = false [[data.preconditions]] matches = true @@ -16,62 +16,69 @@ values = [":0", ":1", ":2", ":3", ":4", ":5", ":6", ":7", ":8", ":9"] [[data.entries]] name = "Auto Detect Displays" -description = "This utility is designed to detect and apply recommended configuration for monitors connected with your system" +description = "This script is designed to detect and apply recommended configuration for monitors connected with your system" script = "monitor-control/auto_detect_displays.sh" [[data.entries]] name = "Change Orientation" -description = "This utility is designed to change the orientation of monitors in your system" +description = "This script is designed to change the orientation of monitors in your system" script = "monitor-control/change_orientation.sh" [[data.entries]] name = "Disable Monitor" -description = "This utility is designed to disable a monitor in your system" +description = "This script is designed to disable a monitor in your system" script = "monitor-control/disable_monitor.sh" [[data.entries]] name = "Duplicate Displays" -description = "This utility is designed to duplicate display among multi-monitor setup in your system" +description = "This script is designed to duplicate display among multi-monitor setup in your system" script = "monitor-control/duplicate_displays.sh" [[data.entries]] name = "Enable Monitor" -description = "This utility is designed to enable a monitor in your system" +description = "This script is designed to enable a monitor in your system" script = "monitor-control/enable_monitor.sh" [[data.entries]] name = "Extend Displays" -description = "This utility is designed to extend display among multi-monitor setup in your system" +description = "This script is designed to extend display among multi-monitor setup in your system" script = "monitor-control/extend_displays.sh" [[data.entries]] name = "Manage Arrangement" -description = "This utility is designed to arrange monitors in multi-monitor setup in your system" +description = "This script is designed to arrange monitors in multi-monitor setup in your system" script = "monitor-control/manage_arrangement.sh" [[data.entries]] name = "Reset Scaling" -description = "This utility is designed to reset scaling of a monitor in your system" +description = "This script is designed to reset scaling of a monitor in your system" script = "monitor-control/reset_scaling.sh" matches = true [[data.entries]] name = "Scale Monitors" -description = "This utility is designed to change the scaling of monitors in your system" +description = "This script is designed to change the scaling of monitors in your system" script = "monitor-control/scale_monitor.sh" [[data.entries]] name = "Set Brightness" script = "monitor-control/set_brightness.sh" +description = "This script is designed to change the Brightness of monitors connected to your system" matches = true [[data.entries]] name = "Set Primary Monitor" -description = "This utility is designed to set a Primary monitor in your system" +description = "This script is designed to set a Primary monitor in your system" script = "monitor-control/set_primary_monitor.sh" +[[data.entries]] +name = "Set Resolution" +description = "This script is designed to change the resolution of monitors connected to your system" +script = "monitor-control/set_resolutions.sh" + [[data]] name = "User Account Manager" +multi_select = false [[data.entries]] name = "Add User" @@ -98,6 +105,7 @@ name = "Auto Mount Drive" description = "This utility is designed to help with automating the process of mounting a drive on to your system." script = "auto-mount.sh" task_list = "PFM" +multi_select = false [[data]] name = "Auto Login" @@ -114,6 +122,7 @@ name = "Bluetooth Manager" description = "This utility is designed to manage bluetooth in your system" script = "bluetooth-control.sh" task_list = "I SS" +multi_select = false [[data]] name = "Bootable USB Creator" @@ -158,6 +167,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" diff --git a/docs/assets/preview.gif b/docs/assets/preview.gif new file mode 100644 index 00000000..77091ac4 Binary files /dev/null and b/docs/assets/preview.gif differ diff --git a/docs/assets/preview.png b/docs/assets/preview.png deleted file mode 100644 index bb8b7037..00000000 Binary files a/docs/assets/preview.png and /dev/null differ diff --git a/docs/assets/preview.tape b/docs/assets/preview.tape new file mode 100644 index 00000000..66b1c359 --- /dev/null +++ b/docs/assets/preview.tape @@ -0,0 +1,89 @@ +# VHS documentation +# +# Output: +# Output .gif Create a GIF output at the given +# Output .mp4 Create an MP4 output at the given +# Output .webm Create a WebM output at the given +# +# Require: +# Require Ensure a program is on the $PATH to proceed +# +# Settings: +# Set FontSize Set the font size of the terminal +# Set FontFamily Set the font family of the terminal +# Set Height Set the height of the terminal +# Set Width Set the width of the terminal +# Set LetterSpacing Set the font letter spacing (tracking) +# Set LineHeight Set the font line height +# Set LoopOffset % Set the starting frame offset for the GIF loop +# Set Theme Set the theme of the terminal +# Set Padding Set the padding of the terminal +# Set Framerate Set the framerate of the recording +# Set PlaybackSpeed Set the playback speed of the recording +# Set MarginFill Set the file or color the margin will be filled with. +# Set Margin Set the size of the margin. Has no effect if MarginFill isn't set. +# Set BorderRadius Set terminal border radius, in pixels. +# Set WindowBar Set window bar type. (one of: Rings, RingsRight, Colorful, ColorfulRight) +# Set WindowBarSize Set window bar size, in pixels. Default is 40. +# Set TypingSpeed