Where to Discuss?

Preface

Goal: Explaining openbox key and mouse binding in rc.xml configuration.

Table of Content


1: Key Binding

There is a whole article for this.

Source

Format

The format is:

  <keyboard>
    ...
    <keybind key="C-A-Left">
      <action name="GoToDesktop">
        <to>left</to>
        <wrap>no</wrap>
      </action>
    </keybind>
    ...
  </keyboard>

Summarize

Rather than, go deep into rc.xml. I just want to put my key binding here. I have limited brain capacity. I need to write down as below.

# Keybindings for desktop switching

C-A-Left:   GoToDesktop:   left
C-A-Right:  GoToDesktop:   right
C-A-Up:     GoToDesktop:   up
C-A-Down:   GoToDesktop:   down

S-A-Left:   SendToDesktop: left
S-A-Right:  SendToDesktop: right
S-A-Up:     SendToDesktop: up
S-A-Down:   SendToDesktop: down

W-F1:       GoToDesktop:   1
W-F2:       GoToDesktop:   2
W-F3:       GoToDesktop:   3
W-F4:       GoToDesktop:   4

W-d:        ToggleShowDesktop

# Keybindings for windows

A-F4:       Close
A-Escape:   Lower, FocusToBottom, Unfocus
A-space:    ShowMenu:      client-menu

# Keybindings for window switching 

A-Tab:      NextWindow - Focus, Raise, Unshade
A-S-Tab:    PreviousWindow - Focus, Raise, Unshade
C-A-Tab:    NextWindow - Focus, Raise, Unshade

# Keybindings for window switching with the arrow keys 

W-S-Right:  DirectionalCycleWindows: right
W-S-Left:   DirectionalCycleWindows: left
W-S-Up:     DirectionalCycleWindows: up
W-S-Down:   DirectionalCycleWindows: above

# Keybindings for running applications

W-e:        Execute: urxvt

The last line, it is actually xterm terminal, but I change it to urxvt.


2: Mouse Binding

The format is:

  <mouse>
    ...
    <context name="Frame">
      <mousebind button="A-Left" action="Press">
        <action name="Focus"/>
        <action name="Raise"/>
      </mousebind>
      ...
    </context>
  </mouse>

Summarize

# Context: Frame

A-Left:     Press:         Focus, Raise
A-Left:     Click:         Unshade
A-Left:     Drag:          Move

A-Right:    Press:         Focus, Raise, Unshade
A-Right:    Drag:          Resize

A-Middle:   Press:         Lower, FocusToBottom, Unfocus

A-Up:       Click:         GoToDesktop:    previous
A-Down:     Click:         GoToDesktop:    next

C-A-Up:     Click:         GoToDesktop:    previous
C-A-Down:   Click:         GoToDesktop:    next

A-S-Up:     Click:         SendToDesktop:  previous
A-S-Down:   Click:         SendToDesktop:  next

# Context: Titlebar

Left:       Drag:          Move
Left:       DoubleClick:   ToggleMaximize
Up:         Click:         if not shaded:  Shade, FocusToBottom, Unfocus, Lower
Down:       Click:         if shaded:  Unshade, Raise

# Context: Titlebar Top Right Bottom Left TLCorner TRCorner BRCorner BLCorner

Left:       Press:         Focus, Raise, Unshade
Middle:     Press:         Lower, FocusToBottom, Unfocus
Right:      Press:         Focus, Raise, ShowMenu

# Context: Top

Left:       Drag:          Resize:         top

# Context: Left

Left:       Drag:          Resize:         left

# Context: Right

Left:       Drag:          Resize:         right

# Context: Bottom

Left:       Drag:          Resize:         bottom
Right:      Press:         Focus, Raise, ShowMenu

# Context: TRCorner BRCorner TLCorner BLCorner

Left:       Press:         Focus, Raise, Unshade
Left:       Drag:          Resize

# Context: Client

Left:       Press:         Focus, Raise
Middle:     Press:         Focus, Raise
Right:      Press:         Focus, Raise

# Context: AllDesktops

Left:       Press:         Focus, Raise, Unshade
Left:       Click:         ToggleOmnipresent

