.desktop Terminal
时间: 2024-01-05 21:20:02 浏览: 42
.desktop文件是Linux桌面环境中用于定义应用程序启动器的配置文件。其中的Terminal字段用于指定是否在终端中运行应用程序。如果Terminal字段设置为true,则应用程序将在终端中打开;如果设置为false,则应用程序将在后台运行,不会打开终端。
以下是两种设置Terminal字段的例子:
1. 将Terminal字段设置为true:
```shell
[Desktop Entry]
Version=1.0
Name=test
Comment=test the terminal running a command inside it
Exec=bash -c 'url=$(eval echo %u); /usr/bin/google-chrome-stable ${url#*//} --no-sandbox; exec bash'
Icon=utilities-terminal
Terminal=true
Type=Application
Categories=Application
MimeType=x-scheme-handler/test
```
2. 将Terminal字段设置为false:
```shell
[Desktop Entry]
Version=1.0
Name=test
Comment=test the terminal running a command inside it
Exec=bash -c 'url=$(eval echo %u); /usr/bin/google-chrome-stable ${url#*//} --no-sandbox; exec bash'
Icon=utilities-terminal
Terminal=false
Type=Application
Categories=Application
MimeType=x-scheme-handler/test
```