0

I would like to add a keyboard shortcut using sxhkd let me select a region of my desktop to screenshot using scrot. This should be accomplished by adding this section to my sxhkd file,

ctrl + alt + x
    scrot --select

but this doesn't work. The command scrot --select works fine when issued from a terminal, and this keyboard shortcut works fine if I change --select to something non-interactive like --focused, so I'm not sure why the above sxhkd entry is not working, but I suspect that it has to do with --select being interactive. Why doesn't this work?

Mike Pierce
  • 737
  • 1
  • 6
  • 23

1 Answers1

2

According to this similar question the command scrot --select also grabs control of your keyboard (and will cancel the screenshot if a key is pressed). So you need to tell sxhkd to run the scrot command after the keys are released. This can be done by adding an @.

ctrl + alt + @x
    scrot --select
Mike Pierce
  • 737
  • 1
  • 6
  • 23