# Assign echo 0 /1 >> /sys/class/rfkill/rfkill0/state to key

## BenderBendingRodriguez

Hello everybody

Today i am coming with a rather hard thing (at least for me). I am using a Samsung N130 netbook right now and i wanted to assign  a combination of keys (Fn + F9) to toggle wifi state which exists currently at     /sys/class/rfkill/rfkill0/state  

I can successfully toggle the state from konsole but i'd love to have it assigned to the aforementioned keys...

I've read some wiki's about that but i haven't even got slightest idea how to do it...

echo 0 > /sys/class/rfkill/rfkill0/state shuts down wifi while 

echo 1 > /sys/class/rfkill/rfkill0/state turns it on

How can i accomplish this please

----------

## Ant P.

I've got an Asus where most of the Fn-* keys generate ACPI events, here's the relevant bits from my /etc/acpi/ stuff if it's any use:

```
# /etc/acpi/default.sh

# ...

case "$group" in

    button)

        case "$action" in

            zoom)

                /etc/acpi/actions/bluetooth_toggle.sh 

                ;;

        esac

        ;;

esac
```

```
# /etc/acpi/actions/bluetooth_toggle.sh

hw_rfkill="/sys/class/rfkill/rfkill1"

[ -d $hw_rfkill ] || {

    logger "acpi: rfkill1 not found for bluetooth"

    exit 1

}

if [ $(< $hw_rfkill/state) -eq "0" ]; then

    echo 1 > $hw_rfkill/state

    # This has some weird double rfkill setup for the bluetooth, you probably don't need these lines:

    sleep 2

    for i in /sys/class/bluetooth/hci0/rfkill*; do

        echo 1 > $i/state

    done

else

    echo 0 > $hw_rfkill/state

fi

```

----------

## haarp

Does xbindkeys support ACPI events?

----------

