0

In MATE there are default shortcuts to switch workspace, by default Ctrl+Alt+arrows keys in the shortcuts manager.

I would like to add other shortcuts to switch workspace (Ctrl+Alt+hjkl)), while keeping the original ones. For this I need the command which is run when we switch workspace.

Does anyone know it?

EDIT:
I found a way to switch workspaces from the terminal (wmctrl -s $(wmctrl -d | grep "*" | awk '{print $1+1}')), but it does not work with shortcuts. I open a new question.

EDIT 2: @Zanna, @N0rbert, @EricCarvalho, @karel, @DavidFoerster: before marking this question as duplicate, did you read both questions !? And did you saw that I ask both questions ?
I asked here, if there was a command to switch workspace, and danzel helped me to find it (not you Zanna, is it why you marked it as duplicate !?). But this command did not work with shortcuts.
The other question is "how to make this command work with shortcuts" ?

So yes I think both are different !

Phantom
  • 153
  • I don't know if it is applicable to Mate, but have you already tried the answers to that question: 41093 ? – danzel Mar 16 '18 at 09:05
  • In the list of shortcuts on MATE, I have unset shortcuts to switch to workspace 1 2 3 4. Isn't that what you want? – Zanna Mar 16 '18 at 09:07
  • @Zanna, I want to add some shortcuts, not disactivate somes ! – Phantom Mar 16 '18 at 10:17
  • @danzel, with wmctrl we can only go to a specifique workspace, it could be good if I have a way to know the id of the workspace in which I am. – Phantom Mar 16 '18 at 10:18
  • Sorry, I didn't mean "have" as an auxiliary verb for the present perfect tense, I meant I am in possession of - there are 4 shortcuts available, unset by default, for switching to each workspace. My oblique suggestion was that you set those unset shortcuts :) – Zanna Mar 16 '18 at 10:21
  • @Phantom, wmctrl -d should give you that information. I do, however, understand that writing a script which parses the information and switches to the correct workspace may be tedious, especially if compiz is used and one has to calculate the correct viewport. I hope that someone has an easier solution. – danzel Mar 16 '18 at 11:08
  • This is not an answer to your question, but just in case you are interested in a workaround: use xdotool (needs to be installed first) in a custom shortcut to simulate the original shortcut. For example: create a custom shortcut "switch to workspace right", and as command enter xdotool key --clearmodifiers ctrl+alt+Right. – danzel Mar 16 '18 at 11:46
  • @Zanna, I misunderstood :s But this way we can access to specific workspace, not to the one at the left, or right... which can be more usefull if we have more than 4 workspaces – Phantom Mar 16 '18 at 12:09
  • @danzel, it's maybe possible to do it with a single command line with grep and awk. I'll look at this – Phantom Mar 16 '18 at 12:13
  • This question is technically unanswered. I voted it as a duplicate of your other question because it's about the same problem. Nobody would want to post an answer to this question that didn't actually work for you; it would be an incomplete answer. If you feel the other question is incomplete, you can add some details from this one to it. I think this question should be deleted because it's unanswerable based on the fact that you asked a new question with the same final purpose – Zanna Mar 17 '18 at 13:21
  • @Zanna, the main purpose of this question is to get a command to switch workplace, and I found one, so the question is answered. But, you're right, my final goal (who is not the final purpose of this question) is not reached. If I didn't asked a new question, I had to modify this one. And when users do that, they are asked to open a new thread, because the new question is different than the one who was in the "original post". So what are we supposed to do in this case !? To summarize, this question was to find a command, and I got it. The other one is to make it work with shortcuts. – Phantom Mar 17 '18 at 14:31
  • it was entirely clear from your original question that you wanted a keyboard shortcut, so a command that didn't work for that purpose would not answer the question... – Zanna Mar 17 '18 at 16:37
  • @Zanna, if you look at the title and the tag, my question is about to get a command. The shortcuts are just the context of the problem, not the problem. I think that is this you didn't understand in the light of your first comments – Phantom Mar 17 '18 at 19:53

0 Answers0