[openbox] switch to a window and then switch back

Grady Martin sunnycemetery at gmail.com
Sat Dec 24 14:56:25 EST 2016


I hope I'm not too late to the party.

On 2016年09月23日 12時14分, Łukasz Grabowski wrote:
>My setup is as follows: firefox is allowed to run only in desktop 1.

Snip.

>Let me explain again to avoid misunderstandings:
>1) Let's say I'm typing in a terminal while being on desktop 1. Then
>pressing C-A-s should bring up firefox window, and pressing C-A-s again
>should minimize firefox window.
>
>2) Let's say I'm typing in a terminal while being on desktop 2. Then
>pressing C-A-s should switch to desktop 1 and bring up firefox. Now if
>I press anything but C-A-s,  then this should "break the key chain",
>i.e. now the rules in 1) apply. But if I press C-A-s then I should go
>back to desktop 2.

Sadly, the functionality you describe is available right out of the box.  Try the following key binding:

<keybind key="C-A-s">
	<action name="NextWindow">
		<allDesktops>yes</allDesktops>
		<interactive>no</interactive>
		<dialog>none</dialog>
	</action>
</keybind>

I say "sadly" because, depending on how you switch window focus, Openbox does not properly update window focus history.  I call wmctrl from scripts, for example, and the "previous" window ends up being two (or more) windows ago.

However, if you perform your window switching exclusively through Openbox, I believe this binding will suit your needs.


More information about the openbox mailing list