I am running Arch, tint2 & Openbox with all the latest updates.

I have the following snippet in Openbox which is a keyboard shortcut;

<keybind key="w-t"><action name="Execute"><command>bash -c ' gnome-terminal --geometry=148x18+10+300 --working-directory=/home/user/Desktop --tab -e /bin/bash; wmctrl -i -a $(wmctrl -l | grep arch@t430 | tail -n 1 | cut -d ' ' -f1) '</command></action></keybind>

When I press the Windows key + the letter t key a new gnome terminal opens and it comes to focus on the desktop, just as desired.

However if I minimise the already opened gnome-terminal and open further & subsequent gnome-terminal's using the Win+t keys the gnome-terminal opens, but sits in the tint2 bar fashing and does not come to focus. I don't know why it does this. If it opened and came to focus as a window that would be as expected.

The line

wmctrl -i -a $(wmctrl -l | grep arch@t430 | tail -n 1 | cut -d ' ' -f1)

is an attempt to bring the window to focus, but it does not do this. It does find the newly opened window as the last window on the wmctrl list but it does not bring it to focus as the -a flag suggests it should.

Can anyone suggest how to get subsequent gnome-terminal windows to come to focus as they are opened?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.