-
Notifications
You must be signed in to change notification settings - Fork 63
The Icons
The short answer would be: they work on a very complex manner, or at least somehow that's not easy to figure out for people who are new to Discord applications, Kotlin, Gradle, or programming in general.
Luckily for you, this section's aim is to try and explain how this was archived, and how the project itself manages to show up different icons to your Discord profile. This being said, let's say we would like to archive something like this:
Clearly, that kitty was not placed there by default, so let's see how we could go about doing something like that.
- First off, clone the repo:
git clone https://github.com/Almighty-Alpaca/JetBrains-Discord-Integration
This will basically download the project, which you can compile into the plugin itself, to therefore install it from your IDE.
- Create a Discord application over at Discord's official apps site .
For this project's matter, each application you create will hold the language icons remotely for the plugin to display on your Discord status. The reason local copies of icons do exist within icons/themes/
is only so they can get uploaded to different Discord applications (one for each IDE) by an script all at once, so they are always in sync.
When you create your application, save your app ID, you will need it later. The ID are the numbers right under the CLIENT ID field:
- Delete all of the existing themes but one, so you can use this remaining as base.
Local themes (which can be found here) are not the ones displayed by the application to Discord directly, but as stated above they do get uploaded to your Discord applications, and from there they can be displayed to your Discord status.
Replace all of the icons you want now. For example, the java.png should currently be the Java icon with a coffee cup, but you could go about replacing it for a picture of a kitty. Just rename the kitty's picture to java.png and replace it (1024x1024 are the recommended dimensions).
There is a programmed task to upload the icons, which can be executed from the project root via command prompt executing the following command:
./gradlew upload
But don't do it yet! You must finish configuring some things still!.
- Your Discord application token will come in handy now. If you used Material as your base, you may find this YAML file within your themes folder (should be the same for other themes, just swap material for flat, etc), which specifies different Discord application IDs for all of the IDEs JetBrains offers. It's done this way so all of the language icons along with the IDE's icon are fetched from specific Discord apps.
Essentially, you will have to delete all of the application IDs which don't pertain to you (the numbers next to the IDE names), and relate the IDE(s) you will be using with your Discord application ID. i.e:
name: Material
description: Material Icons taken from the Material Theme for JetBrains IDEs
applications:
AI: 547786360308891688
If you leave the ones which come with the project and run the uploader script, it will try to upload your icons to the author's application, which you do not have access to, throwing an error 401.
- Once step 4 is done, you will have to get your Discord token and fill it in the secrets file.
- Create a Bintray account.
Once signed in, you must create a repository & a generic package within it. Leave them empty for now, the project uploader will also upload your local corresponding files to this repo.
- Get your Bintray secret API key and fill it in the secrets file.
-
The key should be under:
Edit Profile > API Key > Copy
- Edit this file to your Bintray name, repo, and package.
This will tell the plugin where to upload the themes
& languages
directories to.
- This is when you should execute the uploader task:
./gradlew upload
- Refer to your own Bintray user/repo/package within this file.
That should be it! Now everything left to do is to compile the plugin:
./gradlew
Finally, this last command will generate a .zip
file within the project root, which is the plugin to be installed from disk from your IDE's plugin menu:
Have fun with your custom icons!
Thanks for using this amazing plugin!