Skip to main content

Module apps

Module apps 

Source
Expand description

Which applications can open a type, and what they are called.

Two data files, both plain text and both generated by the desktop: mimeinfo.cache next to the desktop entries says which entries registered for a type, and each entry says what it is called and what it runs.

§What this refuses to do

It does not launch anything, and it does not interpret Exec= beyond its first word. Field codes (%f, %U, %c), TryExec, Terminal=true, D-Bus activation — that is the whole desktop entry specification, and reimplementing it is how this suite would end up as a third opinion about which application opens a file, disagreeing with the rest of the desktop in ways nobody can see. Launching stays gio launch, with xdg-open behind it; see hyprforge_files::launch.

The first word is read for one reason only: to answer “is this actually installed”. An entry naming a program that is not there is the failure that started all this — mimeapps.list here pointed .3mf at fstl, which had been uninstalled, and a chooser that offered it would be offering a dead end.

Structs§

App
One application, as the desktop describes it.

Functions§

on_path
Whether a program can be run, by walking PATH. The real is_installed behind parse_entry.
parse_cache
mimeinfo.cache: which entries registered for each type.
parse_entry
Reads one desktop entry. None when it has no Name=, or when it asks not to be shown (NoDisplay=true, Hidden=true) — those are entries the desktop itself keeps out of menus, and a chooser is a menu.
write_custom_entry
Writes a desktop entry for a command a person typed, and hands back the entry’s file name.