Make use of that physical button on the side of your laptop to run scripts instead of only turning your wifi on/off.
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
then e734789abd added audible 'beep' pirms 4 gadiem
README.md added audible 'beep' pirms 4 gadiem

README.md

lenovo_radio_button

Make use of that physical button on the side of your laptop to run scripts instead of only turning your wifi on/off.

#!/bin/sh

# Simple bash script to run any command using the hardware radio switch on lenovo thinkpad x201 

# The script checks the status of your wifi card's transmit power.

# Important, the script below assumes your wifi is ON when running the script. It checks this every two seconds and when you flip the switch will run a command (echo "Wifi is OFF") and stop the script (break)

while true; do
if iwconfig wlp2s0 | grep 'Tx-Power=off' > /dev/null; then
	echo -e '\a' #beep to indicate interaction
        echo "Wifi is OFF"
	break
else
	echo "Wifi is ON"
fi
sleep 2
done