View previous topic :: View next topic |
Author |
Message |
BenderBendingRodriguez Tux's lil' helper


Joined: 19 Feb 2010 Posts: 101
|
Posted: Mon May 17, 2010 8:03 pm Post subject: Assign echo 0 /1 >> /sys/class/rfkill/rfkill0/state to |
|
|
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 |
|
Back to top |
|
 |
Ant P. Watchman

Joined: 18 Apr 2009 Posts: 6920
|
Posted: Mon May 17, 2010 10:54 pm Post subject: |
|
|
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:
Code: | # /etc/acpi/default.sh
# ...
case "$group" in
button)
case "$action" in
zoom)
/etc/acpi/actions/bluetooth_toggle.sh
;;
esac
;;
esac |
Code: | # /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
|
|
|
Back to top |
|
 |
haarp Guru

Joined: 31 Oct 2007 Posts: 535
|
Posted: Wed May 19, 2010 8:40 am Post subject: |
|
|
Does xbindkeys support ACPI events? |
|
Back to top |
|
 |
|