I use Ubutnu 22.04 with default GNOME and my VSCode is installed from official APT repo.
To permanently enable wayland rendering I copied original code.desktop
and code-url-handler.desktop
files from /usr/share/applications
to .local/share/applications
and changed Exec
section to pass additional command line args to vscode binary.
[Desktop Entry]Name=Visual Studio CodeComment=Code Editing. Redefined.GenericName=Text EditorExec=/usr/share/code/code --enable-features=UseOzonePlatform --enable-features=WaylandWindowDecorations --ozone-platform-hint=auto --unity-launch %FIcon=vscodeType=ApplicationStartupNotify=falseStartupWMClass=CodeCategories=TextEditor;Development;IDE;MimeType=text/plain;inode/directory;application/x-code-workspace;Actions=new-empty-window;Keywords=vscode;[Desktop Action new-empty-window]Name=New Empty WindowExec=/usr/share/code/code --enable-features=UseOzonePlatform --enable-features=WaylandWindowDecorations --ozone-platform-hint=auto --new-window %FIcon=vscode
(this is contents of my code.desktop file):
Now if I run VSCode from system menu it works, but for some reason there is not "add to favorites" button in dock icon context menu. And if I add it from system menu itself, it kinda works, but produces separate dock icon when I run it (screenshot attached).
Image may be NSFW.
Clik here to view.
Can I somehow restore original behaviour, using overriden desktop files?