如何为 WSLg Ubuntu 中下载的可执行文件创建开始菜单图标条目(在普通 Windows 上)?

dsf*_*dsf 3 windows windows-subsystem-for-linux wsl2

我按照以下说明下载了 Jetbrains Toolbox 应用程序:https://www.jetbrains.com/help/idea/installation-guide.html#toolbox

简而言之,我这样做了:

下载的 tar.gz 文件

跑这个:sudo tar -xzf jetbrains-toolbox-1.17.7391.tar.gz -C /opt

在 cd 进入 /opt/... 文件夹执行后,我这样做了:./jetbrains-toolbox

针对 WSLg 的 Windows 10 Insider 开发版本允许 WSLg 内的 Ubuntu 应用程序在普通窗口的“开始”菜单中拥有一个条目。因此,如果我安装sudo apt install firefox在 WSL 中,Firefox 图标将显示在普通 Windows 的“开始”菜单中。

如何对像这样的可执行脚本执行相同的操作./jetbrains-toolbox

小智 5

将 WSL 程序/脚本添加到 Windows 开始菜单的方法是将一个条目添加到/usr/share/applicationsWSL 安装目录中。

因此,在您的示例中,如果我们创建文件/usr/share/applications/toolbox.desktop,并将以下内容添加到文件中:

[Desktop Entry]
Type=Application
Name=Jetbrains Toolbox
Exec=/opt/jetbrains-toolbox
Run Code Online (Sandbox Code Playgroud)

保存文件时,您将有一个名为 的新 Windows 条目Jetbrains Toolbox (Ubuntu)(假设您的 WSL 安装是 Ubuntu)。