diff --git a/.github/workflows/build-check.yml b/.github/workflows/build-check.yml index 6a2bd51..1cf1952 100644 --- a/.github/workflows/build-check.yml +++ b/.github/workflows/build-check.yml @@ -11,7 +11,7 @@ env: RUSTUP_MAX_RETRIES: 10 RUST_BACKTRACE: 1 RUSTC_WRAPPER: sccache - CARGO_BUILD_JOBS: ${{ runtime.numCPU }} + CARGO_BUILD_JOBS: 2 jobs: build: @@ -32,15 +32,18 @@ jobs: uses: actions/cache@v3 with: path: | - /var/cache/apt - /var/lib/apt/lists + /var/cache/apt/archives/*.deb + /var/lib/apt/lists/* key: ${{ runner.os }}-apt-${{ hashFiles('**/build-check.yml') }} restore-keys: | ${{ runner.os }}-apt- - name: Install Linux Dependencies - if: steps.cache-apt.outputs.cache-hit != 'true' run: | + sudo rm -rf /var/cache/apt/archives/lock + sudo rm -rf /var/cache/apt/archives/partial + sudo rm -rf /var/lib/apt/lists/lock + sudo rm -rf /var/lib/apt/lists/partial sudo apt-get update sudo apt-get install --no-install-recommends -y \ build-essential \ @@ -58,12 +61,18 @@ jobs: with: components: cargo target: x86_64-unknown-linux-gnu - profile: minimal + + - name: Install sccache + run: | + SCCACHE_VERSION=v0.7.7 + curl -L "https://github.com/mozilla/sccache/releases/download/${SCCACHE_VERSION}/sccache-${SCCACHE_VERSION}-x86_64-unknown-linux-musl.tar.gz" | tar xz + sudo mv sccache-*/sccache /usr/local/bin/sccache + echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV - uses: Swatinem/rust-cache@v2 with: + workspaces: "./src-tauri -> target" shared-key: "build" - save-if: ${{ github.ref == 'refs/heads/main' }} - name: Install Dependencies run: npm ci diff --git a/README.md b/README.md index f7cefd8..051a6a8 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,12 @@ - 💻 CPU and Memory usage tracking - 🎨 Beautiful, modern UI with dark/light themes - 🔍 Process search and filtering + + Search for processes by name, command, or PID. Search for multiple things at once by separating them with commas. For + example, `arm, x86` will return processes having `arm` or `x86` as a substring of the name or command. You can use + regular expressions too. For example, `d$` will return a list of daemons (which tend to end in the letter `d`), while + `(\w+)\.\w+` will return a list of processes with reverse domain name notation, such as `com.docker.vmnetd`. + - 📌 Pin important processes - 🛠 Process management (kill processes) - 🎯 Sort by any column diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 5a8c565..e99026b 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -30,7 +30,7 @@ let columns: Column[] = [ { id: "name", label: "Process Name", visible: true, required: true }, - { id: "pid", label: "PID", visible: true, required: true }, + { id: "pid", label: "PID", visible: true, required: false }, { id: "status", label: "Status", @@ -60,11 +60,22 @@ }; $: filteredProcesses = processes.filter((process) => { - const matchesSearch = searchTerm - ? process.name.toLowerCase().includes(searchTerm.toLowerCase()) || - process.command.toLowerCase().includes(searchTerm.toLowerCase()) || - process.pid.toString().includes(searchTerm) - : true; + let matchesSearch = searchTerm.length === 0; + searchTerm + .split(",") + .map((term) => term.trim()) + .forEach((term) => { + const nameSubstringMatch = process.name + .toLowerCase() + .includes(term.toLowerCase()); + const nameRegexMatch = new RegExp(term, "i").test(process.name); + const commandMatch = process.command + .toLowerCase() + .includes(term.toLowerCase()); + const pidMatch = process.pid.toString().includes(term); + matchesSearch ||= + nameSubstringMatch || nameRegexMatch || commandMatch || pidMatch; + }); const matchesStatus = statusFilter === "all" ? true : process.status === statusFilter;