imagemagick's import shell command takes snapshots of ones desktop. Executing
import /tmp/foo.png
will convert my cursor into a crosshair and will allow me to select a screen area to capture. However, if I attempt to bind that very command to an i3wm-hotkey it does not work.
The following keybind in my i3wm config file
# ...
bindsym $mod+m exec "import /tmp/foo.png"
# ...
produces the following error (which I can pipe out to a terminal):
import-im6.q16: unable to grab mouse `': No such file or directory @ error/xwindow.c/XSelectWindow/9187.
Why is that and how can I make it work?