bash 在树莓派上旋转铬标签?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/29240816/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-18 12:37:32  来源:igfitidea点击:

Rotate through chromium tabs on raspberry pi?

bashgoogle-chromescriptingraspberry-pichromium

提问by wayno93

We have several TVs, each with a Raspberry Pi hooked up, so they can be used as information dashboards. The current setup stays on one tab the entire time.

我们有几台电视,每台都连接了 Raspberry Pi,因此它们可以用作信息仪表板。当前设置始终保留在一个选项卡上。

I am trying to set it up so that it will automatically rotate through the chromium tabs every 15 seconds, but am not sure how to approach this.

我正在尝试设置它,以便它每 15 秒自动旋转一次铬标签,但我不确定如何处理。

The Pi's, as far as I know, only have a headless OS with chromium installed, which is started on boot in the xinitrc file.

据我所知,Pi 只安装了一个安装了 Chromium 的无头操作系统,它在启动时在 xinitrc 文件中启动。

I know there are some chrome plugins that can do this, but I don't think they can be installed on the command line.

我知道有一些 chrome 插件可以做到这一点,但我认为它们不能安装在命令行上。

Any advice would be appreciated

任何意见,将不胜感激

回答by Luiz Pican?o

You can use xdotool with watch to do this:

您可以将 xdotool 与 watch 一起使用来执行此操作:

# rotate tabs after 30 seconds.
watch -n30 "xdotool search --onlyvisible --class chromium key ctrl+Tab"