1

As explain in this thread, I want to add shortcuts to switch workspaces (in Mate).

I found a way to switch workspace for the terminal: wmctrl -s $(wmctrl -d | grep "*" | awk '{print $1+1}').

But this command line does not work when I add it in the shortcut manager. Does any one know why ?

2
  • 2
    Does it work if you specifically run it with bash, i.e. set this as shortcut bash -c "wmctrl -s $(wmctrl -d | grep '*' | awk '{print $1+1}')"?
    – Byte Commander
    Mar 16, 2018 at 17:48
  • Yes it works ! You can add it as an answer :)
    – Phantom
    Mar 16, 2018 at 19:40

1 Answer 1

4

IIRC keyboard shortcut commands are running in an sh shell, which doesn't have all the features Bash has.

Your command uses some bash-specific syntax though, which is why it doesn't work. The simplest fix is to simply run it in a Bash shell by replacing it with this command below:

bash -c "wmctrl -s $(wmctrl -d | grep '*' | awk '{print $1+1}')"

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .