Ändern der Fenstergröße in i3 nur mit der Tastatur


20

Ich versuche, meinen Computer (mit Crunchbang Linux Waldorf und i3) so einzurichten, dass er standardmäßig immer so konfiguriert ist, dass durch Drücken von Strg + Umschalttaste und Pfeiltasten die Größe des Fensters gemäß der Pfeilrichtung geändert wird.

Das i3-Benutzerhandbuch enthält dieses Beispiel, das meiner Meinung nach dem sehr nahe kommt, was ich möchte:

mode "resize" {
    # These bindings trigger as soon as you enter the resize mode

    # Pressing left will shrink the window’s width.
    # Pressing right will grow the window’s width.
    # Pressing up will shrink the window’s height.
    # Pressing down will grow the window’s height.
    bindsym j           resize shrink width 10 px or 10 ppt
    bindsym k           resize grow height 10 px or 10 ppt
    bindsym l           resize shrink height 10 px or 10 ppt
    bindsym semicolon   resize grow width 10 px or 10 ppt

    # same bindings, but for the arrow keys
    bindsym Left        resize shrink width 10 px or 10 ppt
    bindsym Down        resize grow height 10 px or 10 ppt
    bindsym Up          resize shrink height 10 px or 10 ppt
    bindsym Right       resize grow width 10 px or 10 ppt

    # back to normal: Enter or Escape
    bindsym Return mode "default"
    bindsym Escape mode "default"
}

# Enter resize mode
bindsym $mod+r mode "resize"

Aber ich möchte es nativ einbauen, ohne in den Größenänderungsmodus ein- und aussteigen zu müssen. Ich möchte nur die Pfeiltasten verwenden, nicht die Tasten j, k, l und das Semikolon.

Irgendwelche Gedanken darüber, wie ich das machen würde?

Antworten:


13

Beste Lösung, die ich selbst herausgefunden habe:

Gehe zu ~/.i3/configund öffne die Datei.

Füge folgenden Code am Ende ein:

bindsym $mod+Ctrl+Right resize shrink width 1 px or 1 ppt
bindsym $mod+Ctrl+Up resize grow height 1 px or 1 ppt
bindsym $mod+Ctrl+Down resize shrink height 1 px or 1 ppt
bindsym $mod+Ctrl+Left resize grow width 1 px or 1 ppt

Speichern Sie es und starten Sie i3 neu.


4

Basierend auf der @ Oposum- Lösung habe ich eine "schnelle Größenänderung" hinzugefügt:

# Resizing windows by 10 in i3 using keyboard only
bindsym $mod+Ctrl+Shift+Right resize shrink width 10 px or 10 ppt
bindsym $mod+Ctrl+Shift+Up resize grow height 10 px or 10 ppt
bindsym $mod+Ctrl+Shift+Down resize shrink height 10 px or 10 ppt
bindsym $mod+Ctrl+Shift+Left resize grow width 10 px or 10 ppt

Also in meinem habe ~/.i3/configich:

# Resizing windows in i3 using keyboard only
# /unix//q/255344/150597

# Resizing by 1
bindsym $mod+Ctrl+Right resize shrink width 1 px or 1 ppt
bindsym $mod+Ctrl+Up resize grow height 1 px or 1 ppt
bindsym $mod+Ctrl+Down resize shrink height 1 px or 1 ppt
bindsym $mod+Ctrl+Left resize grow width 1 px or 1 ppt

# Resizing by 10
bindsym $mod+Ctrl+Shift+Right resize shrink width 10 px or 10 ppt
bindsym $mod+Ctrl+Shift+Up resize grow height 10 px or 10 ppt
bindsym $mod+Ctrl+Shift+Down resize shrink height 10 px or 10 ppt
bindsym $mod+Ctrl+Shift+Left resize grow width 10 px or 10 ppt

Wie @Oposum sagte: Speichere es und starte i3 neu ($ mod + Shift + R).


1
Sie haben dort die gleichen Bindungen.
cprn

1
@cprn Richtig! Feste
aloisdg sagt wieder einzusetzen Monica
Durch die Nutzung unserer Website bestätigen Sie, dass Sie unsere Cookie-Richtlinie und Datenschutzrichtlinie gelesen und verstanden haben.
Licensed under cc by-sa 3.0 with attribution required.