Documentation
¶
Overview ¶
Package recentfiles tracks recently used files in the XDG recently-used.xbel format (TOML-free, XML as the spec says), so lys-ui apps share the recents list with the desktop's other citizens. The manager keeps the list bounded, most-recent first, and writes atomically; a missing or corrupt file starts an empty list.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultPath ¶
func DefaultPath() string
DefaultPath is the spec's location under the user data directory, honoring XDG_DATA_HOME.
Types ¶
type Entry ¶
Entry is one recently used file: its path (decoded from the file:// URI on disk), the owning application's name, and when it was last used.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager reads and writes one recents list. The zero value is usable and answers from an empty list until a Load or Add names a file.
func New ¶
New returns the manager for the given xbel path (DefaultPath for the desktop's shared list).
func (*Manager) Add ¶
Add moves path to the front of the list under app, stamps it now, and persists. Errors persisting are reported once here; a failed write never loses the in-memory list.
func (*Manager) Load ¶
Load reads the xbel file; a missing file is an empty list, a corrupt one is an empty list plus the error (the next Add rewrites it clean). Entries whose URIs are not local file:// paths are skipped.