From 8feca2472ccb71d49716a37e86db2fc3a485ae4e Mon Sep 17 00:00:00 2001 From: Benjamin Berg Date: Wed, 25 Mar 2020 16:59:40 +0100 Subject: 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 --- units/user/meson.build | 4 ++++ units/user/xdg-desktop-autostart.target | 14 ++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 units/user/xdg-desktop-autostart.target (limited to 'units') diff --git a/units/user/meson.build b/units/user/meson.build index cb8f630b8c..33732e7d59 100644 --- a/units/user/meson.build +++ b/units/user/meson.build @@ -20,6 +20,10 @@ units = [ 'timers.target', ] +if conf.get('ENABLE_XDG_AUTOSTART') == 1 + units += [ 'xdg-desktop-autostart.target', ] +endif + foreach file : units install_data(file, install_dir : userunitdir) diff --git a/units/user/xdg-desktop-autostart.target b/units/user/xdg-desktop-autostart.target new file mode 100644 index 0000000000..22df5a35d3 --- /dev/null +++ b/units/user/xdg-desktop-autostart.target @@ -0,0 +1,14 @@ +# SPDX-License-Identifier: LGPL-2.1+ +# +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +[Unit] +Description=Startup of XDG autostart applications +Documentation=man:systemd.special(7) +RefuseManualStart=yes +StopWhenUnneeded=yes -- cgit v1.2.3