I'm using Ubuntu 16.04 with Unity.

Is possible to change Super+D shortcut?. I have changed in Configuration --> Keyboard --> Navigation --> Hide all normal windows, but this has not effect.

I want to put "Hide all windows" in Super+V and for this I have disabled lenses using next command:

$ dconf write /com/canonical/unity/dash/scopes "['home.scope']"

Note: I have installed Compiz Manager.

share|improve this question
1  
I'll have to look into it a bit more tomorrow, but it seems that the shortcut is hard coded in Unity. We can however add another shortcut (Super+V if you disabled it) to show (toggle) desktop. Would you consider that to be usefull? Super+D would also still work. I cannot find a dconf key in dconf dump / that would disable that one. Going to sleep now... – Jacob Vlijm Mar 24 '17 at 22:52
    
Yes, I think is hardcoded too, but with what action? I supposed that "hardcoded problem" would disappear with dconf command... At this moment, Super+V don't show videos... And yeah, Super+D still working, this is not a big problem for me because I can use Super+D... but I want to know if anyone have a solution for this, I'm curious about this "problem". Thanks for your interest !!! – Dani Mar 24 '17 at 23:04
    
Hi Dani, If it is coded into Unity, with no option to disable (that's how it looks), we cannot get rid of it, but, we can add a script to do the very same to the shortcut Super+V. I will post it if you think that's useful. – Jacob Vlijm Mar 25 '17 at 5:55
    
Hi, I edited my post. I do not know if there has been a confusion, but the thing I want is to put Super+D (hide all windows) in Super+V, not the opposite. Obviously this is not a very important issue because at the moment I can use Super+D, but i'm curious about this. And thank you again :D. – Dani Mar 25 '17 at 9:42
    
Haha, yes I got that. See my answer :) – Jacob Vlijm Mar 25 '17 at 12:37
up vote 2 down vote accepted

How to make Super + v switch/toggle to the desktop

I was busy writing a script for it, but then a simple, pragmatic solution popped into my mind:

  1. Install xdotool, to simulate key press:

    sudo apt install xdotool
    
  2. Disable Super+v by the command:

    gsettings set com.canonical.Unity.Dash scopes ['']
    
  3. Create a custom shortcut: choose: System Settings > "Keyboard" > "Shortcuts" > "Custom Shortcuts". Click the "+" and add the command:

    /bin/bash -c "sleep 0.3 && xdotool key Super+d"
    

    to Super+v.

Now pressing Super+v will toggle the desktop.

Explanation

Since you don't mind leaving Super+d exist, you can make Super+v virtually press Super+d, with the help of xdotool, running the command:

xdotool key Super+d

The sleep 0.3 is to make sure the real key press does not interfere with the virtual one.

share|improve this answer
    
Yeah, this works. Thanks you very much for your effort, I didn't know anything about xdotool, this is a tool for simulate keypress?... so you can program in C, for example, and use it for simulate other things, no?. Other question, the reason why you use sleep is for avoid system detect Super+D and Super+V pressed at same time? – Dani Mar 25 '17 at 17:06
1  
@Dani ah, great that you like it :) Indeed, one of the things you can do with xdotool is simulate key press. The break is to prevent the virtual keypress to be at the same time as the resl one, which would make an unwanted press altogether. – Jacob Vlijm Mar 25 '17 at 20:06

You can go to system settings -> keyboard -> shortcuts. From there you can select the navigation menu, search for the hide all windows entry, click on the present shortcut (e.g. Super+d), and enter enter your new shortcut (press Super+v)

enter image description here

share|improve this answer
    
Uhm, that's exactly what OP mentioned not to work, which I can confirm. Did you try? – Jacob Vlijm Mar 24 '17 at 22:34
    
Not working by this way... – Dani Mar 24 '17 at 22:36
    
Or I blatantly read over it, or OP edited the question. Anyways, if you click on the right-hand column with the shortcut, it will ask you to enter the shortcut. It works for me running Ubuntu 16.04 LTS – Peetah Mar 24 '17 at 22:37
    
Not here, also 16.04. Please try the shortcut afterwards. Seems to be hard-coded. – Jacob Vlijm Mar 24 '17 at 22:38
    
hold on, let me take a picture of what I mean – Peetah Mar 24 '17 at 22:39

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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