APP2UNIT(1)

NAME

app2unit, app2unit-open, app2unit-term, app2unit-open-scope, app2unit-open-service, app2unit-term-scope, app2unit-term-service

Application launcher, file opener, default terminal launcher for systemd environments.

SYNOPSIS

app2unit [options] [--] {entry-id.desktop | entry-id.desktop:action-id | command} [args ...]

app2unit -T [options] [--] [entry-id.desktop | entry-id.desktop:action-id | command] [args ...]

app2unit -O [options] [--] {URL|Path ...}

DESCRIPTION

app2unit launches applications by their Desktop Entry IDs, or arbitrary command lines. Applications are launched as systemd user units.

With -O option it can open files or URLs in associated applications.

With -T option it can force running application in a terminal, or just open default terminal (utilizing xdg-terminal-exec).

Symlinks with specially suffixed names can be used to pre-select some modes and unit types with single command:

•   app2unit-open
•   app2unit-open-scope
•   app2unit-open-service
•   app2unit-term
•   app2unit-term-scope
•   app2unit-term-service

OPTIONS

-s {a|b|s|custom.slice}

    Select slice among short references (the first one is the default):
    "a=app.slice b=background.slice s=session.slice"
    Or set slice explicitly. Default and short references can be preset via APP2UNIT_SLICES env var in the format above.

-t {scope|service}

    Type of unit to launch. Can be preselected via APP2UNIT_TYPE env var and if $0 ends with "-scope" or "-service".

-a app_name

    Override substring of Unit ID representing application name. Defaults to Entry ID without extension, or executable name. Conflicts with -u.

-u unit_id

    Override the whole Unit ID. Must match type. Defaults to recommended templates:
        app-${desktop}-${app_name}@${random}.service
        app-${desktop}-${app_name}-${random}.scope
    Conflicts with -a.

-x

    Do not insert ${desktop} substring into generated unit name. Also can be preset with env var "APP2UNIT_INSERT_XSD=false".

-X

    Insert ${desktop} substring into generated unit name (default behavior).

-d description

    Set/override unit description. By default description is generated from Entry's "Name=" and "GenericName=" keys.

-p {Property=value|@file}

    Set additional unit property. Or load them from a @file (one assignment per line, lines are trimmed, empty lines and those starting with "#" are ignored). Option is repeatable.

-T

    Force launch in terminal (xdg-terminal-exec is used). Any unknown option starting with '-' after this will be passed to xdg-terminal-exec. Command may be omitted to just launch default terminal. This mode can also be selected if $0 ends with "-term" or "-terminal", also optionally followed by "-scope" or "-service" unit type suffixes.

-S {out|err|both}

    Silence stdout, stderr, or both.

-c

    Do not add graphical-session.target dependency and ordering. Also can be preset with env var "APP2UNIT_PART_OF_GST=false".

-C

    Add graphical-session.target dependency and ordering (default behavior).

-O, --open

    Opener mode: argument(s) are treated as file(s) or URL(s) to open. Desktop Entry for them is found via xdg-mime. Only single association is supported. This mode can also be selected if $0 ends with "-open", also optionally followed by "-scope" or "-service" unit type suffixes.

--fuzzel-compat

    For using in fuzzel <1.14.0 like this:

        fuzzel --launch-prefix='app2unit --fuzzel-compat --'

    Since 1.14.0 it is no longer needed as DESKTOP_ENTRY_* vars are handled automatically.

--test

    Do not run anything, print resulting command.

--

    Disambiguate command from options.

ENVIRONMENT

APP2UNIT_TYPE

    scope|service, presets default unit type (default: scope).

APP2UNIT_SLICES

    Assignments of short selectors to slice names. The first assignment is the default slice for apps (default: "a=app.slice b=background.slice s=session.slice").

APP2UNIT_PART_OF_GST

    true|false, whether to set "PartOf=graphical-session.target" dependency for launched applications (default: true)

APP2UNIT_DEBUG, DEBUG

    Truthy or greater than zero value enables debug messages to stderr.

SEE ALSO

systemd-run(1), systemd.special(7), xdg-terminal-exec(1)

AUTHORS

Vladimir-csp (https://github.com/Vladimir-csp, https://gitlab.freedesktop.org/Vladimir-csp)