Skip to content

Desktop: ports can put their own files on new Desktops - #10

Merged
schikani merged 2 commits into
mainfrom
feature/desktop-files
Oct 31, 2026
Merged

schikani merged 2 commits into
mainfrom
feature/desktop-files

Conversation

@schikani

Copy link
Copy Markdown
Collaborator

Closes #5.

Ports can now put their own files on every new Desktop, as discussed in #5.

td_sysinfo_t.desktop_files (optional) is a list of file names and contents, ended by an entry with name NULL. When a user's Desktop folder is created, TinyDesk writes Welcome.txt and then these files into it, for example a port's Credits.txt.

  • Like Welcome.txt, they are written once per user: Desktops that already exist don't get them, and a user may edit or delete them.
  • Names that aren't plain file names are skipped (/, \, empty, ., ..), as are entries with no text.
  • Builds that leave it NULL are unchanged: only Welcome.txt.
static const td_desktop_file_t s_desk_files[] = {
    {"Credits.txt", "MyBoard port of TinyDesk\n\nPort:      Jane Doe\n"},
    {NULL, NULL},
};
...
s_info.desktop_files = s_desk_files;

CONTRIBUTORS.md lists the people who made TinyDesk and TinyDesk Shell; README.md and CONTRIBUTING.md point to it.

Tests: tests/test_desktop.c (15 checks, in-memory filesystem): a new Desktop gets Welcome.txt and the port's files, bad entries are skipped, each new user gets their own copies, an existing Desktop is left alone (an edited file stays edited), and no list means only Welcome.txt. All 11 host tests pass on Windows (MinGW).

Docs, with the suggested Credits.txt format: tinydesk-project/tinydesk-project.github.io, branch feature/desktop-files.

td_sysinfo_t.desktop_files lists files (name and contents, ended by a
NULL name) that TinyDesk writes next to Welcome.txt when a user's Desktop
folder is created, such as a port's Credits.txt. Like Welcome.txt they
are written once per user; names that are not plain file names are
skipped, and builds that leave it NULL are unchanged. tests/test_desktop.c
covers new and existing Desktops, bad entries and no list.

CONTRIBUTORS.md lists the people who made TinyDesk and TinyDesk Shell;
README and CONTRIBUTING point to it. Closes #5.
@schikani
schikani merged commit caed895 into main Oct 31, 2026
14 checks passed
schikani added a commit to tinydesk-project/tinydesk-project.github.io that referenced this pull request Oct 31, 2026
Documents the desktop-files hook from tinydesk-project/tinydesk#10
(tinydesk #5): td_sysinfo_t.desktop_files lists file names and contents
that TinyDesk writes next to Welcome.txt when a user's Desktop folder is
created, for example a port's Credits.txt. Written once per user, like
Welcome.txt; builds that do not set it are unchanged.

- api/sysinfo.md: new section "Files for a new Desktop" with the member,
  its type and an example.
- api/apps.md, ports/overview.md, shell/config-files.md: the Desktop
  folder is created with Welcome.txt and the port's own files.
- contributing.md: CONTRIBUTORS.md in the tinydesk repository lists the
  people who made TinyDesk and TinyDesk Shell; add yourself in your pull
  request.
- changelog.md: "Unreleased" entries for both.
schikani added a commit that referenced this pull request Oct 31, 2026
Conflict in CMakeLists.txt: both added a test (test_py_pins and
test_desktop); both kept.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Contributors.txt?

1 participant