Make Ctrl+t open a new (chrome) tab when outside of chrome


Bastian Quest

On Chrome OS, you can always use the Ctrl+ Tkeyboard shortcut to open a new tab (or actually a browser window) . Is it possible to do this in Ubuntu?

Just setting a keyboard shortcut won't work, as that will change the behavior in Chrome (eg it will always open a new window instead of a new tab).

Jobin

WARNING: The solution posted here will solve the posted problem, however, the Ctrl+ shortcut key will become useless for applications that use Firefox and nautilus to open tabs (like google-chrome) even without a google-chrome window open . .t

The key here is to capture the window id of google chrome if it's open. It can be done using wmctrl, grep and awk (or other application). Once you have the window ID, you can send any desired keystrokes using xdotool.

wmctrl and xdotool are not available in default installation. You can install them from the software center or by typing the following on the terminal:

sudo apt-get install wmctrl xdotool

Then paste the following into the file (give it a filename you like and remember the filename, if you want to hide it, start the filename with a ., I use that .google_chrome_system_tab_openas the filename):

windowid=$(wmctrl -l | grep "Google Chrome" | awk -F ' ' '{print $1}') && xdotool key --window $windowid ctrl+t

Then press Alt+ F2and type the following:

chmod +x /path/to/the/file

Replace with /path/to/the/filethe file location where you pasted the above command set (in my case) /home/jobin/.google_chrome_system_tab_open.

Now, go to System Settings -> Keyboard -> Shortcuts -> Customize Shortcuts and click +to add a new shortcut.

