APP2UNIT(1)

πŸ“¦
version 1.4.4 Β· 2 versions
, in nixpkgs unstable

✨ APP2UNIT(1) ✨

okay so bestie, welcome to the app2unit(1) page β€” general commands manual, but make it a group chat πŸ’…

the whole fam of commands lives here, and they're all the same vibe with different defaults baked in: app2unit, app2unit-open, app2unit-term, app2unit-open-scope, app2unit-open-service, app2unit-term-scope, and app2unit-term-service πŸŽ€

it's literally your application launcher, your file opener, and your default terminal launcher for systemd environments. main character energy fr fr πŸ‘‘


🌸 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 by arbitrary command lines. and the way it does it? it launches them as systemd user units β€” slay ✨

with the -O option it can open files or URLs in the applications associated with them 🫢

with the -T option it can force the application to run in a terminal, or just open the default terminal (utilizing xdg-terminal-exec). iconic behavior honestly πŸ’…

and here's a cute little trick: symlinks with specially suffixed names can be used to pre-select some modes and unit types with a 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 the short references, and the first one is the default: "a=app.slice b=background.slice s=session.slice". or just set the slice explicitly. both the default and the short references can be preset via the APP2UNIT_SLICES env var in the format above 🌈
  • -t {scope|service} β€” the type of unit to launch. can be preselected via the APP2UNIT_TYPE env var, and also if $0 ends with -scope or -service ⭐
  • -a app_name β€” override the substring of the Unit ID that represents the application name. defaults to the Entry ID without its extension, or the executable name. conflicts with -u πŸ™ˆ
  • -u unit_id β€” override the whole Unit ID. must match the type. defaults to the recommended templates:
app-${desktop}-${app_name}@${random}.service
app-${desktop}-${app_name}-${random}.scope

conflicts with -a πŸ’€

  • -x β€” do not insert the ${desktop} substring into the generated unit name. can also be preset with the env var "APP2UNIT_INSERT_XSD=false" πŸ“
  • -X β€” insert the ${desktop} substring into the generated unit name (this is the default behavior, so it's giving "yes bestie keep it" ✨)
  • -d description β€” set or override the unit description. by default the description is generated from the Entry's "Name=" and "GenericName=" keys πŸŽ€
  • -p {Property=value|@file} β€” set an additional unit property. or load them from a @file (one assignment per line, lines are trimmed, and empty lines plus lines starting with "#" are ignored). this option is repeatable πŸ”₯
  • -T β€” force launch in a terminal (xdg-terminal-exec is used). any unknown option starting with '-' after this will be passed to xdg-terminal-exec. the command may be omitted to just launch the 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. shhh 🀫
  • -c β€” do not add the graphical-session.target dependency and ordering. can also be preset with the env var "APP2UNIT_PART_OF_GST=false" 🌸
  • -C β€” add the graphical-session.target dependency and ordering (this is the default behavior, no cap) πŸ‘‘
  • -O, --open β€” opener mode: the argument(s) are treated as file(s) or URL(s) to open. the Desktop Entry for them is found via xdg-mime. only a 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's no longer needed, because DESKTOP_ENTRY_* vars are handled automatically. it's giving legacy support, we love her anyway πŸ’–

  • --test β€” do not run anything, just print the resulting command. dry run queen πŸ’…
  • -- β€” disambiguate a command from options. the classic "hey, everything after this is literally an argument" move 🫢

🧚 ENVIRONMENT 🧚

  • APP2UNIT_TYPE β€” scope|service, presets the 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 the "PartOf=graphical-session.target" dependency for launched applications (default: true) πŸŽ€
  • APP2UNIT_DEBUG, DEBUG β€” a truthy or greater-than-zero value enables debug messages to stderr. turn it on when you need to snoop πŸ‘€

πŸ’œ SEE ALSO πŸ’œ

systemd-run(1), systemd.special(7), xdg-terminal-exec(1) β€” go read these too bestie, iykyk πŸ“š


πŸ‘‘ AUTHORS πŸ‘‘

Vladimir-csp (https://github.com/Vladimir-csp, https://gitlab.freedesktop.org/Vladimir-csp) β€” the icon who wrote all this πŸ’–


okay that's the whole page, and the footer says this is from the APP2UNIT(1) manual, dated 1980-01-01 β€” yes that date is a vibe, don't question it πŸ’€βœ¨ periodt πŸŽ€

πŸ“¦ where this page comes from