When I open gnome-terminal with multiple tabs from the command line, I would like to preselect (on the command line) which one of the tabs should get focus.
I tried
gnome-terminal --tab -t A --active --tab -t B
to set tab A as the active, but instead tab B becomes the active one.
Create the script bellow , make it executable with
chmod +x scriptname
, where script name is actual script name.Run the script with 4 parameters. For example, I run it with
activetab.sh TAB-1 TAB-2 TAB-3 TAB-4
. You can call tabs anything you want, TAB-1 is just example.You will be prompted for which tab you want to focus on, type it exactly as you've typed it in the argument
Note: you will need to have
wmctrl
andxdotool
installed for this script to work !sudo apt-get install wmctrl xdotool
The script
Demo
If you can't see animation bellow, open it in different browser (chromium or google chrome) , or follow this link : http://i.stack.imgur.com/2sWMb.gif