I would like to toggle my wifi with the Fn+F9 key combination on my Samsung laptop in Fedora with XFCE. I have this script:
#!/bin/bash if [ $(rfkill list wifi | grep ": yes" | wc -l) -eq 1 ] ; then rfkill unblock wifi else rfkill block wifi fi
I have binded this script in the Keyboard settings to the key combination, but it fails to toggle the wifi as it is not run as root. How can I change this?