A treemap for finding and removing what fills your disk, for Omarchy. Rust + GPUI.
Rust
0.9.0: screenshot, CI, and release builds
Tobi Lutke92f4031216b2
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.ymlnew file mode 100644index 0000000..da05ecf--- /dev/null+++ b/.github/workflows/ci.yml@@ -0,0 +1,45 @@+name: CI++on:+ push:+ branches: [main]+ pull_request:++concurrency:+ group: ci-${{ github.ref }}+ cancel-in-progress: true++env:+ CARGO_TERM_COLOR: always++jobs:+ check:+ name: Lint and test+ runs-on: ubuntu-24.04+ steps:+ - uses: actions/checkout@v4++ # What GPUI links against: windowing (Wayland, X11), input, fonts,+ # and the Vulkan loader.+ - name: System libraries+ run: |+ sudo apt-get update+ sudo apt-get install -y --no-install-recommends \+ pkg-config libxkbcommon-dev libxkbcommon-x11-dev libwayland-dev \+ libx11-xcb-dev libxcb1-dev libfontconfig-dev libfreetype-dev \+ libvulkan-dev libasound2-dev libssl-dev libzstd-dev++ # Pinned: the lint gate denies clippy::all and ::pedantic, and a newer+ # clippy's new lints are a change to make on purpose, not by surprise.+ - uses: dtolnay/rust-toolchain@master+ with:+ toolchain: "1.97"+ components: clippy, rustfmt++ - uses: Swatinem/rust-cache@v2++ - name: Lint+ run: cargo xtask lint++ - name: Test+ run: cargo xtask testdiff --git a/.github/workflows/release.yml b/.github/workflows/release.ymlnew file mode 100644index 0000000..d27afbd--- /dev/null+++ b/.github/workflows/release.yml@@ -0,0 +1,88 @@+name: Release++# Push a tag like v0.9.0 to build and publish a release. The tag must match+# the workspace version in Cargo.toml.+on:+ push:+ tags: ["v*"]+ workflow_dispatch:+ inputs:+ tag:+ description: "Existing tag to (re)build, e.g. v0.9.0"+ required: true++permissions:+ contents: write++env:+ CARGO_TERM_COLOR: always++jobs:+ release:+ name: Build and publish+ # The oldest supported runner: its glibc is what the binary needs at+ # least, so building here runs on the most systems.+ runs-on: ubuntu-22.04+ steps:+ - uses: actions/checkout@v4+ with:+ ref: ${{ inputs.tag || github.ref }}++ - name: Version+ id: version+ run: |+ tag="${{ inputs.tag || github.ref_name }}"+ version=$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -1)+ if [ "$tag" != "v$version" ]; then+ echo "tag $tag does not match Cargo.toml version $version" >&2+ exit 1+ fi+ echo "tag=$tag" >> "$GITHUB_OUTPUT"+ echo "version=$version" >> "$GITHUB_OUTPUT"++ - name: System libraries+ run: |+ sudo apt-get update+ sudo apt-get install -y --no-install-recommends \+ pkg-config libxkbcommon-dev libxkbcommon-x11-dev libwayland-dev \+ libx11-xcb-dev libxcb1-dev libfontconfig-dev libfreetype-dev \+ libvulkan-dev libasound2-dev libssl-dev libzstd-dev++ - uses: dtolnay/rust-toolchain@master+ with:+ toolchain: "1.97"++ - uses: Swatinem/rust-cache@v2++ - name: Test+ run: cargo xtask test++ - name: Build+ run: cargo build --release --locked -p disktree-app++ - name: Package+ id: package+ run: |+ name="disktree-${{ steps.version.outputs.version }}-x86_64-linux"+ mkdir -p "dist/$name"+ cp target/release/disktree "dist/$name/"+ strip "dist/$name/disktree"+ cp packaging/install.sh packaging/disktree.desktop.in \+ assets/disktree.svg README.md LICENSE "dist/$name/"+ echo "${{ steps.version.outputs.version }}" > "dist/$name/VERSION"+ tar -C dist -czf "dist/$name.tar.gz" "$name"+ (cd dist && sha256sum "$name.tar.gz" > "$name.tar.gz.sha256")+ echo "archive=dist/$name.tar.gz" >> "$GITHUB_OUTPUT"++ - name: Publish+ env:+ GH_TOKEN: ${{ github.token }}+ TAG: ${{ steps.version.outputs.tag }}+ ARCHIVE: ${{ steps.package.outputs.archive }}+ run: |+ if gh release view "$TAG" >/dev/null 2>&1; then+ gh release upload "$TAG" "$ARCHIVE" "$ARCHIVE.sha256" --clobber+ else+ gh release create "$TAG" "$ARCHIVE" "$ARCHIVE.sha256" \+ --title "disktree ${TAG#v}" --generate-notes+ fidiff --git a/Cargo.lock b/Cargo.lockindex c5d3d3b..fdd84c2 100644--- a/Cargo.lock+++ b/Cargo.lock@@ -1420,7 +1420,7 @@ dependencies = [[[package]]name = "disktree-app"-version = "0.1.0"+version = "0.9.0"dependencies = ["anyhow","disktree-core",@@ -1432,7 +1432,7 @@ dependencies = [[[package]]name = "disktree-core"-version = "0.1.0"+version = "0.9.0"dependencies = ["chrono","rayon",@@ -8617,7 +8617,7 @@ checksum = "ec7a2a501ed189703dba8b08142f057e887dfc4b2cc4db2d343ac6376ba3e0b9"[[package]]name = "xtask"-version = "0.1.0"+version = "0.9.0"[[package]]name = "y4m"diff --git a/Cargo.toml b/Cargo.tomlindex 69ad336..0f25f4d 100644--- a/Cargo.toml+++ b/Cargo.toml@@ -3,7 +3,7 @@ resolver = "3"members = ["crates/disktree-app", "crates/disktree-core", "xtask"][workspace.package]-version = "0.1.0"+version = "0.9.0"edition = "2024"rust-version = "1.97"license = "MIT"diff --git a/README.md b/README.mdindex 9803941..ba514ff 100644--- a/README.md+++ b/README.md@@ -1,5 +1,7 @@# disktree++Find what is filling a disk, mark what should go, and remove it — with thevolume's free space in view the whole time.@@ -13,10 +15,13 @@ Built with [GPUI](https://gpui-kit.com/) through[gpui-omarchy](https://github.com/huacnlee/gpui-omarchy), so it follows yourOmarchy theme and behaves like the rest of the desktop.-<!-- screenshot: assets/screenshot.png -->-## Install+Download `disktree-*-x86_64-linux.tar.gz` from the+[latest release](https://github.com/tobi/disktree/releases/latest), unpack+it, and run `./install.sh` inside (or just copy `disktree` onto your+`PATH`). Or build it:+```shgit clone https://github.com/tobi/disktreecd disktreediff --git a/assets/screenshot.png b/assets/screenshot.pngnew file mode 100644index 0000000..472a214Binary files /dev/null and b/assets/screenshot.png differdiff --git a/packaging/disktree.desktop.in b/packaging/disktree.desktop.inindex da65997..4f9cfb7 100644--- a/packaging/disktree.desktop.in+++ b/packaging/disktree.desktop.in@@ -4,7 +4,7 @@ Version=1.0Name=disktreeGenericName=Disk space treemapComment=Find what is using a volume, mark what should go, remove it-Exec=@BINDIR@/disktree %U+Exec=@BINDIR@/disktree %fIcon=disktreeTerminal=falseCategories=System;Filesystem;diff --git a/packaging/install.sh b/packaging/install.shnew file mode 100755index 0000000..25d8464--- /dev/null+++ b/packaging/install.sh@@ -0,0 +1,35 @@+#!/bin/sh+# Install a disktree release: the binary, a desktop entry and an icon.+#+# ./install.sh # into ~/.local, no root needed+# sudo PREFIX=/usr/local ./install.sh+#+# The same three files `make install` puts in place, for a machine without a+# Rust toolchain.+set -eu++here=$(cd "$(dirname "$0")" && pwd)+PREFIX=${PREFIX:-"$HOME/.local"}+BINDIR=${BINDIR:-"$PREFIX/bin"}+APPDIR=${APPDIR:-"$PREFIX/share/applications"}+ICONDIR=${ICONDIR:-"$PREFIX/share/icons/hicolor/scalable/apps"}+VERSION=$(cat "$here/VERSION")++install -d "$BINDIR" "$APPDIR" "$ICONDIR"+install -m755 "$here/disktree" "$BINDIR/disktree"+install -m644 "$here/disktree.svg" "$ICONDIR/disktree.svg"+sed -e "s|@BINDIR@|$BINDIR|" -e "s|@VERSION@|$VERSION|" \+ "$here/disktree.desktop.in" > "$APPDIR/disktree.desktop"+chmod 644 "$APPDIR/disktree.desktop"+if command -v update-desktop-database >/dev/null 2>&1; then+ update-desktop-database "$APPDIR" 2>/dev/null || true+fi++echo "installed disktree $VERSION:"+echo " $BINDIR/disktree"+echo " $APPDIR/disktree.desktop"+echo " $ICONDIR/disktree.svg"+case ":$PATH:" in+ *":$BINDIR:"*) ;;+ *) echo; echo "note: $BINDIR is not on PATH in this shell" ;;+esac