GLib.unix_signal_add

function unix_signal_add(priority: Number(gint), signum: Number(gint), handler: GLib.SourceFunc): Number(guint) {
    // Gjs wrapper for g_unix_signal_add_full()
}
  

A convenience function for GLib.unix_signal_source_new, which attaches to the default GLib.MainContext. You can remove the watch using GLib.source_remove.

Since 2.30

priority

the priority of the signal source. Typically this will be in the range between #G_PRIORITY_DEFAULT and #G_PRIORITY_HIGH.

signum

Signal number

handler

Callback

Returns

An ID (greater than 0) for the event source