this post was submitted on 08 Sep 2024
6 points (100.0% liked)

i3 Window Manager

245 readers
1 users here now

About

Community for the i3 window manager and its popular fork i3-gaps.

Resources

founded 3 years ago
MODERATORS
 

Here are a few bindings in my i3 config file that I find super useful (bear in mind that I use a Kensington Expert Mouse and Button8 is a suitably unusual but still easily clicked button on that trackball, so you may want to change it to something more suitable to your preferred pointing device):

# Clicking the title bar with the upper-right button closes the window (regular default binding, just different button)
bindsym --release button8 kill

# Scrolling over any window title bar controls the volume
bindsym button4 exec pactl set-sink-volume @DEFAULT_SINK@ +5% && $refresh_i3bar
bindsym button5 exec pactl set-sink-volume @DEFAULT_SINK@ -5% && $refresh_i3bar

[...]

bar {

        [...]

        # Clicking the empty space in the bottom bar with the upper-right button opens the launcher
        bindsym button8 exec "rofi -modi drun,run -show drun"

        # Scrolling over the empty space in the bottom bar controls the volume
        bindsym button4 exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +5% && $refresh_i3bar
        bindsym button5 exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -5% && $refresh_i3bar
}

I find those bindings useful because unless a window is open fullscreen - which I rarely do personally - then there's always a window title bar at the top and the bar at the bottom.

As a result, when I quickly want to lower the volume - when the missus yells at me in the middle of the night for example ๐Ÿ™‚ - I can slam the trackball up or down and quickly scroll the volume down.

Similarly, I can move the pointer all the way down and open the launcher with my unusual trackball button, and move all the way back up and close a window by clicking on the appropriate title bar with the same button, so that I don't really have to hit the keyboard most of the time for opening and closing simple stuff.

Anyhow, I thought I'd share.

top 1 comments
sorted by: hot top controversial new old
[โ€“] [email protected] 2 points 2 months ago* (last edited 2 months ago)

Oh and here's another one I forgot:

# Passthrough mode
mode "passthrough" {
        bindsym $mod+Escape mode "default"
}
bindsym $mod+Escape mode "passthrough"

Hit Mod+ESC and your local i3 window manager stops answering any binding apart from Mod+ESC again to escape passthrough mode.

Why is this useful you ask?

If you VNC or RDP into another computer running i3 with the same bindings, this lets you control the remote computer's window manager. Otherwise your local computer captures the bindings and they won't reach the remote computer.