feat: add support for workspace names and more icons
This commit is contained in:
parent
3cffe70a6e
commit
3bca1c8fa6
3 changed files with 4 additions and 6 deletions
|
@ -3,7 +3,6 @@
|
|||
test/**
|
||||
.gitattributes
|
||||
.gitignore
|
||||
*.md
|
||||
tsconfig.json
|
||||
tslint.json
|
||||
yarn.lock
|
||||
|
|
|
@ -56,6 +56,7 @@
|
|||
"homepage": "https://github.com/iCrawl/discord-vscode#readme",
|
||||
"icon": "assets/icon.png",
|
||||
"galleryBanner": {
|
||||
"color": "#6477C1",
|
||||
"theme": "dark"
|
||||
},
|
||||
"dependencies": {
|
||||
|
|
|
@ -21,15 +21,13 @@ function setActivity(rpc: Client): void {
|
|||
if (!rpc) return;
|
||||
const activity = {
|
||||
details: window.activeTextEditor ? `Editing ${basename(window.activeTextEditor.document.fileName)}` : 'Idle.',
|
||||
state: typeof workspace.workspaceFolders !== 'undefined' ? `Workspaces: ${workspace.workspaceFolders.map(folder => folder.name).join(' | ')}` : 'Idling.',
|
||||
state: window.activeTextEditor ? `Workspace: ${workspace.getWorkspaceFolder(window.activeTextEditor.document.uri).name}` : 'Idling.',
|
||||
startTimestamp: new Date().getTime() / 1000,
|
||||
largeImageKey: window.activeTextEditor ? extname(basename(window.activeTextEditor.document.fileName)).substring(1) : 'vscode-big',
|
||||
largeImageKey: window.activeTextEditor ? extname(basename(window.activeTextEditor.document.fileName)).substring(1) || basename(window.activeTextEditor.document.fileName).substring(1) || 'vscode-big' : 'vscode-big',
|
||||
largeImageText: window.activeTextEditor ? window.activeTextEditor.document.languageId : 'Idling.',
|
||||
smallImageKey: 'vscode',
|
||||
smallImageText: 'Visual Studio Code',
|
||||
instance: false
|
||||
};
|
||||
rpc.setActivity(activity).catch(error =>
|
||||
window.showErrorMessage(`DiscordRPC: ${error.message}`)
|
||||
);
|
||||
rpc.setActivity(activity);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue