diff --git a/applications/Disk Usage.desktop b/applications/Disk Usage.desktop deleted file mode 100644 index 1de40546..00000000 --- a/applications/Disk Usage.desktop +++ /dev/null @@ -1,8 +0,0 @@ -[Desktop Entry] -Version=1.0 -Name=Disk Usage -Exec=xdg-terminal-exec --app-id=TUI.float -e bash -c "dua i /" -Terminal=false -Type=Application -Icon=disk-usage -StartupNotify=true diff --git a/install/omarchy-base.packages b/install/omarchy-base.packages index bc1fdf09..1981d883 100644 --- a/install/omarchy-base.packages +++ b/install/omarchy-base.packages @@ -21,12 +21,12 @@ cups cups-filters cups-pk-helper ddcutil +disktree-bin docker docker-buildx docker-compose dosfstools dotnet-runtime -dua-cli evince exfatprogs expac diff --git a/manual/21-tuis.md b/manual/21-tuis.md index c8e88646..4d91769f 100644 --- a/manual/21-tuis.md +++ b/manual/21-tuis.md @@ -26,10 +26,6 @@ You start it (or reattach to your existing session) with `Super + Ctrl + Return` Omarchy has packaged this as _About_ in the Omarchy menu (`Super + Space`). -## Disk Usage - -When the drive fills up and you have no idea what's eating it, launch _Disk Usage_ from the app launcher (`Super + Space`). It's [dua](https://github.com/Byron/dua-cli) in interactive mode pointed at the whole file system, so you can walk down into whatever directory is the culprit, sorted biggest first, and delete from right inside it. - ## Cliamp [Cliamp](https://www.cliamp.stream/) is a retro terminal music player inspired by Winamp 2.x, complete with built-in radio stations for lo-fi beats. Launch it with `Super + Shift + Alt + M`, or from the Omarchy menu under _Apps_. Press `?` for the full keybinding list. diff --git a/manual/22-guis.md b/manual/22-guis.md index 56bc701c..2726967d 100644 --- a/manual/22-guis.md +++ b/manual/22-guis.md @@ -8,6 +8,10 @@ Plug in a USB stick or an SD card and it's mounted automatically, so it just sho Double-clicking follows sensible defaults: images open in imv, video in mpv, PDFs in Document Viewer, and plain text in Neovim. +## Disktree + +When the drive fills up and you have no idea what's eating it, launch [Disktree](https://github.com/tobi/disktree) from the app launcher (`Super + Space`). It shows a graphical treemap of your home directory. Larger blocks take up more space; walk into directories with the keyboard or mouse, mark what should go, and review your selections before removing anything. Run `disktree --disk` to scan the whole disk. + ## Obsidian [Obsidian](https://obsidian.md/) is a free and highly extensible note taking application that uses simple Markdown files for storage. diff --git a/migrations/1791345484.sh b/migrations/1791345484.sh new file mode 100644 index 00000000..89b0d782 --- /dev/null +++ b/migrations/1791345484.sh @@ -0,0 +1,9 @@ +echo "Replace the Disk Usage TUI with Disktree" + +omarchy-pkg-add disktree-bin +omarchy-pkg-drop dua-cli + +rm -f "$HOME/.local/share/applications/Disk Usage.desktop" +if [[ -d $HOME/.local/share/applications ]]; then + update-desktop-database "$HOME/.local/share/applications" +fi diff --git a/test/shell.d/disktree-migration-test.sh b/test/shell.d/disktree-migration-test.sh new file mode 100644 index 00000000..3c898127 --- /dev/null +++ b/test/shell.d/disktree-migration-test.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +set -euo pipefail + +source "$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)/base-test.sh" + +test_tmp=$(mktemp -d) +trap 'rm -rf "$test_tmp"' EXIT +mkdir -p "$test_tmp/bin" "$test_tmp/home/.local/share/applications" + +for helper in omarchy-pkg-add omarchy-pkg-drop update-desktop-database; do + cat > "$test_tmp/bin/$helper" <<'SH' +#!/bin/bash +printf '%s %s\n' "${0##*/}" "$*" >> "$TEST_LOG" +SH + chmod +x "$test_tmp/bin/$helper" +done + +launcher="$test_tmp/home/.local/share/applications/Disk Usage.desktop" +printf '[Desktop Entry]\nExec=dua i /\n' > "$launcher" + +for (( attempt = 0; attempt < 2; attempt++ )); do + env HOME="$test_tmp/home" OMARCHY_PATH="$ROOT" TEST_LOG="$test_tmp/log" PATH="$test_tmp/bin:$PATH" \ + bash -euo pipefail "$ROOT/migrations/1791345484.sh" + [[ ! -e $launcher ]] || fail "the migration removes the old Disk Usage launcher" +done +pass "the Disktree migration removes the old launcher and can run twice" + +expected="omarchy-pkg-add disktree-bin +omarchy-pkg-drop dua-cli +update-desktop-database $test_tmp/home/.local/share/applications" +[[ $(cat "$test_tmp/log") == "$expected"$'\n'"$expected" ]] || fail "the migration installs Disktree before removing dua and refreshing launchers" +pass "the migration installs Disktree before removing dua and refreshing launchers" + +rm -r "$test_tmp/home/.local/share/applications" +env HOME="$test_tmp/home" OMARCHY_PATH="$ROOT" TEST_LOG="$test_tmp/log" PATH="$test_tmp/bin:$PATH" \ + bash -euo pipefail "$ROOT/migrations/1791345484.sh" +[[ ! -d $test_tmp/home/.local/share/applications ]] || fail "the migration relies on the packaged Disktree launcher" +pass "the migration relies on the packaged Disktree launcher when no local launchers exist"