illixion / vscode-vibrancy-continued

Enable Acrylic/Glass effect for your VS Code.
MIT License
544 stars 31 forks source link

Use @vscode/sudo-prompt to make vscode run without admin. #15

Open frg2089 opened 2 years ago

frg2089 commented 2 years ago

Hi, we can use this package to make the extension to run as admin when need. It can make this extension run without admin vscode.

@vscode/sudo-prompt

bigplayer-ai commented 1 year ago

Are you going to update the extension yet? I hate having to run as admin every time..

illixion commented 1 year ago

Are you going to update the extension yet? I hate having to run as admin every time..

Haven't had the time to test #24 as the changes are quite extensive, but I'll try to get around to testing and hopefully merging it next week.

frg2089 commented 1 year ago

Are you going to update the extension yet? I hate having to run as admin every time..

Haven't had the time to test #24 as the changes are quite extensive, but I'll try to get around to testing and hopefully merging it next week.

24 doesn't fit. It changed too many things that don't actually help for this project.

In fact, we just need to rewrite the write file logic with this part in our project.


import * as sudoPrompt from '@vscode/sudo-prompt'

const sudo = async (
  cmd: string,
  name?: string
): Promise<{
  stdout: string | Buffer | undefined,
  stderr: string | Buffer | undefined
}> => new Promise((resolve, reject) =>
    sudoPrompt.exec(cmd, { name }, (err, stdout, stderr) => {
      if (err)
        reject(err)
      else
        resolve({ stdout, stderr })
    })
  )
bigplayer-ai commented 1 year ago

Hey, I still need to enter vscode as admin to enable vscode vibrancy.

bigplayer-ai commented 1 year ago

if you fix this issue, It would be much easier for a novice like me to implement extra features for this project/repo. (Like auto dark mode).

illixion commented 1 year ago

This shouldn't impede your process if you reinstall VSCode to be a user installation.

I've tried looking into this also, but didn't have much success, Windows would give me an "operation not permitted" error when trying to copy the runtime files with admin permissions. If anyone wants to submit a PR with a solution that works, that would be much appreciated.