## XfceSystemd

XfceSystemd — Session management via systemd

## Functions

XfceSystemd * | xfce_systemd_get ()
gboolean | xfce_systemd_reboot ()
gboolean | xfce_systemd_power_off ()
gboolean | xfce_systemd_suspend ()
gboolean | xfce_systemd_hibernate ()
gboolean | xfce_systemd_hybrid_sleep ()
gboolean | xfce_systemd_can_reboot ()
gboolean | xfce_systemd_can_power_off ()
gboolean | xfce_systemd_can_suspend ()
gboolean | xfce_systemd_can_hibernate ()
gboolean | xfce_systemd_can_hybrid_sleep ()

## Types and Values

| XfceSystemd

## Object Hierarchy

        GObject
        ╰── XfceSystemd

## Includes

    #include <libxfce4util/libxfce4util.h>

## Description

## Functions

### xfce_systemd_get ()

    XfceSystemd *
    xfce_systemd_get (void);

Create a new XfceSystemd instance or increase reference count.

#### Returns

A reference to the singleton object, to be released with `g_object_unref()`.

[transfer full]

Since: 4.19.1

### xfce_systemd_reboot ()

    gboolean
    xfce_systemd_reboot (XfceSystemd *systemd,
                         gboolean polkit_interactive,
                         GError **error);

Ask systemd to trigger Reboot.

#### Parameters

systemd | the XfceSystemd object |
polkit_interactive | whether PolicyKit should ask the user to authenticate if needed |
error | location to store error on failure or `NULL`. | [out][nullable]

#### Returns

`TRUE` if the D-Bus request was successful, `FALSE` otherwise and `error` is set.

Since: 4.19.1

### xfce_systemd_power_off ()

    gboolean
    xfce_systemd_power_off (XfceSystemd *systemd,
                            gboolean polkit_interactive,
                            GError **error);

Ask systemd to trigger PowerOff.

#### Parameters

systemd | the XfceSystemd object |
polkit_interactive | whether PolicyKit should ask the user to authenticate if needed |
error | location to store error on failure or `NULL`. | [out][nullable]

#### Returns

`TRUE` if the D-Bus request was successful, `FALSE` otherwise and `error` is set.

Since: 4.19.1

### xfce_systemd_suspend ()

    gboolean
    xfce_systemd_suspend (XfceSystemd *systemd,
                          gboolean polkit_interactive,
                          GError **error);

Ask systemd to trigger Suspend.

#### Parameters

systemd | the XfceSystemd object |
polkit_interactive | whether PolicyKit should ask the user to authenticate if needed |
error | location to store error on failure or `NULL`. | [out][nullable]

#### Returns

`TRUE` if the D-Bus request was successful, `FALSE` otherwise and `error` is set.

Since: 4.19.1

### xfce_systemd_hibernate ()

    gboolean
    xfce_systemd_hibernate (XfceSystemd *systemd,
                            gboolean polkit_interactive,
                            GError **error);

Ask systemd to trigger Hibernate.

#### Parameters

systemd | the XfceSystemd object |
polkit_interactive | whether PolicyKit should ask the user to authenticate if needed |
error | location to store error on failure or `NULL`. | [out][nullable]

#### Returns

`TRUE` if the D-Bus request was successful, `FALSE` otherwise and `error` is set.

Since: 4.19.1

### xfce_systemd_hybrid_sleep ()

    gboolean
    xfce_systemd_hybrid_sleep (XfceSystemd *systemd,
                               gboolean polkit_interactive,
                               GError **error);

Ask systemd to trigger HybridSleep.

#### Parameters

systemd | the XfceSystemd object |
polkit_interactive | whether PolicyKit should ask the user to authenticate if needed |
error | location to store error on failure or `NULL`. | [out][nullable]

#### Returns

`TRUE` if the D-Bus request was successful, `FALSE` otherwise and `error` is set.

Since: 4.19.1

### xfce_systemd_can_reboot ()

    gboolean
    xfce_systemd_can_reboot (XfceSystemd *systemd,
                             gboolean *can_reboot,
                             gboolean *auth_reboot,
                             GError **error);

Check whether systemd can trigger Reboot.

#### Parameters

systemd | the XfceSystemd object |
can_reboot | location to store capacity or `NULL`. | [out][nullable]
auth_reboot | location to store authorization or `NULL`. | [out][nullable]
error | location to store error on failure or `NULL`. | [out][nullable]

#### Returns

`TRUE` if the D-Bus request was successful, `FALSE` otherwise and `error` is set.

Since: 4.19.1

### xfce_systemd_can_power_off ()

    gboolean
    xfce_systemd_can_power_off (XfceSystemd *systemd,
                                gboolean *can_power_off,
                                gboolean *auth_power_off,
                                GError **error);

Check whether systemd can trigger PowerOff.

#### Parameters

systemd | the XfceSystemd object |
can_power_off | location to store capacity or `NULL`. | [out][nullable]
auth_power_off | location to store authorization or `NULL`. | [out][nullable]
error | location to store error on failure or `NULL`. | [out][nullable]

#### Returns

`TRUE` if the D-Bus request was successful, `FALSE` otherwise and `error` is set.

Since: 4.19.1

### xfce_systemd_can_suspend ()

    gboolean
    xfce_systemd_can_suspend (XfceSystemd *systemd,
                              gboolean *can_suspend,
                              gboolean *auth_suspend,
                              GError **error);

Check whether systemd can trigger and has authorization for Suspend.

#### Parameters

systemd | the XfceSystemd object |
can_suspend | location to store capacity or `NULL`. | [out][nullable]
auth_suspend | location to store authorization or `NULL`. | [out][nullable]
error | location to store error on failure or `NULL`. | [out][nullable]

#### Returns

`TRUE` if the D-Bus request was successful, `FALSE` otherwise and `error` is set.

Since: 4.19.1

### xfce_systemd_can_hibernate ()

    gboolean
    xfce_systemd_can_hibernate (XfceSystemd *systemd,
                                gboolean *can_hibernate,
                                gboolean *auth_hibernate,
                                GError **error);

Check whether systemd can trigger and has authorization for Hibernate.

#### Parameters

systemd | the XfceSystemd object |
can_hibernate | location to store capacity or `NULL`. | [out][nullable]
auth_hibernate | location to store authorization or `NULL`. | [out][nullable]
error | location to store error on failure or `NULL`. | [out][nullable]

#### Returns

`TRUE` if the D-Bus request was successful, `FALSE` otherwise and `error` is set.

Since: 4.19.1

### xfce_systemd_can_hybrid_sleep ()

    gboolean
    xfce_systemd_can_hybrid_sleep (XfceSystemd *systemd,
                                   gboolean *can_hybrid_sleep,
                                   gboolean *auth_hybrid_sleep,
                                   GError **error);

Check whether systemd can trigger and has authorization for HybridSleep.

#### Parameters

systemd | the XfceSystemd object |
can_hybrid_sleep | location to store capacity or `NULL`. | [out][nullable]
auth_hybrid_sleep | location to store authorization or `NULL`. | [out][nullable]
error | location to store error on failure or `NULL`. | [out][nullable]

#### Returns

`TRUE` if the D-Bus request was successful, `FALSE` otherwise and `error` is set.

Since: 4.19.1

## Types and Values

### XfceSystemd

    typedef struct _XfceSystemd XfceSystemd;