Urfkill.Client

g GObject.Object GObject.Object Urfkill.Client Urfkill.Client GObject.Object->Urfkill.Client

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new ()

enumerate_devices_sync (cancellable)

get_daemon_version ()

get_devices ()

inhibit (reason)

is_inhibited ()

set_block (type, block, cancellable)

set_block_idx (index, block, cancellable)

set_bluetooth_block (block)

set_wlan_block (block)

set_wwan_block (block)

uninhibit (cookie)

Virtual Methods

Inherited:

GObject.Object (7)

do_device_added (device)

do_device_changed (device)

do_device_removed (device)

do_rf_key_pressed (keycode)

Properties

Name

Type

Flags

Short Description

daemon-version

str

r

The running daemon version

key-control

bool

r

The key control state

Signals

Inherited:

GObject.Object (1)

Name

Short Description

device-added

The device-added signal is emitted when a rfkill device is added.

device-changed

The device-changed signal is emitted when a rfkill device is changed.

device-removed

The device-removed signal is emitted when a rfkill device is removed.

rf-key-pressed

The rf-key-pressed signal is emitted when a rfkill key is pressed.

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent

GObject.Object

r

Class Details

class Urfkill.Client(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Urfkill.ClientClass

The Urfkill.Client struct contains only private fields and should not be directly accessed.

classmethod new()
Returns:

a new Urfkill.Client object.

Return type:

Urfkill.Client

Creates a new Urfkill.Client object.

enumerate_devices_sync(cancellable)
Parameters:

cancellable (Gio.Cancellable or None) – a Gio.Cancellable or None

Raises:

GLib.Error

Returns:

True for success, else False and error is used

Return type:

bool

Enumerate the devices from the daemon.

New in version 0.3.0.

get_daemon_version()
Returns:

string containing the daemon version, e.g. 0.2.0

Return type:

str

Get urfkill daemon version

New in version 0.2.0.

get_devices()
Returns:

a list of Urfkill.Device objects

Return type:

[Urfkill.Device]

Get a list of the device objects.

You must have called Urfkill.Client.enumerate_devices_sync before calling this function.

New in version 0.2.0.

inhibit(reason)
Parameters:

reason (str) – the reason to inhibit the key control

Raises:

GLib.Error

Returns:

the cookie and error is used

Return type:

int

Inhibit the rfkill key handling function for this session.

New in version 0.2.0.

is_inhibited()
Raises:

GLib.Error

Returns:

True if the key control is inhibited

Return type:

bool

Get whether the key control is inhibited or not,

New in version 0.2.0.

set_block(type, block, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

True for success, else False and error is used

Return type:

bool

Block or unblock the devices belonging to the type.

This function only changes soft block. Hard block is controlled by BIOS or the hardware and there is no way to change the state of hard block through kernel functions.

New in version 0.2.0.

set_block_idx(index, block, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

True for success, else False and error is used

Return type:

bool

Block or unblock the device by the index.

This function only changes soft block. Hard block is controlled by BIOS or the hardware and there is no way to change the state of hard block through kernel functions.

New in version 0.2.0.

set_bluetooth_block(block)
Parameters:

block (bool) – True to block the bluetooth devices or False to unblock

Returns:

True for success, else False

Return type:

bool

Block or unblock the bluetooth devices. This is a convenient function and the underlying function is Urfkill.Client.set_block.

New in version 0.2.0.

set_wlan_block(block)
Parameters:

block (bool) – True to block the WLAN devices or False to unblock

Returns:

True for success, else False

Return type:

bool

Block or unblock the WLAN devices. This is a convenient function and the underlying function is Urfkill.Client.set_block.

New in version 0.2.0.

set_wwan_block(block)
Parameters:

block (bool) – True to block the WWAN devices or False to unblock

Returns:

True for success, else False

Return type:

bool

Block or unblock the wireless WAN devices. This is a convenient function and the underlying function is Urfkill.Client.set_block.

New in version 0.2.0.

uninhibit(cookie)
Parameters:

cookie (int) – the cookie

Cancel a previous call to Urfkill.Client.inhibit identified by the cookie.

New in version 0.2.0.

do_device_added(device) virtual
Parameters:

device (Urfkill.Device) –

do_device_changed(device) virtual
Parameters:

device (Urfkill.Device) –

do_device_removed(device) virtual
Parameters:

device (Urfkill.Device) –

do_rf_key_pressed(keycode) virtual
Parameters:

keycode (int) –

Signal Details

Urfkill.Client.signals.device_added(client, device)
Signal Name:

device-added

Flags:

RUN_LAST

Parameters:

The device-added signal is emitted when a rfkill device is added.

New in version 0.2.0.

Urfkill.Client.signals.device_changed(client, device)
Signal Name:

device-changed

Flags:

RUN_LAST

Parameters:

The device-changed signal is emitted when a rfkill device is changed.

New in version 0.2.0.

Urfkill.Client.signals.device_removed(client, device)
Signal Name:

device-removed

Flags:

RUN_LAST

Parameters:

The device-removed signal is emitted when a rfkill device is removed.

New in version 0.2.0.

Urfkill.Client.signals.rf_key_pressed(client, keycode)
Signal Name:

rf-key-pressed

Flags:

RUN_LAST

Parameters:
  • client (Urfkill.Client) – The object which received the signal

  • keycode (int) – the keycode from the input device

The rf-key-pressed signal is emitted when a rfkill key is pressed.

New in version 0.2.0.

Property Details

Urfkill.Client.props.daemon_version
Name:

daemon-version

Type:

str

Default Value:

None

Flags:

READABLE

The running daemon version.

New in version 0.2.0.

Urfkill.Client.props.key_control
Name:

key-control

Type:

bool

Default Value:

False

Flags:

READABLE

Whether the key control in the daemon is enabled or not

New in version 0.2.0.