# Storage Lens

A native, dark desktop dashboard for SSDs, HDDs, NVMe drives and memory cards.
Includes a **Storage** button inside GNOME's top-right Quick Settings menu.

## Install or distribute

Use the matching single-file `.run` installer from `dist/`. It embeds the complete
application and obtains missing OS libraries from your distribution’s repositories.
The app is installed for your regular user; sudo is used only for OS packages.
For example, on Ubuntu 24.04 LTS:

```sh
sh storage-lens-1.1.0-ubuntu.run
```

Use `--check` to inspect compatibility, `--no-deps` for an offline install with
preinstalled libraries, or `--extract=DIR` to extract the complete app.
Do not run the installer itself as root. Shared OS libraries are retained on
uninstall. The distribution ID is checked so the wrong package cannot silently
use a different package manager.

The generic `dist/storage-lens-1.1.2.pyz` is also available for systems whose
libraries are already installed.
On a compatible system:

```sh
chmod +x storage-lens-1.1.2.pyz
./storage-lens-1.1.2.pyz --install
```

Open **Storage Lens** from Applications, or run `~/.local/bin/storage-lens`.
GNOME discovers newly installed extensions at login: **sign out and sign in once**
to make the Storage button appear next to Wi-Fi, Bluetooth, etc. No reboot needed.
The installer adds only its own extension to your existing enabled list.

Requirements: Linux, Python 3.10+, PyGObject with Cairo, GTK 4.10+, libadwaita 1.5+,
util-linux (`lsblk`), and UDisks 2 for health data. These are already present on
this Fedora 44 Workstation. No pip, npm, or web server is required. Once the OS libraries are installed,
the app runs without a network connection.
GNOME 45–51 is targeted for the menu button; verified against GNOME 46, 48 and 50.
On a minimal Fedora install the packages are `python3 python3-gobject
python3-cairo gtk4 libadwaita util-linux udisks2`. Other desktops can run the
dashboard with these libraries, but the menu integration is GNOME-specific. Other desktops receive a standard
Applications-menu launcher; the installer does not alter their panel layouts.
The package contains all application code, styling, icon and extension; platform
libraries are supplied by the OS rather than bundling another desktop runtime.

## Live readings

- Read/write speeds and disk busy time: kernel counters sampled **every second**;
  60-second rolling graph. Throughput uses the real elapsed interval and 512-byte
  diskstats sectors, regardless of the device's logical sector size.
- Capacity, mounted filesystem usage, new/removed drives: **every 10 seconds**.
- SMART temperature, current health, power-on hours and available NVMe counters:
  **every 30 seconds**, using UDisks. The actual SMART timestamp is displayed.
  An unavailable refresh retains the last reported values and labels them.
- Pause freezes the view; resume starts a fresh I/O interval. Ctrl+R refreshes
  space and SMART immediately. Ctrl+Q closes the app.

Only supported metrics are shown. A dash means unavailable, never zero health.
Memory cards and some USB bridges cannot provide SMART. Endurance is a vendor
estimate, distinct from free disk space. Historical error-log counts alone are
not treated as a current drive failure. HDD refreshes use UDisks' `nowakeup`
option so sleeping drives are not spun up solely for a SMART check.

Space uses decimal GB/TB. Available bytes come from `statvfs.f_bavail` (usable by
the logged-in user); used and reserved bytes are separate. Mounts/subvolumes of
the same filesystem are counted once. Unmounted partitions and swap are never
counted as available. A filesystem spanning drives has shared usage; its space
is counted once in the overall summary. Virtual loop and RAM disks are excluded.
Physical capacity includes connected unmounted media.

“Copy storage report” copies a JSON snapshot, including device identity, to the
clipboard. Nothing is sent over the network. `storage-lens --json` prints a live
snapshot without a window. All drive access is read-only. The app does not mount,
format, erase, repair or start drive tests. There is no root helper and no daemon;
polling stops when the window closes.

## Remove

```sh
~/.local/bin/storage-lens --uninstall
```

Installation lives in `~/.local/share/storage-lens`, with a launcher in
`~/.local/bin`, a desktop entry/icon, and extension `storage-lens@local` in the
user's GNOME extensions directory. `XDG_DATA_HOME` is respected.

## Build and verify

```sh
/usr/bin/python3 -m pytest -q
/usr/bin/python3 build.py
./dist/storage-lens-1.1.2.pyz --json
```

