2024-07-19 00:05:53 +02:00
**Zed discord presence** is an extension for [Zed ](https://zed.dev ) that adds support for [Discord Rich Presence ](https://discord.com/developers/docs/rich-presence/how-to ) using LSP
2024-07-19 23:55:44 +02:00
Using LSP is a workaround for now (yeah, it's a bit hacky) but once Zed has proper extension support, I'll rewrite it.
### Requirements
2024-07-19 23:58:18 +02:00
[rust ](https://rust-lang.org ) is required for installing this extension. \
2024-07-19 23:55:44 +02:00
The easiest way to get [rust ](https://rust-lang.org ) is by using [rustup ](https://rustup.rs )
2024-07-19 19:54:46 +02:00
2024-07-19 00:09:27 +02:00
### How to install?
2024-07-19 00:05:53 +02:00
2024-08-27 15:35:32 +02:00
Since [zed-industries/extensions#1217 ](https://github.com/zed-industries/extensions/pull/1217 ) has been merged, you can simply download the extension in < kbd > zed: extensions</ kbd > .
Don't forget to give at least a ⭐ if you like this project :D
< details >
< summary > Dev installation< / summary >
2024-07-19 00:05:53 +02:00
1. Clone this repository
2. < kbd > CTRL</ kbd > + < kbd > SHIFT</ kbd > + < kbd > P</ kbd > and select < kbd > zed: install dev extension</ kbd >
3. Choose the directory where you cloned this repository
4. Enjoy :)
2024-08-03 21:36:23 +02:00
2024-08-27 15:35:32 +02:00
< / details >
2024-08-03 21:36:23 +02:00
## How to configure?
You can configure state, details and git integration by changing Discord Presence LSP settings. This can be done in < kbd > zed: open settings< / kbd > with following configuration:
```json
{
"lsp": {
"discord_presence": {
"initialization_options": {
2024-11-19 19:10:47 +01:00
// application id for the rich presence (required, keep it if you don't know what you're doing)
"application_id": "1263505205522337886"
2024-08-04 22:25:42 +02:00
// Base url for all language icons
2024-08-04 22:59:22 +02:00
"base_icons_url": "https://raw.githubusercontent.com/xhyrom/zed-discord-presence/main/assets/icons/",
2024-08-04 22:25:42 +02:00
2024-08-03 21:36:23 +02:00
"state": "Working on {filename}",
"details": "In {workspace}",
2024-08-04 22:25:42 +02:00
// URL for large image
"large_image": "{base_icons_url}/{language}.png",
"large_text": "{language:u}", // :u makes first letter upper-case
// URL for small image
"small_image": "{base_icons_url}/zed.png",
"small_text": "Zed",
2024-08-18 20:26:57 +02:00
// Rules - disable presence in some workspaces
"rules": {
2024-08-20 07:35:14 +02:00
"mode": "blacklist", // or whitelist
2024-08-18 20:26:57 +02:00
"paths": [
"absolute path"
]
},
2024-08-03 21:36:23 +02:00
"git_integration": true
}
}
}
}
```
2024-08-04 22:25:42 +02:00
2024-08-18 20:26:57 +02:00
You can also use `null` to unset the option. Possible for everything except `base_icons_url` , `rules` and `git_integration`