Cached recursive folder-size columns for GNOME Files / Nautilus.
GNOME Files shows folder item counts in its built-in Size column, so folders show values like 8 items instead of their real disk footprint. This project adds a Nautilus list-view column:
Total Size: human-readable recursive size, such as762.2 MiB
The expensive size scan does not run inside Nautilus. A small helper keeps a JSON cache under ~/.cache/nautilus-folder-sizes/, and the Nautilus extension only reads that cache and queues refreshes.
Live recursive folder-size calculation inside a file manager can make the UI feel sticky, especially in development folders, downloads, model directories, and repositories with many small files.
This design keeps Nautilus boring:
- Nautilus asks the extension for column text.
- The extension reads a small cache file.
- Missing or stale folders are queued.
- A separate helper runs
duoutside Nautilus and updates the cache. - Nautilus refreshes the row when the cached value is ready.
- GNOME Files / Nautilus with the Nautilus extension API
python3-nautilus- Python 3
- GNU
du - systemd user services for the optional timer
On Ubuntu/Debian:
sudo apt install python3-nautilusgit clone https://github.com/feveromo/nautilus-folder-size-cache.git
cd nautilus-folder-size-cache
./install.shThen reopen GNOME Files. The installer adds Total Size to your existing default Nautilus columns when possible and saves the previous column settings for uninstall. In list view, enable or drag the column as needed:
Total Size
Steady state is intentionally light:
- Nautilus reads a small JSON cache.
- No recursive folder walk runs inside Nautilus.
- The helper runs briefly when a folder is missing/stale or when the timer fires.
- Cached folder values older than about 30 minutes are shown immediately, marked
stale, and refreshed in the background. - If
ducan return a size but also reports an error, the value is kept and markedpartial. - The default timer refreshes your home folder plus common work/download roots every 30 minutes at lower CPU/I/O priority.
For most desktop use, the periodic job should be short. Very large trees can still take time to scan, but that work happens outside Nautilus.
Warm the cache for your home folder and its immediate children:
nautilus-folder-size-cache warm ~Update specific paths immediately:
nautilus-folder-size-cache update ~/Downloads ~/ProjectsQueue paths for background refresh:
nautilus-folder-size-cache enqueue ~/DownloadsShow cache and queue status:
nautilus-folder-size-cache statusThe default user service runs:
nautilus-folder-size-cache warm %h %h/Dev %h/Projects %h/DownloadsTo add more roots, create a systemd user override:
systemctl --user edit nautilus-folder-size-cache.serviceExample override:
[Service]
ExecStart=
ExecStart=%h/.local/bin/nautilus-folder-size-cache warm %h %h/Projects %h/DownloadsThen reload and restart:
systemctl --user daemon-reload
systemctl --user restart nautilus-folder-size-cache.service./uninstall.shThe uninstall script restores saved Nautilus column settings when available. If no saved settings are found, it removes only total_size from the current column lists.
It leaves ~/.cache/nautilus-folder-sizes/ in place. Remove it manually if you also want to delete cached size data:
rm -rf ~/.cache/nautilus-folder-sizesTotal Sizeuses an invisible Unicode tag prefix as a sort key, so Nautilus can sort the readable sizes by their real byte values.- Copying a
Total Sizecell may include those invisible prefix characters. - Symlinked folders are treated as symlinks, not followed as folder trees.
- This is a small local-desktop helper, not an official GNOME project.