`/usr/bin/python3 tests/check_extension.py` checks the real extension in a separate,
disposable headless GNOME session, including button launch and disable/re-enable.
It does not restart the user's desktop. The backend and packaging tests cover filesystem
accounting, missing readings, SMART interpretation and kernel I/O counters.

`dist/SHA256SUMS` contains checksums. The separate extension ZIP is provided for
manual installation; the single-file installer already embeds it.

API references: [GNOME Quick Settings](https://gjs.guide/extensions/topics/quick-settings.html),
[UDisks NVMe SMART](https://storaged.org/doc/udisks2-api/latest/gdbus-org.freedesktop.UDisks2.NVMe.Controller.html),
[UDisks ATA SMART](https://storaged.org/doc/udisks2-api/latest/gdbus-org.freedesktop.UDisks2.Drive.Ata.html).

## Distribution validation

The release has separate installers for Fedora, Ubuntu, Debian, Kali, Linux Mint,
Arch and openSUSE Leap. Exact tested releases and evidence are recorded in
`validation/`; do not infer verification of an unlisted release or CPU architecture.
The present VM matrix uses x86-64. Each VM is run and deleted before the next is
created. `vm-work/` must be empty at the end; only text results and screenshots
are retained. No host physical disks are passed through to any VM.

The guest tests exercise dependency installation, repeat install, live disk and
filesystem readings, GTK rendering, pause/resume, report copying and uninstall.
GNOME menu integration is checked separately where GNOME is part of the matrix.
Virtual NVMe data validates API handling, not the health of a physical drive.
The Fedora host supplies the physical-NVMe check.

On Arch, missing runtime libraries are installed with `pacman -Syu`, which also
performs a full system upgrade to avoid an unsupported partial upgrade. Use
`--no-deps` after managing the required packages yourself if preferred.

The completed 1.1.0 matrix covers Fedora 44 (physical host), Ubuntu 24.04.5 LTS,
Debian 13, Kali 2026.3 rolling, Arch rolling as tested on November 20, 2026,
openSUSE Leap 16.0, and Linux Mint 22.3 Cinnamon (live VM with a mounted test
drive). The Ubuntu, Debian and Fedora GNOME button checks include launch and
disable/re-enable. Mint additionally passed a launch from its installed desktop
entry in the real Cinnamon session. Every VM and its image were deleted after
evidence was collected. Shared platform libraries are not bundled in the
installer; fresh systems obtain them using their distro package manager.

## Fedora window-layout update 1.1.2

Fedora receives an adaptive layout for left/right tiling, smaller windows and
scaled displays. Wide panels reflow; narrow drive/source selectors remain
accessible. Live collectors and data formats are unchanged. The Fedora build
is validated at widths 480, 640, 768, 960 and 1180 pixels, including short windows
and actual GNOME left/right tiling. The current distribution-wide release applies the responsive layout to all seven installers.


## Distribution-wide update

The current release targets Fedora, Ubuntu, Debian, Kali Linux, Linux Mint, Arch Linux and openSUSE Leap. Every distro has its own installer with native package dependencies. Responsive layouts and GNOME menu integration are shared across the builds. GNOME provides the Quick Settings buttons; other desktops receive their standard Applications-menu launcher.

The cross-distribution release suite installs, runs, exercises live data and responsive layouts, verifies the desktop launcher, and uninstalls all four dashboards on each VM before deleting that VM and moving to the next distribution. See the release validation report for tested versions and hardware limits. Virtual GPUs may expose no GPU/VRAM usage counters; those values stay unavailable rather than being fabricated. Website updates and publishing are a later stage.


### Current target baselines

The distribution-wide release uses separate x86-64 installers for Fedora, Ubuntu, Debian, Kali, Linux Mint, Arch and openSUSE Leap. Validation targets Fedora **44 and 45 separately**, Ubuntu 24.04 LTS, Debian 13, Kali 2026.3, Linux Mint 22.3 Cinnamon, Arch rolling and openSUSE Leap 16.0. Other releases are not automatically claimed tested. The same Fedora installer is exercised on both Fedora versions.

Use the installer whose suffix matches your distribution, for example `-fedora.run`, `-ubuntu.run` or `-linuxmint.run`. GNOME supplies the Quick Settings button (or Network Lens’s existing Wi-Fi submenu action); other desktops receive native Applications-menu launchers. A new GNOME extension may require one sign-out/sign-in. The per-app all-distro bundle includes the current test report and exact installer checksums. The full release matrix covers 28 unique files / 32 installer-VM combinations.
