简体   繁体   English

如何在Ubuntu的终端中自动运行应用程序?

[英]How do I autorun an application in a terminal in Ubuntu?

I've created a few autorun script files on various USB devices that run bash scripts when they mount. 我已经在安装了bash脚本的各种USB设备上创建了一些autorun脚本文件。 These scripts run "in the background", how do I get them to run in a terminal window? 这些脚本“在后台”运行,如何使它们在终端窗口中运行? (Like the "Application in Terminal" gnome Launcher type.) (类似于“终端中的应用程序” gnome Launcher类型。)

Run them as a two stage process with your "autorun" script calling the second script in a new terminal eg 将它们作为两个阶段的过程运行,其中“自动运行”脚本在新终端中调用第二个脚本,例如

gnome-terminal -e top --title Testing

Would run the program "top" in a new gnome terminal window with the title "Testing" You can add additional arguments like setting the geometry to determine the size and location of the window checkout the man page for gnome-terminal and the "X" man page for more details 将在新的gnome终端窗口中以标题“ Testing”运行程序“ top”。您可以添加其他参数,例如设置几何形状以确定窗口的大小和位置,请查看gnome-terminal的手册页和“ X”手册页以获取更多详细信息

xterm -e shellscript.sh

or (if xterm isn't installed) 或(如果未安装xterm

gnome-terminal -e shellscript.sh

or (if you're using kubuntu / kde) 或(如果您使用的是kubuntu / kde)

konsole -e shellscript.sh

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM