2016-07-28 08:02:34

by Kai Hendry

[permalink] [raw]
Subject: rfkill bound to a switch

Hi there,

Since laptops typically have a toggle button for killing and enabled
wifi, how does one supposed to bind rfkill like a toggle?

I.e. knowing which state you are in so you can call {block,unblock}
accordingly?

Parsing event or list output seems non-trivial.


Kind regards,


2016-08-01 09:16:05

by Johannes Berg

[permalink] [raw]
Subject: Re: rfkill bound to a switch

On Thu, 2016-07-28 at 16:02 +0800, Kai Hendry wrote:
> Hi there,
>
> Since laptops typically have a toggle button for killing and enabled
> wifi, how does one supposed to bind rfkill like a toggle?
>
> I.e. knowing which state you are in so you can call {block,unblock}
> accordingly?
>
> Parsing event or list output seems non-trivial.
>

Don't use the rfkill tool - just open /dev/rfkill yourself, the API is
really simple.

johannes