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/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/workflows/bashisms.yml b/.github/workflows/bashisms.yml index 7226bb5c..7ce39ef1 100644 --- a/.github/workflows/bashisms.yml +++ b/.github/workflows/bashisms.yml @@ -19,17 +19,27 @@ jobs: 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" + if [ -n "$sh_files" ]; then + echo "$sh_files" > changed_files + echo "changed=1" >> $GITHUB_OUTPUT + else + echo "changed=0" >> $GITHUB_OUTPUT + fi - name: Install devscripts - if: steps.get_sh_files.outputs.sh_files != '' + if: steps.get_sh_files.outputs.changed == 1 run: sudo apt-get update && sudo apt-get install devscripts - name: Check for bashisms - if: steps.get_sh_files.outputs.sh_files != '' + if: steps.get_sh_files.outputs.changed == 1 run: | - for file in ${{ steps.get_sh_files.outputs.sh_files }}; do - if [[ -f "$file" ]]; then - checkbashisms "$file" - fi + echo "Running for:\n$(cat changed_files)\n" + for file in $(cat changed_files); do + if [[ -f "$file" ]]; then + checkbashisms "$file" + fi done + + - name: Remove the created file + if: steps.get_sh_files.outputs.changed == 1 + run: rm changed_files diff --git a/.github/workflows/github-pages.yml b/.github/workflows/github-pages.yml index 0bd2d476..b76b092d 100644 --- a/.github/workflows/github-pages.yml +++ b/.github/workflows/github-pages.yml @@ -20,6 +20,17 @@ jobs: with: fetch-depth: '0' # Fetch all commit history for all branches as well as tags. + - name: Copy Contributing Guidelines + run: | + echo "\n\n$(cat .github/CONTRIBUTING.md)" > 'docs/contributing.md' + + - uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: Commit Contributing Guidelines + file_pattern: "docs/contributing.md" + add_options: '--force' + if: success() + - name: Setup Python uses: actions/setup-python@v5 with: diff --git a/.github/workflows/linutil.yml b/.github/workflows/linutil.yml index f57e8a74..53c43d02 100644 --- a/.github/workflows/linutil.yml +++ b/.github/workflows/linutil.yml @@ -88,3 +88,24 @@ jobs: env: version: ${{ env.version }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Setup Preview + run: | + echo "$(pwd)/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: Upload preview + uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: Preview for ${{ env.version }} + file_pattern: "docs/assets/preview.gif" + add_options: "--force" + if: success() \ No newline at end of file diff --git a/.github/workflows/shellcheck.yml b/.github/workflows/shellcheck.yml index e91ad941..6b1ad429 100644 --- a/.github/workflows/shellcheck.yml +++ b/.github/workflows/shellcheck.yml @@ -14,17 +14,42 @@ jobs: - uses: actions/checkout@v4 - run: git fetch origin ${{ github.base_ref }} - - name: Download and set up shellcheck + - name: Download, setup, and run ShellCheck + shell: bash {0} 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 + SC_URL="https://github.com/koalaman/shellcheck/releases/download/v0.10.0/shellcheck-v0.10.0.linux.x86_64.tar.xz" + curl -fsSL "$SC_URL" | tar -Jx + chmod +x "./shellcheck-v0.10.0/shellcheck" - - name: Run shellcheck - run: | - for file in $(git diff --name-only origin/${{ github.base_ref }} HEAD core/tabs); do + error=0 + files_to_check=$(git diff --name-only origin/${{ github.base_ref }} HEAD core/tabs) + + for file in $files_to_check; do if [[ "$file" == *.sh ]] && [[ -f "$file" ]]; then - ./shellcheck-v0.10.0/shellcheck -S error "$file" + sc_output=$(./shellcheck-v0.10.0/shellcheck -fgcc -Serror "$file") + iter_safe_parsed_errors=$(echo -e "$sc_output" | sed -n 's/\(.\+\)\:\([0-9]\+\)\:\([0-9]\+\)\: \(.*\)/::error file=\1,line=\2,col=\3::\4/p' | sed 's/ /:space:/g') + + for error in $iter_safe_parsed_errors; do + echo "$error" | sed 's/:space:/ /g' + error=1 + done + + tabs_detected=$(grep -nP '^\t+\S+' "$file") + + # fast fail on the action runner would fail immediately if there weren't any tabs found + # this check makes sure that we don't continue if there's something really weird going on + if [ "$?" = "2" ]; then + echo "::error file=$file::There was a critical error while grepping $file, aborting" + exit 1 + fi + + iter_safe_parsed_tabs_detected=$(echo "$tabs_detected" | sed -n 's,\([0-9]\+\).*,::error file='"$file"'\,line=\1::Found tab indentations,p' | sed 's/ /:space:/g') + + for error in $iter_safe_parsed_tabs_detected; do + echo "$error" | sed 's/:space:/ /g' + error=1 + done fi done + + exit $error diff --git a/.github/workflows/typos.yml b/.github/workflows/typos.yml new file mode 100644 index 00000000..901d5e71 --- /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.25.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/Cargo.lock b/Cargo.lock index c33834f6..266ed837 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -165,9 +165,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", ] @@ -194,9 +194,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.18" +version = "4.5.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0956a43b323ac1afaffc053ed5c4b7c1f1800bacd1683c353aabbb752515dd3" +checksum = "7be5744db7978a28d9df86a214130d106a89ce49644cbc4e3f0c22c3fba30615" dependencies = [ "clap_builder", "clap_derive", @@ -204,9 +204,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.18" +version = "4.5.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d72166dd41634086d5803a47eb71ae740e61d84709c36f3c34110173db3961b" +checksum = "a5fbc17d3ef8278f55b282b2a2e75ae6f6c7d4bb70ed3d0382375104bfafdb4b" dependencies = [ "anstream", "anstyle", @@ -328,12 +328,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" @@ -496,7 +490,7 @@ dependencies = [ "ego-tree", "include_dir", "serde", - "tempdir", + "temp-dir", "toml", "which", ] @@ -514,8 +508,9 @@ dependencies = [ "linutil_core", "oneshot", "portable-pty", - "rand 0.8.5", + "rand", "ratatui", + "temp-dir", "tree-sitter-bash", "tree-sitter-highlight", "tui-term", @@ -716,19 +711,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 +719,7 @@ checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", "rand_chacha", - "rand_core 0.6.4", + "rand_core", ] [[package]] @@ -747,24 +729,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" @@ -795,15 +762,6 @@ dependencies = [ "unicode-width 0.1.14", ] -[[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", -] - [[package]] name = "redox_syscall" version = "0.5.4" @@ -842,15 +800,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 +972,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 +1018,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 +1034,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 +1088,14 @@ dependencies = [ [[package]] name = "tree-sitter" -version = "0.23.0" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20f4cd3642c47a85052a887d86704f4eac272969f61b686bdd3f772122aabaff" +checksum = "23b84f60031bf8245b563a80c92c1034e557a914f7958f474bc0afa2eed78b98" dependencies = [ "cc", "regex", "regex-syntax", + "streaming-iterator", "tree-sitter-language", ] @@ -1159,12 +1111,13 @@ dependencies = [ [[package]] name = "tree-sitter-highlight" -version = "0.23.0" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "395d7a477a4504fd7d5e4d003e0dd41bd5b9c4985d53592a943a8354ec452dae" +checksum = "5c727fb31f816c09fc54dc0e971d101318926866f7261b2acb820e84a61bf52d" dependencies = [ "lazy_static", "regex", + "streaming-iterator", "thiserror", "tree-sitter", ] @@ -1235,8 +1188,7 @@ 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", @@ -1466,6 +1418,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 27257d9c..ef31b2a9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,14 +1,19 @@ [workspace.package] license = "MIT" 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 6cd4356b..a2274dfa 100644 --- a/core/src/inner.rs +++ b/core/src/inner.rs @@ -10,24 +10,29 @@ use crate::{Command, ListNode, Tab}; use ego_tree::{NodeMut, Tree}; use include_dir::{include_dir, Dir}; use serde::Deserialize; -use tempdir::TempDir; +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 + .into_iter() .map( |( TabEntry { @@ -57,7 +62,7 @@ pub fn get_tabs(validate: bool) -> Vec { if tabs.is_empty() { panic!("No tabs found"); } - tabs + (temp_dir, tabs) } #[derive(Deserialize)] @@ -248,19 +253,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/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/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/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/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/server-setup.sh b/core/tabs/system-setup/arch/server-setup.sh index 4ae0afd6..3a385df5 100755 --- a/core/tabs/system-setup/arch/server-setup.sh +++ b/core/tabs/system-setup/arch/server-setup.sh @@ -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*** ------------------------------------------------------------------------ @@ -328,7 +328,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 @@ -466,7 +466,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") @@ -493,8 +493,8 @@ nc=$(grep -c ^processor /proc/cpuinfo) echo -ne " ------------------------------------------------------------------------- You have " $nc" cores. And - changing the makeflags for " $nc" cores. Aswell as - changing the compression settings. + changing the makeflags for " $nc" cores. Aswell as + changing the compression settings. ------------------------------------------------------------------------- " TOTAL_MEM=$(cat /proc/meminfo | grep -i 'memtotal' | grep -o '[[:digit:]]*') @@ -670,4 +670,4 @@ sed -i 's/^%wheel ALL=(ALL:ALL) NOPASSWD: ALL/# %wheel ALL=(ALL:ALL) NOPASSWD: A # Add sudo rights sed -i 's/^# %wheel ALL=(ALL) ALL/%wheel ALL=(ALL) ALL/' /etc/sudoers sed -i 's/^# %wheel ALL=(ALL:ALL) ALL/%wheel ALL=(ALL:ALL) ALL/' /etc/sudoers -EOF \ No newline at end of file +EOF diff --git a/core/tabs/system-setup/compile-setup.sh b/core/tabs/system-setup/compile-setup.sh index 6345fc97..74a96a41 100755 --- a/core/tabs/system-setup/compile-setup.sh +++ b/core/tabs/system-setup/compile-setup.sh @@ -15,30 +15,30 @@ installDepend() { else printf "%b\n" "${GREEN}Multilib is already enabled.${RC}" fi - "$AUR_HELPER" -S --needed --noconfirm "$DEPENDENCIES" + "$AUR_HELPER" -S --needed --noconfirm $DEPENDENCIES ;; apt-get|nala) COMPILEDEPS='build-essential' "$ESCALATION_TOOL" "$PACKAGER" update "$ESCALATION_TOOL" dpkg --add-architecture i386 "$ESCALATION_TOOL" "$PACKAGER" update - "$ESCALATION_TOOL" "$PACKAGER" install -y "$DEPENDENCIES" "$COMPILEDEPS" + "$ESCALATION_TOOL" "$PACKAGER" install -y $DEPENDENCIES $COMPILEDEPS ;; dnf) COMPILEDEPS='@development-tools' "$ESCALATION_TOOL" "$PACKAGER" update "$ESCALATION_TOOL" "$PACKAGER" config-manager --set-enabled powertools - "$ESCALATION_TOOL" "$PACKAGER" install -y "$DEPENDENCIES" $COMPILEDEPS + "$ESCALATION_TOOL" "$PACKAGER" install -y $DEPENDENCIES $COMPILEDEPS "$ESCALATION_TOOL" "$PACKAGER" install -y glibc-devel.i686 libgcc.i686 ;; zypper) COMPILEDEPS='patterns-devel-base-devel_basis' "$ESCALATION_TOOL" "$PACKAGER" refresh - "$ESCALATION_TOOL" "$PACKAGER" --non-interactive install "$DEPENDENCIES" "$COMPILEDEPS" + "$ESCALATION_TOOL" "$PACKAGER" --non-interactive install $DEPENDENCIES $COMPILEDEPS "$ESCALATION_TOOL" "$PACKAGER" --non-interactive install libgcc_s1-gcc7-32bit glibc-devel-32bit ;; *) - "$ESCALATION_TOOL" "$PACKAGER" install -y "$DEPENDENCIES" + "$ESCALATION_TOOL" "$PACKAGER" install -y $DEPENDENCIES ;; esac } diff --git a/core/tabs/system-setup/fedora/configure-dnf.sh b/core/tabs/system-setup/fedora/configure-dnf.sh index b51c8b4c..977ea6d4 100644 --- a/core/tabs/system-setup/fedora/configure-dnf.sh +++ b/core/tabs/system-setup/fedora/configure-dnf.sh @@ -10,7 +10,7 @@ configureDNF() { echo "fastestmirror=True" | "$ESCALATION_TOOL" tee -a /etc/dnf/dnf.conf > /dev/null echo "defaultyes=True" | "$ESCALATION_TOOL" tee -a /etc/dnf/dnf.conf > /dev/null "$ESCALATION_TOOL" "$PACKAGER" -y install dnf-plugins-core - printf "%b\n" "${GREEN}DNF Configured Succesfully...${RC}" + printf "%b\n" "${GREEN}DNF Configured Successfully.${RC}" ;; *) printf "%b\n" "${RED}Unsupported distribution: $DTYPE${RC}" 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..92c666c7 100755 --- a/core/tabs/system-setup/gaming-setup.sh +++ b/core/tabs/system-setup/gaming-setup.sh @@ -23,7 +23,7 @@ installDepend() { 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" - $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" @@ -33,24 +33,24 @@ installDepend() { "$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 "$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 | 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 index 198a9d68..0a625913 100644 --- a/core/tabs/system-setup/system-cleanup.sh +++ b/core/tabs/system-setup/system-cleanup.sh @@ -23,7 +23,7 @@ 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}" diff --git a/core/tabs/utils/tab_data.toml b/core/tabs/utils/tab_data.toml index 7cfc3ed7..ba7c0e1b 100644 --- a/core/tabs/utils/tab_data.toml +++ b/core/tabs/utils/tab_data.toml @@ -16,60 +16,66 @@ 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" diff --git a/docs/assets/preview.gif b/docs/assets/preview.gif new file mode 100644 index 00000000..c8e49da1 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