vscode: Fix icon name

Looking at official vscode *.deb packages, the icon are named as
vscde, vscode-insiders, etc. Let's follow that to make third-
party icon theme users happy.
This commit is contained in:
Bobby Rong 2023-07-31 10:09:18 +08:00
parent e6ab46982d
commit 2c38aefa2b
No known key found for this signature in database
2 changed files with 6 additions and 5 deletions

View File

@ -43,7 +43,7 @@ let
comment = "Code Editing. Redefined.";
genericName = "Text Editor";
exec = "${executableName} %F";
icon = "code";
icon = "vs${executableName}";
startupNotify = true;
startupWMClass = shortName;
categories = [ "Utility" "TextEditor" "Development" "IDE" ];
@ -52,7 +52,7 @@ let
actions.new-empty-window = {
name = "New Empty Window";
exec = "${executableName} --new-window %F";
icon = "code";
icon = "vs${executableName}";
};
};
@ -62,7 +62,7 @@ let
comment = "Code Editing. Redefined.";
genericName = "Text Editor";
exec = executableName + " --open-url %U";
icon = "code";
icon = "vs${executableName}";
startupNotify = true;
categories = [ "Utility" "TextEditor" "Development" "IDE" ];
mimeTypes = [ "x-scheme-handler/vscode" ];
@ -103,8 +103,9 @@ let
ln -s "$desktopItem/share/applications/${executableName}.desktop" "$out/share/applications/${executableName}.desktop"
ln -s "$urlHandlerDesktopItem/share/applications/${executableName}-url-handler.desktop" "$out/share/applications/${executableName}-url-handler.desktop"
# These are named vscode.png, vscode-insiders.png, etc to match the name in upstream *.deb packages.
mkdir -p "$out/share/pixmaps"
cp "$out/lib/vscode/resources/app/resources/linux/code.png" "$out/share/pixmaps/code.png"
cp "$out/lib/vscode/resources/app/resources/linux/code.png" "$out/share/pixmaps/vs${executableName}.png"
# Override the previously determined VSCODE_PATH with the one we know to be correct
sed -i "/ELECTRON=/iVSCODE_PATH='$out/lib/vscode'" "$out/bin/${executableName}"

View File

@ -83,7 +83,7 @@ runCommand "${wrappedPkgName}-with-extensions-${wrappedPkgVersion}" {
mkdir -p "$out/share/applications"
mkdir -p "$out/share/pixmaps"
ln -sT "${vscode}/share/pixmaps/code.png" "$out/share/pixmaps/code.png"
ln -sT "${vscode}/share/pixmaps/vs${executableName}.png" "$out/share/pixmaps/vs${executableName}.png"
ln -sT "${vscode}/share/applications/${executableName}.desktop" "$out/share/applications/${executableName}.desktop"
ln -sT "${vscode}/share/applications/${executableName}-url-handler.desktop" "$out/share/applications/${executableName}-url-handler.desktop"
makeWrapper "${vscode}/bin/${executableName}" "$out/bin/${executableName}" ${extensionsFlag}