Giter VIP home page Giter VIP logo

elcord's Introduction

elcord

MELPA

Discord Rich Presence for Emacs

Show off your emacs-savy ways to all your Discord friends and strangers.

This package will connect with a local Discord client to update your status via the Discord Rich Presence API.

Installing

Installing from MELPA

elcord is available from MELPA

To install: M-x package-install RET elcord RET

Installation from Source

Simply place elcord.el file in a place Emacs can find it load/require it.

Note for Windows

Make sure that the stdpipe.ps1 is in the same directory as the elcord.el file.

Talking with Discord's IPC mechanism is achieves through this PowerShell script to get around Emacs' inability to talk through named pipes on Windows. Everything should work out-of-the-box. Just make sure this PowerShell script is installed in the same directory as your elcord.el file.

Usage

After installing, enable elcord-mode.

Minimal init file:

(require 'elcord)
(elcord-mode)

There are customization options available.

Try M-x customize-group RET elcord RET

Icons

While the alist elcord-mode-icon-alist is customizable, all icon ID's are linked to the application pointed to by elcord-client-id. If you'd like to request a new icon for a major mode be added, please open an issue.

Custom Discord Application

Alternatively, you may create your own 'Application' with its own set of icons.

For creating an 'Application':

  1. Visit Discord's application page
  2. Create a new application and upload icons as a "small" asset.

After you've created your application, Customize elcord-client-id to be the new application's client ID, and set the value of elcord-mode-icon-alist as appropriate to reference your new icons.

elcord's People

Contributors

ardek66 avatar chaoky avatar dscsk8er55 avatar feyorsh avatar insipx avatar jchedal-anglay avatar lennyphoenix avatar mstrodl avatar nnoodle avatar omurovec avatar port19x avatar richyliu avatar sebastianmarines avatar skykanin avatar v3natio avatar ve-nt avatar zackattackz avatar zulu-inuoe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

elcord's Issues

Godot File Support

Could we get support for GDScript, TSCN and TRES files? I'd be willing to make the PR.

doom_cute_icon does not work

Setting elcord-editor-icon to doom_cute_icon doesn't work and the image isn't shown, but it works for other images.

(setq elcord-editor-icon "doom_cute_icon")
(elcord-mode)

image

(setq elcord-editor-icon "doom_cute_icon")
(elcord-mode)

image

Add icons (linked below) for Assembly, Hy, Julia, OCaml, Pascal, and UML.

I wanted to request an addition of icons for major modes such as OCaml, and UML. I saw two other issues that were still open requesting icons for Assembly and Pascal (Issue #29), Hy and Julia (Issue #40). So I took the liberty of making those icons as well. I noticed all the icons follow a 512x512 format so I've done the same for the ones I'm linking below.

puml-mode-icon
pascal-mode-icon
ocaml-mode-icon
julia-mode-icon
hy-mode-icon
assembly-mode-icon

pascal and assembly language icons?

Hello, I'd like to suggest that a Pascal (.pas) icon and assembly language (.asm/.s) icon (like what Visual Studio uses, the letters ASM in red) be displayed in rich presence when editing those types of files. I know nobody really writes in the former anymore, but I do :D

EMMS Support

Well, this might seem like a very silly feature but, it would be pretty amazing to display what EMMS is currently playing. I don't know how the Discord rich application integration system works but, would it be possible to print the value of another variable as well? like... A string we define

Allow the user to display the elapsed time

I would like the ability to display the elapsed time as an option, the same way you can set elcord-display-buffer-details to t or nil.
The result would look like this:
Screenshot from 2019-05-31 19-15-35
I already have a working version, I could make a PR if you accept the feature request.

Disable elcord messages in the minibuffer

I don't want to see elcord: connecting... every time I start Emacs or close Discord. I tried using diminish to hide them, however elcord does not seem to be recognized as a minor mode by it:
image
Is it possible to disable those messages?

Add Shell Icon

I write a ton of shell scripts, a shell icon would be cool

Constantly disconnecting and reconnecting

So, this is pretty much the same issue as #48.

However, I am not using Spacemacs, just regular Emacs 28.1
I also am on Windows with the .NET 6.0 SDK, so I have a C# compiler.
Running Powershell -NoProfile -ExecutionPolicy Bypass ./stdpipe.ps1 works.

RPC is not updated when HTML file is opened

I recently started creating my own assets for elcord. While I'm doing that I noticed something when I open a HTML file (without having any form of configuration done for HTML files) the RPC is not showing that I'm editing that HTML file even after the delay (15 secs) and the RPC shows the buffer that I was last edited.

On the other hand, my friend, who has the web mode when edited a HTML file the RPC is showing that he is editing the HTML file.

Does not work with Rust

I already checked if rust-mode is being detected and it is. By doesn't work i mean that it did show up in discord when i was editing a lisp file, (.emacs), but it does not update when I switch to a Rust file

Elcord stuck at 'attempting reconnect'

I'm currently using Pop!_OS 22.04, installed Elcord through M-x package-install RET elcord RET, added

(require 'elcord)
(elcord-mode)

to my .emacs file and installed Discord by unpacking the .tar.gz as suggested in issue #8, still not connecting!!!

I'm quite new to linux so idk if I'm missing something, please help!!!

support private buffer ignore list

I think I could use boring buffers if I also changed my buffer display format to include the full path, but it would be nice to say "don't update buffers in ~/journal" so others don't see "X is editing personal-journal.org`.

Or maybe a whitelist would be better for this type of thing.

More flexible 'boring modes' mechanism

It'd make sense to not bother reporting presence information for certain types of buffers. Ones that come to mind:

  1. minibuffer (explicitly ignored by elcord)
  2. neotree
  3. treemacs
  4. helm
  5. dired?

Maybe others.
It makes sense to allow for some sort of user-extensible test for these 'boring' buffers

Idle support

It would be nice to have elcord stop or change text when the user is idle.
it could be configured via an option: (setq elcord-idletimer 360).

Can't disable elcord-mode

I can't seem to be able to disable elcord, I tried calling elcord-mode but it still sends updadtes to the Rich Presence, however long I wait. Calling it several times does not seem to help either.

Extract from my *messages*:

Starting Emacs daemon.
When done with this frame, type C-x 5 0
Configuring package helm...done (0.237s)
Elcord mode enabled
elcord: attempting reconnect..
elcord: connecting...
elcord: connected. starting updates
Elcord mode disabled
elcord: disconnected
elcord: attempting reconnect..
elcord: connecting...
elcord: connected. starting updates
Elcord mode enabled
elcord: attempting reconnect..
elcord: connecting...
Elcord mode disabled
elcord: disconnected
elcord: attempting reconnect..
elcord: connecting...
elcord: connected. starting updates

I'm using Fedora 27 and Emacs 25.3.1

More flexible icon/text selection mechanism

Selecting icons currently works on a relatively simple major-mode -> icon/text alist.

However, I'd like the ability to have more complicated scenarios where the same major mode might map to a different icon/text.
My specific use-case: When using sly, I want to have a custom icon for when my remote connection is talking to SBCL, CCL, ECL, or another.
I've implemented a prototype in https://github.com/Mstrodl/elcord/tree/develop but I think I want something even better.

With that change, rather than a string for icon/text, a function can determine the string (or return nil to yield).
That works, except I still have to add an entry for each and every sly-relevant mode (the debugger buffer, the inspector, the xref buffer, etc).
So I can see three ways forward:

  1. Allow the car of each entry in elcord-mode-icon-alist (and text) be a predicate function to say if the entry matches, rather than specifically a symbol being the mode
  2. Allow the car of each entry to be a regex to match the mode name against
  3. Switch the alists to allow function entries which are the dispatch functions (return nil if no match)
  4. Suck it up and add an entry for each and every relevant major mode

With 1 I think it's a no-go, because that makes current entries invalid (no way to differentiate a symbol being a major mode name from a function)
2 or 3 seem reasonable to me, but I don't like 3 because the variable is named -alist and it wouldn't be

Figure I open an issue to document this as I move forward

Support Unicode file names.

Reproduce Steps: Edit file named ใ„.txt -> elcord gets disconnected by discord.

elcord doesn't support sending unicode properly over the wire. pypresence can do this so it is possible, I'm just unsure how to get it to work otherwise I'd open a PR.

Not connection, elcord: attempting reconnect..

On ubuntu 16.04, installed discord via snap store, and elcord refuses to connect. Tried config with use-package and require as shown in the readme. Elcord was definitely installed, but it just keeps trying to reconnect.

Terraform icon not showing up

Hi, I created #57 to add support for Terraform, the PR was merged but the icon doesn't show up in Discord.
image

I checked the Publish icons workflow that ran when my PR was merged and it seems like it failed to publish the new icon.
image

I'm fairly new to Emacs Lisp so I don't know if I need to add something else to my PR or if the maintainers need to try to publish the icon.

Thanks in advance.

Add emacs beautyline icon

For Garuda Linux users, and others that use a similar theme, I'd propose to add this emacs icon (icon from beautyline kde theme):

emacs-beautyline-icon

The dimensions are 1024x1024. If I got them wrong, here is the svg file:

emacs-beautyline-icon

What do you think about it?

Package cl is deprecated

On Emacs 27+ we get the warning Package cl is deprecated.

It seems cl-lib is being used for a handful of things here and there. It would be good to remove its usage. I'd still like to maintain backwards-compatibility with at least Emacs 26, though

[bug] RPC doesn't update when changing buffers.

Hello there. So the title is pretty self-explanatory.
For me it just stays on "Editing * dashboard * and if I open a file, it doesn't update. If it matters, I don't run Emacs as daemon.

Also, dev tools mentioned something about not being able to load content?

Support Discord API

I don't use Discord desktop client since I use it with Franz, so I use the web page.
It would be nice to have elcord request discord API if it supports it

Support for multiple clients/accounts

Hey there,

I've just set this up and I really like using it so far! Thanks for writing it.

I usually have 2 clients running with my 2 accounts (long story); would it be possible to set the elcord-client-id to a list to apply elcord to each client?

A few small potential aesthetic changes to how it looks in the status

The big icon could be changed to be the code type and the small icon could be changed to be the emacs logo if there's a custom code type icon (the small one is hard to see currently).

The text on the code type image could be changed to "editing a code type file".

I was also wondering about making the second line something like the front part of the file path, but I see that's already been mentioned here.

Which additional setup is needed for elcord to support arRPC?

Switched from webcord to armcord, which supports rich presence via arRPC, but it doesn't work out of the box. Should it? Is additional setup needed? Or it isn't supported at all for now?

2 lines present in Messages buffer:

elcord: connecting...
elcord: connected. starting updates

But i don't see any rich presence in armcord (ofc i do have arrpc enabled in armcord's settings.

Add Hy and Julia Icons

I don't believe there is an icon for Hy (.hy/hy-mode, the octopus could be used as the icon), or at least it isn't working for me if there is one. Same goes for Julia (.jl/julia-mode).

Thank you!

Disable elcord's rich presence when editing *scratch*

I use emacs --daemon, and frequently get queries about why "I've been playing Emacs for two days".
When I'm not actively editing a file, Discord shows me as editing the scratchpad.
Hence, I'd like to have functionality where Elcord disables rich presence when editing the buffer *scratch*, possibly only if the daemon is enabled, which can be checked via (daemonp).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.