Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to set up a keybinding in Openbox for switching between open windows within an application? Just like you can in gnome 3 with alt + [key above Tab] .

share|improve this question
up vote 8 down vote accepted

I have implemented this function by using wmctrl.

The relevant part in rc.xml of openbox:

<keybind key="A-space">
  <action name="execute">

below is the code in wmctrl-switch-by-application:

# taken from: http://www.st0ne.at/?q=node/58

# get id of the focused window
active_win_id=$(xprop -root | grep '^_NET_ACTIVE_W' | awk -F'# 0x' '{print $2}')

# get window manager class of current window
win_class=$(wmctrl -x -l | grep $active_win_id | awk '{print $2 " " $3}' )

# get list of all windows matching with the class above
win_list=$(wmctrl -x -l | grep  "$win_class" | awk '{print $1}' )

# get next window to focus on
switch_to=$(echo $win_list | sed s/.*$active_win_id// | awk '{print $1}')

# if the current window is the last in the list ... take the first one
if [ -z "$switch_to" ];then
   switch_to=$(echo $win_list | awk '{print $1}')

# switch to window
wmctrl -i -a $switch_to
share|improve this answer

You can switch among windows of all desktops, or even include the desktop itself and panels, as described in the Openbox Actions page, but there seem to be no way to switch among windows of the same application.

share|improve this answer

You can switch between any open window or application by pressing alt and tab. Even if there are two open windows of the same program.

share|improve this answer

Your Answer


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.