XFCE4 panel + GTK4 launcher for quick access to favorite files and directories with thumbnail previews.
A small two-piece system:
plugin/libtreasure-panel.so— a GTK3 XFCE panel plugin that adds a button to your panel. On click it computes its on-screen position and spawns the launcher anchored to itself.treasure-panel— a GTK4 binary that reads a JSON manifest of your "treasures" (paths you care about) and renders them as a popup grid with thumbnails for images and icons for everything else. Clicking a directory expands it inline; clicking a file opens it viaxdg-open.
The split is forced by reality: XFCE's panel is GTK3, but GTK4 is where the nice popup, picture rendering, and modern layout live. Two binaries, one pipe between them.
Requirements:
- Rust (stable, 2021 edition)
gcc,pkg-config- Dev headers:
libxfce4panel-2.0,gtk+-3.0(plugin),gtk4(launcher),gdk-pixbuf-2.0,libsystemd(for journald logging) justfor the recipes (optional)
just build # debug build of both pieces
just build-main-release build-plugin-release # releaseThe build-plugin recipe bakes the absolute path of this checkout's
launcher script into the plugin via TREASURE_PANEL_BIN, so the panel
button knows where to find the GTK4 binary. If you move the source tree,
re-run just build install.
just install # copies .so to /usr/lib/xfce4/panel/plugins, .desktop
# to /usr/share/xfce4/panel/plugins, restarts panelThen add Treasure Panel to your panel via Panel Preferences -> Items -> Add.
To put a treasure-panel launcher on your $PATH:
just link # default: $HOME/.local/bin/treasure-panel
TREASURE_BIN_DIR=/usr/local/bin just linkThe manifest is plain JSON. Default location:
$XDG_CONFIG_HOME/treasure-panel/treasures.nu (a Nushell script that emits
JSON to stdout) — but you can also feed a static JSON file with
--manifest <path> or pipe one in on stdin.
{
"title": "My Treasures",
"thumbnail_size": 64,
"columns": 4,
"items": [
{ "path": "/home/me/Documents", "name": "Documents",
"kind": "directory", "section": "Directories",
"expandable": true, "icon": "folder-documents" },
{ "path": "/home/me/Pictures/screenshot.png", "name": "Screenshot",
"kind": "image", "section": "Recent" }
]
}Item fields:
path(required) — absolute path to the file/directory.name— display label; defaults to the basename.kind—file|directory|image|video|audio|document. Auto-detected from MIME if omitted.expandable— directories only; show contents inline on click.icon— freedesktop icon name; overrides auto-detection.section— group header in the popup grid.children— pre-expanded directory contents.
Top-level fields: title, thumbnail_size (px, default 64), columns
(0 = auto-fit).
The launcher caches the most recent manifest under
$XDG_CACHE_HOME/treasure-panel/manifest.json for instant popup; pass
--refresh-cache to rerun the nu script.
journalctl -t treasures -f # GTK4 launcher
journalctl -t treasure-panel-plugin -f # XFCE panel button
RUST_LOG=treasure_panel=debug treasure-panel --run-nuGPL-2.0-or-later. See LICENSE.