shell: Add call to check the existence of a systemd unit
These checks will be handy while handling ibus-daemon startup, since this is going to move to a systemd service soon. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2171>
This commit is contained in:
parent
adc58ea743
commit
352c9695f3
@ -787,6 +787,25 @@ shell_util_stop_systemd_unit_finish (GAsyncResult *res,
|
||||
return g_task_propagate_boolean (G_TASK (res), error);
|
||||
}
|
||||
|
||||
void
|
||||
shell_util_systemd_unit_exists (const gchar *unit,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
shell_util_systemd_call ("GetUnit",
|
||||
g_variant_new ("(s)", unit),
|
||||
SYSTEMD_CALL_FLAGS_NONE,
|
||||
cancellable, callback, user_data);
|
||||
}
|
||||
|
||||
gboolean
|
||||
shell_util_systemd_unit_exists_finish (GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
return g_task_propagate_boolean (G_TASK (res), error);
|
||||
}
|
||||
|
||||
void
|
||||
shell_util_sd_notify (void)
|
||||
{
|
||||
|
@ -72,6 +72,13 @@ void shell_util_stop_systemd_unit (const char *unit,
|
||||
gboolean shell_util_stop_systemd_unit_finish (GAsyncResult *res,
|
||||
GError **error);
|
||||
|
||||
void shell_util_systemd_unit_exists (const gchar *unit,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
gboolean shell_util_systemd_unit_exists_finish (GAsyncResult *res,
|
||||
GError **error);
|
||||
|
||||
void shell_util_sd_notify (void);
|
||||
|
||||
gboolean shell_util_has_x11_display_extension (MetaDisplay *display,
|
||||
|
Loading…
Reference in New Issue
Block a user