I have a bash script for enabling and disabling wifi that I want to bind to shortcut:
#!/bin/bash
if [ $(rfkill list wifi | grep "Soft blocked: yes" | wc -l) -gt 0 ] ; then
rfkill unblock wifi
notify-send "Enabled Wireless"
else
rfkill block wifi
notify-send "Disabled Wireless"
fi
I have made the script executable by running:
chmod +x script.sh
In .xbindkeysrc I have:
"path/to/script.sh"
F1
After that I have run xbindkeys in terminal and tried to press F1 but nothing happens.
I verified that script does work when executed manually. I tried different bind keys like Alt + y etc.
What did I do wrong?
xbindkeys -kxbindkeyson startup or is there a way to autostart it?