Provide a name for the shortcut (I'm using "Open Google Chrome System Tab") and paste the following into the textbox before "Command:".

/path/to/the/file

You can then set the desired keystrokes for this command; Ctrl+ tdepending on your situation.

If you use a shortcut like Ctrl+ ;, you might keep + Ctrlas ta shortcut for firefox and nautilus.

Related


Make Ctrl+t open a new (chrome) tab when outside of chrome

Bastian Quest On Chrome OS, you can always use the Ctrl+ Tkeyboard shortcut to open a new tab (or actually a browser window) . Is it possible to do this in Ubuntu? Just setting a keyboard shortcut won't work, as that will change the behavior in Chrome (eg it w

Make Ctrl+t open a new (chrome) tab when outside of chrome

Bastian Quest On Chrome OS, you can always use the Ctrl+ Tkeyboard shortcut to open a new tab (or actually a browser window) . Is it possible to do this in Ubuntu? Just setting a keyboard shortcut won't work, as that will change the behavior in Chrome (eg it w

Make Ctrl+t open a new (chrome) tab when outside of chrome

Bastian Quest On Chrome OS, you can always use the Ctrl+ Tkeyboard shortcut to open a new tab (or actually a browser window) . Is it possible to do this in Ubuntu? Just setting a keyboard shortcut won't work, as that will change the behavior in Chrome (eg it w

Selenium C# Open "New" tab CTRL+T doesn't work with CHROME

crush static void Main() { IWebDriver driver = new ChromeDriver(); driver.Navigate().GoToUrl("http://google.com"); IWebElement body = driver.FindElement(By.TagName("body")); body.SendKeys(Keys.Control + "t"); } This is the code I'm trying to

Selenium C# Open "New" tab CTRL+T doesn't work with CHROME

crush static void Main() { IWebDriver driver = new ChromeDriver(); driver.Navigate().GoToUrl("http://google.com"); IWebElement body = driver.FindElement(By.TagName("body")); body.SendKeys(Keys.Control + "t"); } This is the code I'm trying to

Selenium C# Open "New" tab CTRL+T doesn't work with CHROME

crush static void Main() { IWebDriver driver = new ChromeDriver(); driver.Navigate().GoToUrl("http://google.com"); IWebElement body = driver.FindElement(By.TagName("body")); body.SendKeys(Keys.Control + "t"); } This is the code I'm trying to

Selenium C# Open "New" tab CTRL+T doesn't work with CHROME

crush static void Main() { IWebDriver driver = new ChromeDriver(); driver.Navigate().GoToUrl("http://google.com"); IWebElement body = driver.FindElement(By.TagName("body")); body.SendKeys(Keys.Control + "t"); } This is the code I'm trying to

Selenium C# Open "New" tab CTRL+T doesn't work with CHROME

crush static void Main() { IWebDriver driver = new ChromeDriver(); driver.Navigate().GoToUrl("http://google.com"); IWebElement body = driver.FindElement(By.TagName("body")); body.SendKeys(Keys.Control + "t"); } This is the code I'm trying to

Selenium C# Open "New" tab CTRL+T doesn't work with CHROME

crush static void Main() { IWebDriver driver = new ChromeDriver(); driver.Navigate().GoToUrl("http://google.com"); IWebElement body = driver.FindElement(By.TagName("body")); body.SendKeys(Keys.Control + "t"); } This is the code I'm trying to

Chrome extension to open new tab on new tab

Richard Panaby King I've created a Chrome extension that, as part of its action, will open a new tab with a specified URL. chrome.runtime.onMessage.addListener( function(request, sender, sendResponse) { if( request.message === "open_new_tab" ) { ch

Chrome extension to open new tab on new tab

Richard Panaby King I've created a Chrome extension that, as part of its action, will open a new tab with a specified URL. chrome.runtime.onMessage.addListener( function(request, sender, sendResponse) { if( request.message === "open_new_tab" ) { ch

Chrome extension to open new tab on new tab

Richard Panaby King I've created a Chrome extension that, as part of its action, will open a new tab with a specified URL. chrome.runtime.onMessage.addListener( function(request, sender, sendResponse) { if( request.message === "open_new_tab" ) { ch

Chrome extension to open new tab on new tab

Richard Panaby King I've created a Chrome extension that, as part of its action, will open a new tab with a specified URL. chrome.runtime.onMessage.addListener( function(request, sender, sendResponse) { if( request.message === "open_new_tab" ) { ch

Chrome extension to open new tab on new tab

Richard Panaby King I've created a Chrome extension that, as part of its action, will open a new tab with a specified URL. chrome.runtime.onMessage.addListener( function(request, sender, sendResponse) { if( request.message === "open_new_tab" ) { ch

Chrome extension to open new tab on new tab

Richard Panaby King I've created a Chrome extension that, as part of its action, will open a new tab with a specified URL. chrome.runtime.onMessage.addListener( function(request, sender, sendResponse) { if( request.message === "open_new_tab" ) { ch

Open Chrome extension in new tab

Prepreg Does this still work? "app": { "launch": { "local_path": "window.html", "container": "tab" } }, I'm using Chrome v46 and it works fine, but I want to make sure it's not a bug. I do n't see anything like this in the manifest file

Open Chrome extension in new tab when toolbar icon is clicked

Big Ham I want the extension HTML to open in a new tab, not in a popup. The existing extension Session Session Buddy has the exact behavior I want to replicate. The problem is that when I click the toolbar icon, Chrome keeps opening new extension tabs, and the

Open Chrome extension in new tab when toolbar icon is clicked

Big Ham I want the extension HTML to open in a new tab, not in a popup. The existing extension Session Session Buddy has the exact behavior I want to replicate. The problem is that when I click the toolbar icon, Chrome keeps opening new extension tabs, and the

Open Chrome extension in new tab when toolbar icon is clicked

Big Ham I want the extension HTML to open in a new tab, not in a popup. The existing extension Session Session Buddy has the exact behavior I want to replicate. The problem is that when I click the toolbar icon, Chrome keeps opening new extension tabs, and the

Google Chrome can't open blob in new tab

Mr. Nguyen: I have the same blob URL in both tags . One tab has target="_blank" for opening links in new tabs and another for downloads. "Download" is fine, but "Open in new tab" only works on Firefox. For Google Chrome, it blinks constantly, then opens and cl

Google Chrome can't open blob in new tab

Mr. Nguyen: I have the same blob URL in both tags . One tab has target="_blank" for opening links in new tabs and another for downloads. "Download" is fine, but "Open in new tab" only works on Firefox. For Google Chrome, it blinks constantly, then opens and cl

Chrome extension: how to open links in new tab?

Tuyen Pham: In my Stackoverflow folder, there are stackoverflow.ico2 bellow files. When importing it into Chrome, it shows the icon in the address bar, but when I click it, Chrome doesn't open any new tabs. What am I doing wrong? manifest.json { "name": "Sta

Chrome, Javascript, windows. Open in new tab

Andrew: In chrome, this opens in a new tab: <button onclick="window.open('newpage.html', '_blank')" /> This opens in a new window (but I also want it to open in a new tab: <script language="javascript"> window.open('newpage.html', '_blank'); </script> Is t

Chrome extension: how to open links in new tab?

Tuyen Pham: In my Stackoverflow folder, there are stackoverflow.ico2 bellow files. When I import it into Chrome, it shows the icon in the address bar, but when I click it, Chrome doesn't open any new tabs. What am I doing wrong? manifest.json { "name": "Stac