# Context: Desktop

Up:         Click:         GoToDesktop:    previous
Down:       Click:         GoToDesktop:    next
A-Up:       Click:         GoToDesktop:    previous
A-Down:     Click:         GoToDesktop:    next
C-A-Up:     Click:         GoToDesktop:    previous
C-A-Down:   Click:         GoToDesktop:    next
Left:       Press:         Focus, Raise
Right:      Press:         Focus, Raise

# Context: Root

Middle:     Press:         ShowMenu:       client-list-combined-menu
Right:      Press:         ShowMenu:       root-menu

# Context: MoveResize

Up:         Click:         GoToDesktop:    previous
Down:       Click:         GoToDesktop:    next
A-Up:       Click:         GoToDesktop:    previous
A-Down:     Click:         GoToDesktop:    next

Summmarize The Buttons

# Context: Icon

Left:       Press:         Focus, Raise, Unshade, ShowMenu
Right:      Press:         Focus, Raise, ShowMenu

# Context: Shade

Left:       Press:         Focus, Raise
Left:       Click:         ToggleShade

# Context: Iconify

Left:       Press:         Focus, Raise
Left:       Click:         Iconify

# Context: Maximize

Left:       Press:         Focus, Raise, Unshade
Middle:     Press:         Focus, Raise, Unshade
Right:      Press:         Focus, Raise, Unshade
Left:       Click:         ToggleMaximize
Middle:     Click:         ToggleMaximize: vertical  
Right:      Click:         ToggleMaximize: horizontal

# Context: Close

Left:       Press:         Focus, Raise, Unshade
Left:       Click:         Close

3: Custom Key Binding

Openbox Key Binding

I add two more keybind.

W-A-Z:   Decorate
W-A-X:   Undecorate

openbox Keybinding: Undecorate

    <keybind key="W-A-z">
      <action name="Decorate"/>
    </keybind>
    <keybind key="W-A-x">
      <action name="Undecorate"/>
    </keybind>

With courtesy of my friend (Asem Bused), I can show you the visual representation of this keybinding.

openbox Keybinding: Decorate

I like terminal with no window border.

Of course you can add your own keybind.

OB Log Out

More about OB Logout in:

    <keybind key="W-x">
      <action name="Execute">
        <startupnotify>
          <enabled>true</enabled>
          <name>oblogout</name>
        </startupnotify>
        <command>oblogout</command>
      </action>
    </keybind>

My Custom Binding

Mostly borrowed from my i3 configuration.

W-x:        oblogout
W-Return:   xfce4-terminal
W-A-d:      dmenu_run
W-S-d:      rofi -show run -opacity 90
W-Tab:      rofi -show window -opacity 90

Addy’s Custom Binding

W-Tab:      skippy-xd

XF86AudioStop:   mpc stop
XF86AudioPlay:   mpc toggle
XF86AudioPrev:   mpc prev
XF86AudioNext:   mpc next

XF86AudioRaiseVolume: amixer -D pulse sset Master '5%+'
XF86AudioLowerVolume: amixer -D pulse sset Master '5%-'
XF86AudioMute:        amixer set Master toggle

In my system, I use

$ amixer -D default sset Master '5%+'

Pulseaudio user may use:

$ pactl set-sink-volume 0 +5%

Arcolinux Custom Binding

I must admit that, these are cool.

W-Escape:      xkill

W-Right:       UnmaximizeFull, MaximizeVert, MoveResizeTo: 50%, MoveToEdgeEast
W-Left:        UnmaximizeFull, MaximizeVert, MoveResizeTo: 50%, MoveToEdgeWest
W-Up:          MaximizeFull
W-Down:        UnmaximizeFull, MoveResizeTo: 80% 80%, MoveToCenter
W-A-Right:     UnmaximizeFull, MaximizeVert, MoveResizeTo: -0 0 50%
W-A-Left:      UnmaximizeFull, MaximizeVert, MoveResizeTo:  0 0 50%

Now we can emulate simple tiling easily.

openbox Keybinding: Tiling

There are also variety wallapaper if you want, but I’d rather not using it.


What’s Next

Consider continue reading [ Config: Rules ].