chromix
chromix copied to clipboard
usage: how to cycle through all tabs
I want to cycle through all tabs, but cannot figure out if there is an equivalent of CTRL+TAB. Currently I use xdotool to send keyboard events, but this does not work well with screenlock.
Assuming Chrome... Have you tried ctrl-1, ctrl-2, etc.?
I think you'll have to write a little script of your own to do that.
This works...
chromix = require("chromix-too")().chromix
chromix "chrome.tabs.getSelected", {}, (tab) ->
chromix "chrome.tabs.query", {}, {currentWindow: true}, (tabs) ->
index = (tab.index + 1) % tabs.length
chromix "chrome.tabs.update", {}, tabs[index].id, {active: true}, ->