Files tab counts (technical)

Patch for COSMIC Files. Each file manager writes its window title, tab count and the item count of the active tab to a file, so the taskbar can show “N tabs” or “M items” for file manager windows. COSMIC Files does not expose its tabs otherwise. User overview: files-tabs/README.md.

How it works

Installed files

files-tabs/build.sh (run by ./install.sh files-tabs) installs:

Path What
~/.local/bin/cosmic-files-tabs The patched file manager
~/.local/bin/cosmic-files Link to it. “Show in folder” in other apps (org.freedesktop.FileManager1, served by cosmic-files-applet) and other launches by name start cosmic-files from the session PATH, which has ~/.local/bin first.
~/.local/share/applications/com.system76.CosmicFiles.desktop Copy of the system entry pointing at the patched file manager (launcher, dock, folders opened through the inode/directory type)
~/.local/state/files-tabs/built-commit Upstream commit it was built from
~/.cache/files-tabs/cosmic-files Upstream source clone

No D-Bus service override: no package ships an activatable org.freedesktop.FileManager1 service; cosmic-files-applet (desktop icons, started by the session) owns the name and starts cosmic-files by name. The desktop icons themselves stay the system cosmic-files-applet.

Commands

./install.sh files-tabs               build the installed cosmic-files version + patches, install per user
./install.sh --uninstall files-tabs   back to the system file manager
files-tabs/build.sh [--uninstall]     the same steps without the installer

Needs the same Rust toolchain as the taskbar, see taskbar. build.sh does not restart the panel and does not close file manager windows.

Configuration

None.

Limits