0

How do I add multiple commands to one shortcut? Adding something like

xdotool getactivewindow windowmove 0 0 && xdotool getactivewindow windowsize 50% 50%

doesn't work, but either command in isolation works. I'm not sure if I'm doing something wrong.

1

You can create a script that does the same thing and assign it to the custom shortcut. For instance, ~/.local/bin/my_script:

#!/bin/sh
xdotool getactivewindow windowmove 0 0
xdotool getactivewindow windowsize 50% 50%
  • Thanks for the reply, but is this desired behavior? I can't think of a reason why the keyboard shortcut menu only accepts one command. – Jack Black May 14 '17 at 8:38
  • It is a custom command so I don't think there is a shell call. That is, the command is not parsed by a shell that would be able to tell that you want two separate commands separated by && but as a single command with the rest of the line as its arguments… – lemonslice May 14 '17 at 9:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.