diff options
author | Benjamin Berg <bberg@redhat.com> | 2020-03-25 16:59:40 +0100 |
---|---|---|
committer | Benjamin Berg <bberg@redhat.com> | 2020-05-27 09:02:10 +0200 |
commit | 8feca2472ccb71d49716a37e86db2fc3a485ae4e (patch) | |
tree | 8fbc9062edf1a620a4236523abaa9676e1479453 /src/xdg-autostart-generator/xdg-autostart-service.h | |
parent | sysv-generator: Downgrade directory listing fails to warning (diff) | |
download | systemd-8feca2472ccb71d49716a37e86db2fc3a485ae4e.tar.xz systemd-8feca2472ccb71d49716a37e86db2fc3a485ae4e.zip |
xdg-autostart-generator: Add a generator for XDG autostart files
This generator can be used by desktop environments to launch autostart
applications and services. The feature is an opt-in, triggered by
xdg-desktop-autostart.target being activated.
Also included is the new binary xdg-autostart-condition. This binary is
used as an ExecCondition to test the OnlyShowIn and NotShowIn XDG
desktop file keys. These need to be evaluated against the
XDG_CURRENT_DESKTOP environment variable which may not be known at
generation time.
Co-authored-by: Henri Chain <henri.chain@enioka.com>
Diffstat (limited to 'src/xdg-autostart-generator/xdg-autostart-service.h')
-rw-r--r-- | src/xdg-autostart-generator/xdg-autostart-service.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/xdg-autostart-generator/xdg-autostart-service.h b/src/xdg-autostart-generator/xdg-autostart-service.h new file mode 100644 index 0000000000..685f97824e --- /dev/null +++ b/src/xdg-autostart-generator/xdg-autostart-service.h @@ -0,0 +1,36 @@ +/* SPDX-License-Identifier: LGPL-2.1+ */ +#pragma once + +#include "macro.h" + +typedef struct XdgAutostartService { + char *name; + char *path; + char *description; /* Name in XDG desktop file */ + + char *type; /* Purely as an assertion check */ + char *exec_string; + + char **only_show_in; + char **not_show_in; + + char *try_exec; + char *autostart_condition; /* This is mostly GNOME specific */ + char *kde_autostart_condition; + + char *gnome_autostart_phase; + + bool hidden; + bool systemd_skip; + +} XdgAutostartService; + + +XdgAutostartService * xdg_autostart_service_free(XdgAutostartService *s); +DEFINE_TRIVIAL_CLEANUP_FUNC(XdgAutostartService*, xdg_autostart_service_free); + +char *xdg_autostart_service_translate_name(const char *name); +int xdg_autostart_format_exec_start(const char *exec, char **ret_exec_start); + +XdgAutostartService *xdg_autostart_service_parse_desktop(const char *path); +int xdg_autostart_service_generate_unit(XdgAutostartService *service, const char *dest); |