Pyt*_*ent 5 scripts gnome-terminal resize window .desktop
.desktop 文件在终端中打开一个 python 脚本。(使用'Exec'和Terminal = true)。是否可以包含任何其他参数以便在特定配置文件或特定窗口大小中打开 gnome 终端?
您可以拨打终端 --geometry=widthxheight
例如在命令行:
gnome-terminal --geometry=40x10
Run Code Online (Sandbox Code Playgroud)
将打开一个具有上述尺寸(40x10)的终端窗口
在这种情况下,没有必要Terminal=true在您的 .desktop 文件中使用。要使用特定配置文件或特定窗口大小在 gnome-terminal 中打开您的 python 脚本,您可以使用:
Exec=gnome-terminal --profile=Profile_name --geometry=widthxheight -e '/path/to/script.py'
Run Code Online (Sandbox Code Playgroud)
如果您查看man gnome-terminal.
另外,如果要在脚本执行完成后保持终端打开,请确保在 python 脚本的末尾有这两行:
Exec=gnome-terminal --profile=Profile_name --geometry=widthxheight -e '/path/to/script.py'
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2441 次 |
| 最近记录: |