How to define Linux environment variables for LaTeX Workshop using VS Code

Has anyone successfully set up LaTeX Workshop using VS Code on Linux, and how did you do it?

I have recently installed VS Code on Kubuntu 23.04, with the LaTeX Workshop extension. I blieve that I am following the instructions at Install · James-Yu/LaTeX-Workshop Wiki · GitHub to set up the environment variables TEXINPUTS and BIBINPUTS for latexmk and pdflatex, but when I try to compile a file that uses beamer.sty, I see errors such as

This is pdfTeX, Version 3.141592653-2.6-1.40.24 (TeX Live 2022/Debian) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
(/home/leopardi/src/sage-sandbox/Boolean-Cayley-graphs/papers-talks/AustMS-2023/Leopardi-Bent-functions-AustMS-2023-talk.tex
LaTeX2e <2022-11-01> patch level 1
L3 programming layer <2023-01-16> (/usr/share/texlive/texmf-dist/tex/latex/beamer/beamer.cls
Document Class: beamer 2022/09/13 v3.68 A class for typesetting presentations
(/usr/share/texlive/texmf-dist/tex/latex/beamer/beamerbasemodes.sty

! LaTeX Error: File `etoolbox.sty' not found.

This is after I have edited ~/.config/Code/User/settings.json to add

{
    "latex-workshop.latex.texDirs": [
        "/home/leopardi/TeX",
        "/usr/share/texlive/texmf-dist/tex/latex/beamer"
    ],
    "terminal.integrated.env.linux": {
        
    },
    "latex-workshop.latex.bibDirs": [
        "/home/leopardi/TeX",
        "/usr/share/texlive/texmf-dist/tex/latex/beamer"
    ]
}

and edited ~/.vscode/extensions/james-yu.latex-workshop-9.15.0/package.json with

                                        "default": [
                                                {
                                                        "name": "pdflatex",
                                                        "command": "pdflatex",
                                                        "args": [
                                                                "-synctex=1",
                                                                "-interaction=nonstopmode",
                                                                "-file-line-error",
                                                                "%DOC%"
                                                        ],
                                                        "env": {"TEXINPUTS": "/home/leopardi/TeX:/usr/share/texlive/texmf-dist/tex/latex/beamer"}
...
                                                        "name": "latexmk",
                                                        "command": "latexmk",
                                                        "args": [
                                                                "-synctex=1",
                                                                "-interaction=nonstopmode",
                                                                "-file-line-error",
                                                                "-pdf",
                                                                "-outdir=%OUTDIR%",
                                                                "%DOC%"
                                                        ],
                                                        "env": {"TEXINPUTS": "/home/leopardi/TeX:/usr/share/texlive/texmf-dist/tex/latex/beamer"}
...

If I don’t have /usr/share/texlive/texmf-dist/tex/latex/beamer in TEXINPUTS, then pdflatex can’t find beamer.cls.

To clarify, I have been using kile up until now, and it works fine, with TEXINPUTS defined as $HOME/TeX.