bindsym not working -- command works fine in terminal
I have set this keybind in order to switch layouts with $mod+space(duh!). However, while the command works fine when run in rxvt with bash, it doesnt seem to work with the keybind. $SHELL is /bin/bash and I have disabled the other $mod+space keybind so overlapping keybinds is not the problem.
bindsym $mod+space exec "setxkbmap -layout $([[ $(setxkbmap -query | awk '/layout/{ print $2 }') == us ]] && echo 'gr' || echo 'us')"
Running version 4.8 on Jessie.