Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

如何添加权限 #120

Open
shalldie opened this issue Jul 16, 2018 · 7 comments
Open

如何添加权限 #120

shalldie opened this issue Jul 16, 2018 · 7 comments

Comments

@shalldie
Copy link
Owner

本插件是通过修改vscode样式文件的方式更改背景,所以需要有对该样式文件的读写权限。

@shalldie
Copy link
Owner Author

shalldie commented Jul 16, 2018

windows:

直接【右键】-【以管理员身份运行】

macOs:

在vscode所在的目录,运行shell:
chmod +rw "Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.css"

如果vscode版本>=1.38:
chmod +rw "Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.css"

@Arcadia822
Copy link

Arcadia822 commented Feb 12, 2019

mojave依然报错:

[Extension Host] Here is the error stack:  Error: EROFS: read-only file system, open '/private/var/folders/l3/b5qjm27505d7n3_0prpyrbrh0000gn/T/AppTranslocation/342E781A-1F16-4579-AF1E-A24A6B2BDE66/d/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.css'
	at Object.fs.openSync (fs.js:577:3)
	at Object.module.(anonymous function) [as openSync] (ELECTRON_ASAR.js:166:20)
	at Object.fs.writeFileSync (fs.js:1321:33)
	at Background.saveCssContent (/Users/hanwei10/.vscode/extensions/shalldie.background-1.1.19/out/background.js:69:12)
	at Background.install (/Users/hanwei10/.vscode/extensions/shalldie.background-1.1.19/out/background.js:169:14)
	at Background.initialize (/Users/hanwei10/.vscode/extensions/shalldie.background-1.1.19/out/background.js:82:18)
	at Background.watch (/Users/hanwei10/.vscode/extensions/shalldie.background-1.1.19/out/background.js:212:14)
	at activate (/Users/hanwei10/.vscode/extensions/shalldie.background-1.1.19/out/extension.js:21:53)
	at Function.t._callActivateOptional (/private/var/folders/l3/b5qjm27505d7n3_0prpyrbrh0000gn/T/AppTranslocation/342E781A-1F16-4579-AF1E-A24A6B2BDE66/d/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:741:354)
	at Function.t._callActivate (/private/var/folders/l3/b5qjm27505d7n3_0prpyrbrh0000gn/T/AppTranslocation/342E781A-1F16-4579-AF1E-A24A6B2BDE66/d/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:741:25)
	at /private/var/folders/l3/b5qjm27505d7n3_0prpyrbrh0000gn/T/AppTranslocation/342E781A-1F16-4579-AF1E-A24A6B2BDE66/d/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:740:206

尝试修改了这个临时目录的权限也不行

@Sway007
Copy link

Sway007 commented Mar 13, 2019

我补充一个ubuntu上添加权限的方法把

sudo chmod a+w $(find /usr/share/code -iname "workbench.main.css")

另外好像code每次更新后都得添加一些写权限,不然插件好像无法正常工作,大佬解决一下?

@kungfulon
Copy link

kungfulon commented Jan 5, 2021

MacOS EROFS error happened because of App Translocation.
To disable App Translocation for VS Code, run this command in where VS Code app bundle is located:
sudo xattr -d -r -s com.apple.quarantine Visual\ Studio\ Code.app
If it doesn't work, then try uninstalling the app then reinstall, and run the command before starting VS Code for the first time.

@lhwjsj
Copy link

lhwjsj commented Apr 12, 2023

我装上插件之后正常配置,然后重启vs code没有出现背景图片(windows电脑,也右键管理员运行了)

@lightmon233
Copy link

求一个ubuntu的解决方案,我按照上面那个的方法来不行,及时修改了这个文件的读写权限还是汇报同样的错

@suiyun39
Copy link
Collaborator

@lightmon233 是否使用 Snap 安装? 如果是, 请参考: #382

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants