18

enter image description here

By default, instead of doing something useful, the Ctrl-Alt-Numpad key combination in Gnome 3 shoves a window in the specified direction across the entire workspace. These shortcuts do not show in the Gnome 3 keyboard settings panel; they're just there, and they're in the way.

How can I get this behavior back in Ubuntu 17.10?

Pablo Bianchi
  • 15,657
badp
  • 12,372
  • Do you tried this? – αғsнιη Aug 21 '17 at 14:56
  • 1
    @AFSHIN that's for Ctrl-Alt-Fn, something which is also broken in aardvark, but is not relevant to this question :) – badp Aug 21 '17 at 15:06
  • maybe you mean Fn function key? – αғsнιη Aug 21 '17 at 15:07
  • 1
    @AFSHIN This question is about Ctrl-Alt-numpad (so Ctrl-Alt-Numpad 7 puts a window in that monitor's upper left quarter) – badp Aug 21 '17 at 15:09
  • @sempaiscuba compiz config isn't going to do me much good on Gnome 3… – badp Aug 22 '17 at 05:56
  • 1
    That image appears that you have your main screen broken into 6 regions. Can I ask how you did that? That's exactly what I'm after! I only have the default 4. – Madivad Aug 24 '17 at 02:28
  • @Madivad three monitors, each split in half – badp Aug 24 '17 at 05:56
  • oh yeah, I see it now. I thought it was one monitor split into 6. For a 4K monitor that would be awesome, then again, 3 monitors split in half is probably more awesome lol – Madivad Aug 24 '17 at 09:40
  • This really could use some clarifying. Remember that not everyone uses unity. What is the default action of Ctrl+Alt+Number on unity that you want to get back? What is the "sad built-in default Ctrl-Alt-Fn combination" and what does it do? I've read your question through twice and still don't understand what you need. – terdon Sep 14 '17 at 09:24
  • @tttppp can you post that as an answer? – badp Nov 01 '17 at 11:41
  • I just realised that the extension is mentioned in your question – tttppp Nov 01 '17 at 11:41
  • I made a chat for this: https://chat.stackexchange.com/rooms/68005/room-for-tttppp-and-badp – tttppp Nov 01 '17 at 11:44
  • @badp Ok - posted as an answer. – tttppp Nov 01 '17 at 16:41

3 Answers3

12

I first followed the these instructions on how to disable the "move-to-corner" shortcuts with dconf-editor. I'm not sure if this is a necessary step or not.

gsettings set org.gnome.desktop.wm.keybindings move-to-corner-se "['disabled']"
gsettings set org.gnome.desktop.wm.keybindings move-to-corner-sw "['disabled']"
gsettings set org.gnome.desktop.wm.keybindings move-to-corner-nw "['disabled']"
gsettings set org.gnome.desktop.wm.keybindings move-to-corner-ne "['disabled']"

Then I have tried installing the Put Windows gnome extension on Ubuntu 17.10, and it seems to work fine.

  1. Install the browser plugin for https://extensions.gnome.org

    sudo apt-get install chrome-gnome-shell
    

    GNOME Shell extensions integration for web browsers. Provides integration with GNOME Shell extensions repository for Chromium (and derivatives) and Firefox.

  2. Visit the Put Windows page and install the extension

  3. Refresh the page

  4. Click the blue spanner/screwdriver settings symbol on the page:

    screenshot

  5. Go to "Keyboard Shortcuts" (also through Gnome Tweaks) and modify the actions to be Ctrl+Alt+Num, etc. By default, uses Super+Num.

You mentioned in one version of your question that you tried this extension and after restarting the machine you needed to manually reconfigure the shortcuts. I tested restarting my machine and had no such problems.

Pablo Bianchi
  • 15,657
tttppp
  • 265
6

I figured it out, you need to change the settings using dconf:

This will move windows to corners without resizing it.

enter image description here

In dconf, look for org>desktop>wm>keybindings and click on the field next to move-to-corner-se and change it to ['disabled']:

enter image description here

and repeat for all the ones that you want to disable, i.e., move-to-corner-sw, etc.

Alternatively you can do it from the command-line like this:

gsettings set org.gnome.desktop.wm.keybindings move-to-corner-se "['disabled']"

and restore it like this:

gsettings set org.gnome.desktop.wm.keybindings move-to-corner-se "['<Primary><Alt>KP_Next']"

List all with gsettings list-recursively | grep move-to-corner.

See also org.gnome.desktop.wm.keybindings in https://wiki.ubuntu.com/Keybindings

org.gnome.desktop.wm.keybindings

Keybindings that are handled by the window manager are persisted in the org.gnome.desktop.wm.keybindings section of dconf. The "Navigation", and "Windows" categories of shortcuts are stored here. In the past, each window manager was responsible for storing its own shortcuts under its own schema. Now both the metacity and compiz window managers use this central, unified set of bindings. There are mapping files in /usr/share/gnome-control-center/keybindings/ that show how these key bindings are used by each window manager.

If using Compiz

If you are still using Compiz in some way with gnome3, see below:

From here, I was able to disable the keys in my Ubuntu 16.04 Laptop (unity 7.4.0). The steps below is what you are looking for.

Warning

CompizConfig Settings Manager (ccsm) is an advanced tool, and not all of its options are completely compatible with Unity. As such, CCSM has been known to sometimes break users' desktops. Please use caution and know that you are taking a risk by following this answer or any other answer that recommends the use of CCSM. In the event that following this advice does break Unity, please see this question for instructions on how to reset it.

You need to install compizconfig-settings-manager, under Ubuntu software: enter image description here

run it and under the "Window Management" section select "Grid":

enter image description here

On the grid menu click on the edit pencil and uncheck the "Enable" box: enter image description here

Pablo Bianchi
  • 15,657
user3325563
  • 139
  • 8
  • This is for Compiz, not Gnome 3 – badp Aug 23 '17 at 16:53
  • Sorry about that: What Ubuntu are you running? How did you install gnome? I assume UbuntuGnome? which version? – user3325563 Aug 23 '17 at 17:03
  • Are you using gdm or lightdm? Just setup a system and installed sudo apt install ubuntu-gnome-desktop (chose lightdm but I can reconfigure) – user3325563 Aug 23 '17 at 20:53
  • for the record, it seems like it is still using compiz/unity from the output of wmctrl -m and printf 'Desktop: %s\nSession: %s\n' "$XDG_CURRENT_DESKTOP" "$GDMSESSION", which would mean that my response above might be the answer. – user3325563 Aug 23 '17 at 20:55
  • @badp going to install gnome-shell and reconfigure to gdm, but it would help if you tell me more about what you have. – user3325563 Aug 23 '17 at 20:57
  • @badp going to install gnome-shell and reconfigure to gdm and uninstall unity, but it would help if you tell me more about what you have. – user3325563 Aug 24 '17 at 02:01
  • @badp alright buddy, I think you now have your answer, see the edits above. – user3325563 Aug 24 '17 at 02:13
  • @badp let me know if it worked for you. If it did, don't forget to accept the answer and award the bounty, thanks! – user3325563 Aug 24 '17 at 12:32
  • While this doesn't answer the question -- How do I restore the Unity 7 Ctrl-Alt-Numpad combination behaviour on Gnome 3? -- it helps mitigate a frustration I had with the plugin I'd found. Enjoy your half the bounty – badp Aug 28 '17 at 16:17
  • I have not received anything, half bounty needs a minimum of 2 votes. – user3325563 Sep 14 '17 at 01:41
  • I did answer your question "How can I disable the sad built-in default Ctrl-Alt-Fn combination?", your title question is nowhere in the body of the post. On top of that, I did solved your problem, I should have had received the full bounty. – user3325563 Sep 14 '17 at 01:41
  • For future reference, you need to work on improving your question and answering to questions. From your behavior, it gives the impression you never had the intention to award the bounty. – user3325563 Sep 14 '17 at 01:55
  • 1
    too bad, I guess no one else thought your solution was good enough. You did not answer the fundamental problem — arranging windows in the upper/lower halves of my screen. You helped me with my XY problem: "I found this shitty thing that sorta does it, and I don't like it, but with this disabling of the original key combination I expect it would be slightly more tolerable." Half of your answer is about Compiz and that makes it completely irrelevant. Better luck next time in your quest for virtual internet points – badp Sep 14 '17 at 06:56
3

On Ubuntu 18.04.1 LTS, simply install the Put Windows Gnome extension through Ubuntu Software Center to restore the window positioning via numpad. No further settings changes are needed.

Pablo Bianchi
  • 15,657