ufo(1)

NAME
ufo - tool for opening files from command line.

SYNOPSIS
ufo [-t] [-b] <file1> [<file2> ...]
ufo --make-config
ufo --version
ufo --help

DESCRIPTION
ufo is a tool for opening files and URLs. The utility can use a configuration file that specifies mappings
between Amalthea file formats and applications to open them.
Configuration is defined in a specially formatted file
"~/.config/ufo/formatapps.toml" and/or in "/etc/ufo/formatapps.toml",
as well as in files from the directory "~/.config/ufo/formatapps.toml.d/".
If no configuration is provided, or the required program is not found,
applications are determined in the traditional Linux way - through
MIME types and their associated desktop files. The -t option means opening all files with a single application
in the current terminal, with waiting.
The described configuration must exist.
The opening application is determined by the first file,
and in the configuration it must have the property "tty = true".
This is typically needed for programs like vim or hexedit. The -b option means opening with browser by default. Also it handles
URL-based desktop entries (files "*.desktop").

Configuration for Amalthea formats
The Amalthea library provides its own way of defining file formats.
The ufo utility can make use of this.
All formats are listed in the
"/etc/amalthea-ldc2/fileformats.json" (the path may differ
if the compiler dmd or gdc was used instead of ldc2). The configuration for ufo is a TOML file, where formats
are represented as arrays of table in TOML terminology:
the format name is given in double square brackets, followed
by a table with fields that specify the application. Example:
        [[PDF]]
        app = "zathura"
        [[ODT]]
        app = "libreoffice"
        pre = ["--writer"]
        [[MP3]]
        app = "qmmp"
        [[MP3]]
        app = "smplayer"
Each table must have the field "app", which specifies the application.
Other possible fields:
    pre - specifies an array of options for the application,
          placed before the argument with the opened file;
    one - if true, the application can open only one file at a time;
    tty - if true, the application is intended to run in a terminal
          (e.g., nvim), but only with the '-t' flag (ufo <file> -t). If the example, [[MP3]] appears twice.
The ufo utility searches for the first existing
application and uses it. Priority is determined by the order
in the configuration file: qmmp will be checked first,
and if it is not found, smplayer will be attempted. Along with formats, you can use the special value "Directory"
to specify the program for opening directories.

  Using groups
In addition to individual file formats, format groups can also be used.
They can be seen in the same Amalthea formats file:
    $ grep '"group":' /etc/amalthea-ldc2/fileformats.json | sort | uniq
Likely groups:
Archives, Audio, Documents, Geometry models, Pictures, Text, Video. In the configuration, groups are used the same way as formats,
but with "Group:" prefixed to the name. Example:
        [[Group:Video]]
        app = "mpv"
        [[Group:Text]]
        app = "nvim"
        tty = true
        [[Group:Text]]
        app = "kwrite"
A group is used if no parameters are specified for
a particular format, but they are specified for its group.

SEE ALSO
xdg-open(1), mimeopen(1)