wireless adaptor on/off hotkeys?
wireless adaptor on/off hotkeys?
is this possible in linux, using xbindkeys or something? I have recently been getting a lot of my hotkeys working (audio keys, screen off key, back/forward keys, trackpoint scrolling. (I'd be happy to give people information about these if they want). I can't figure out a command to toggle on/off rather than doing one or the other. is there one?
any ideas?
any ideas?
Frankenpad X31.5 (X31 casing, X32 motherboard) 1.8ghz Pentium M processor, 1gb RAM,
60gb HDD dual booting Arch GNU/Linux && Windows XP
60gb HDD dual booting Arch GNU/Linux && Windows XP
Re: wireless adaptor on/off hotkeys?
Using Lenny on my X41, the hotkeys just work, no fiddling required.
Take a look at acpid if you want to intercept the keystrokes since they don't generate real keyboard events, they are sent as acpi messages instead. You'll just a rule file with a regex to catch the events and then a shell script to execute that passes the event as a parameter to the script. I had to do this with my old Asus Z71v laptop a couple years ago.
Take a look at acpid if you want to intercept the keystrokes since they don't generate real keyboard events, they are sent as acpi messages instead. You'll just a rule file with a regex to catch the events and then a shell script to execute that passes the event as a parameter to the script. I had to do this with my old Asus Z71v laptop a couple years ago.
Re: wireless adaptor on/off hotkeys?
well, I also don't know a command that toggles eth1 on/off. I know how to turn it on, and how to turn it off, but I don't know what command will do one if the other is true.
Frankenpad X31.5 (X31 casing, X32 motherboard) 1.8ghz Pentium M processor, 1gb RAM,
60gb HDD dual booting Arch GNU/Linux && Windows XP
60gb HDD dual booting Arch GNU/Linux && Windows XP
Re: wireless adaptor on/off hotkeys?
man ifup
man ifdown
man ifconfig
man grep
and then find yourself a nice online tutorial for bash scripting.
good luck!
man ifdown
man ifconfig
man grep
and then find yourself a nice online tutorial for bash scripting.
good luck!
Re: wireless adaptor on/off hotkeys?
i'll see what I can do, I guess...
Frankenpad X31.5 (X31 casing, X32 motherboard) 1.8ghz Pentium M processor, 1gb RAM,
60gb HDD dual booting Arch GNU/Linux && Windows XP
60gb HDD dual booting Arch GNU/Linux && Windows XP
Re: wireless adaptor on/off hotkeys?
does anybody happen to know if the wireless adaptor state is contained in a file?
Frankenpad X31.5 (X31 casing, X32 motherboard) 1.8ghz Pentium M processor, 1gb RAM,
60gb HDD dual booting Arch GNU/Linux && Windows XP
60gb HDD dual booting Arch GNU/Linux && Windows XP
-
bluesceada
- Freshman Member
- Posts: 82
- Joined: Thu Mar 05, 2009 7:20 am
- Location: Karlsruhe, Germany
- Contact:
Re: wireless adaptor on/off hotkeys?
For the wireless one, I would just use the killswitch at the front bottom of the laptop.
To get hotkeys working, look with acpi_listen and modify the scripts in /etc/acpi/events/*
For example (pressing Fn+F8 on my X61s when doing acpi_listen):
Means you have to change the "action=" in /etc/acpi/events/lenovo-touchpad to the shellscript or binary you want!
If you can not find a file in the events directory with grep, it means you can create yourself one, just look at the other files in the events directory how to do that!
Have fun and good luck!
WLAN Status can be found here (for iwlagn, for iwl4965 or iwl3965 or whatever, just look for that in /sys/bus/pci/drivers/):
/sys/bus/pci/drivers/iwlagn/0000\:03\:00.0/enable
echoing a zero to it will disable it... echoing a one again will enable it
To get hotkeys working, look with acpi_listen and modify the scripts in /etc/acpi/events/*
For example (pressing Fn+F8 on my X61s when doing acpi_listen):
Code: Select all
$ > acpi_listen
ibm/hotkey HKEY 00000080 00001008
^C
$ > grep "HKEY 00000080 00001008" /etc/acpi/events/*
/etc/acpi/events/lenovo-touchpad:event=ibm/hotkey HKEY 00000080 00001008
If you can not find a file in the events directory with grep, it means you can create yourself one, just look at the other files in the events directory how to do that!
Have fun and good luck!
WLAN Status can be found here (for iwlagn, for iwl4965 or iwl3965 or whatever, just look for that in /sys/bus/pci/drivers/):
/sys/bus/pci/drivers/iwlagn/0000\:03\:00.0/enable
echoing a zero to it will disable it... echoing a one again will enable it
Re: wireless adaptor on/off hotkeys?
aha... plans are slowly coming to me... very slowly. then again it is midnight:04 where I am, so i'm not exactly at my fastest
Frankenpad X31.5 (X31 casing, X32 motherboard) 1.8ghz Pentium M processor, 1gb RAM,
60gb HDD dual booting Arch GNU/Linux && Windows XP
60gb HDD dual booting Arch GNU/Linux && Windows XP
Re: wireless adaptor on/off hotkeys?
so when I was first testing in the python interperator things were going smoothly. the file had 1 written into it and I could turn it to zero by running the command ifconfig eth1 up, however after writing a script that checked to see what the value of the file was, and then ran an ifconfig command that should turn it to the opposite state depending on what it was. no errors happened, but the wireless card didn't turn off. later i found out that the file was stuck on zero regardless of the state of the card.
AAARGH!!!!
AAARGH!!!!
Frankenpad X31.5 (X31 casing, X32 motherboard) 1.8ghz Pentium M processor, 1gb RAM,
60gb HDD dual booting Arch GNU/Linux && Windows XP
60gb HDD dual booting Arch GNU/Linux && Windows XP
Re: wireless adaptor on/off hotkeys?
the actual file doesn't work well so I created my own!!!! MWAHAHAHAHA!!!!
I was able to think about this connundrum more programatically, and now it works.
copy this info into a file and chmod it +x.
the comments explain the necessary user additions.
the official name of the program is "witrog.py" incase anyone cares.
I was able to think about this connundrum more programatically, and now it works.
copy this info into a file and chmod it +x.
the comments explain the necessary user additions.
the official name of the program is "witrog.py" incase anyone cares.
Code: Select all
#!/usr/bin/python
#second try at wifi command
######################################################################################
#you'll need to somehow have the file $HOME/wistate have whatever state your wireless#
#card is normally in when your computer starts up written to it at start up. my #
#recommendation would be adding a line "echo 1 > $HOME/wistate" to your rc.local #
#1 is equivalent to on, 0 is equivalent to off #
######################################################################################
#$HOME doesn't register as anything in python, so you'll have to input the full /home/user
#here; this is the file this program will be reading for wireless state. you can make it hidden by
#naming it .wistate instead of just wistate...
FILE="$HOME/wistate"
#in both of these lines, here, replace eth1 with whatever your wireless adapter is called
spool="ifconfig eth1 up"
pants="ifconfig eth1 down"
import os
f=open(FILE, "r")
fridge=f.read()
f.close()
if fridge=="1\n":
os.system(pants)
f=open(FILE, "w")
f.write("0\n")
f.close()
elif fridge=="0\n":
os.system(spool)
f=open(FILE, "w")
f.write("1\n")
f.close()
else:
print "failure"
#this command is to make this script automatically calibrate itself after a few runs
#if all else fails:
f=open(FILE, "w")
f.write("0\n")
f.close()Frankenpad X31.5 (X31 casing, X32 motherboard) 1.8ghz Pentium M processor, 1gb RAM,
60gb HDD dual booting Arch GNU/Linux && Windows XP
60gb HDD dual booting Arch GNU/Linux && Windows XP
-
bluesceada
- Freshman Member
- Posts: 82
- Joined: Thu Mar 05, 2009 7:20 am
- Location: Karlsruhe, Germany
- Contact:
Re: wireless adaptor on/off hotkeys?
Normally you shouldn't need that and using the sysfs files should be alright.
And are you sure that you can turn wireless off using ifconfig commands? I would say that isn't really possible... they just turn the network connection off, not the device...
And are you also sure, that eth1 is your wireless device and not your ethernet network adapter? They are in most distros called wlan0 wlan1 etc. nowadays.
For the intel devices my description is the recommended way of really turning them off (see here: http://www.lesswatts.org/tips/wireless.php ). For an atheros card it might be different though.
And are you sure that you can turn wireless off using ifconfig commands? I would say that isn't really possible... they just turn the network connection off, not the device...
And are you also sure, that eth1 is your wireless device and not your ethernet network adapter? They are in most distros called wlan0 wlan1 etc. nowadays.
For the intel devices my description is the recommended way of really turning them off (see here: http://www.lesswatts.org/tips/wireless.php ). For an atheros card it might be different though.
Re: wireless adaptor on/off hotkeys?
well eth1 was definately my device at that time. since my motherboard update, for some reason, it changed to eth0. whatever. It probably doesn't turn the actual connection off, but it does turn the status light off...
Frankenpad X31.5 (X31 casing, X32 motherboard) 1.8ghz Pentium M processor, 1gb RAM,
60gb HDD dual booting Arch GNU/Linux && Windows XP
60gb HDD dual booting Arch GNU/Linux && Windows XP
-
bluesceada
- Freshman Member
- Posts: 82
- Joined: Thu Mar 05, 2009 7:20 am
- Location: Karlsruhe, Germany
- Contact:
Re: wireless adaptor on/off hotkeys?
You are sure? And what would your wired network device be then?
But ok, if ifconfig turns the wlan status lights off, it should be ok.
But ok, if ifconfig turns the wlan status lights off, it should be ok.
Re: wireless adaptor on/off hotkeys?
yeah, I am sure, I've used it more than a few times. wired network is atm eth1, used to be eth0.
Frankenpad X31.5 (X31 casing, X32 motherboard) 1.8ghz Pentium M processor, 1gb RAM,
60gb HDD dual booting Arch GNU/Linux && Windows XP
60gb HDD dual booting Arch GNU/Linux && Windows XP
-
bluesceada
- Freshman Member
- Posts: 82
- Joined: Thu Mar 05, 2009 7:20 am
- Location: Karlsruhe, Germany
- Contact:
Re: wireless adaptor on/off hotkeys?
Eh yeah... I thought the topic was about the wireless adapter 
Re: wireless adaptor on/off hotkeys?
it is about the wireless adaptor, but more about a script to toggle it.
also on my new laptop I was pretentious and put my wistate file in /usr/share/witrog/, and the script of course in /usr/bin, but that's for convenience, not to feel cool
also on my new laptop I was pretentious and put my wistate file in /usr/share/witrog/, and the script of course in /usr/bin, but that's for convenience, not to feel cool
Frankenpad X31.5 (X31 casing, X32 motherboard) 1.8ghz Pentium M processor, 1gb RAM,
60gb HDD dual booting Arch GNU/Linux && Windows XP
60gb HDD dual booting Arch GNU/Linux && Windows XP
-
- Similar Topics
- Replies
- Views
- Last post
-
-
T450 - Brightness control hotkeys not working after system wake
by Czechnology » Tue Jan 10, 2017 9:05 am » in ThinkPad T430/T530 and later Series - 0 Replies
- 416 Views
-
Last post by Czechnology
Tue Jan 10, 2017 9:05 am
-
-
-
L420 All hotkeys work except for the speaker mute light
by razoreater » Sun Apr 16, 2017 4:45 pm » in ThinkPad SL and L Series - 8 Replies
- 935 Views
-
Last post by RealBlackStuff
Mon Apr 17, 2017 6:29 am
-
-
-
T60 1952A97. WIRELESS LAN VS WIRELESS WAN CONFUSION.
by slaterlp » Sat Mar 04, 2017 12:16 pm » in ThinkPad T6x Series - 17 Replies
- 1368 Views
-
Last post by ajkula66
Fri Mar 10, 2017 6:31 am
-
-
-
X1C 4TH GEN - Can I pop off keys to rearrange them?
by bittercactus » Mon Feb 06, 2017 3:18 am » in ThinkPad X1/X1C - 1 Replies
- 614 Views
-
Last post by w0qj
Sun Feb 12, 2017 10:36 am
-
Who is online
Users browsing this forum: No registered users and 1 guest



