So I want to kill the Network Manager Process with the click of a key.
I wrote this line and assigned it to a keyboard shortcut
NM=`ps -e | grep NetworkManager | sed 's/ \([0-9]*\).*/\1/g'` ; sudo kill $NM
When run in the terminal, it asks for my password, of course, but it will not work at all as a keyboard shortcut. Is there anyway to feed my password to the prompt or any other way around this?