# Calculate chmod=0755 comment=# load(char,/sys/bus/pci/devices/0000:03:00.0/vendor,root)==0x8086&&load(char,/sys/bus/pci/devices/0000:03:00.0/device,root)==0x423d
#!/bin/bash
# toggle wifi

#?pkg(media-fonts/droid)!=#
FONT='-*-droid sans-bold-*-*-*-34-*-*-*-*-*-*-*'
#!pkg#
FONT='-adobe-helvetica-bold-*-*-*-34-*-*-*-*-*-*-*'
#pkg#
DELAY=1

if lsmod | grep -q iwlagn
then
    sudo rmmod iwlagn
    message="Wifi disable"
else
    sudo modprobe iwlagn
    message="Wifi enable"
fi
 
if which kdialog &>/dev/null
then
	kdialog --passivepopup "${message}" --title "Wifi" ${DELAY}
elif which osd_cat &>/dev/null
then
	osd_cat -A center -p middle -f "${FONT}" -d ${DELAY} << EOF
${message}
EOF
fi
exit 0
