Git Product home page Git Product logo

obsidian-discordrpc's Introduction

Obsidian Discord Rich Presence Plugin

GitHub Workflow Status GitHub release (latest by date) GitHub All Releases

Update your Discord Status to show your friends what you are working on in Obsidian. With Discord Rich Presence.

Rich Presence Preview

Usage

After enabling the plugin in settings, your Discord status should show that you are using Obsidian.md.

If Discord isn't open, then you will see "Reconnect to Discord" at the botton of the screen. You can click that to attempt to reconnect. It will only connect if Discord is open.

You can also reconnect to discord rich presence via the Reconnect to Discord command in the command palette. If there is an issue.

Features

  • Updates your Discord Status with Obsidian info, Vault Name and/or Current File Name.
  • Allows you to customise what info is shown.

Settings

Vault Name Settings

  • Toggle whether or not to show Vault Name
  • Set a custom Vault Name to show publicly

File Name Settings

  • Toggle whether or not to show Current File Name
  • Toggle whether or not to show the current file extension

Time Settings

  • Toggle Whether or not to use the total time you have been using Obsidian, instead of the time spent editing a single file.

Notice Settings

  • Toggle whether or not to show Connection Notices

Contributors

@leoccyao

  • Added the disconnect feature
  • Made the plugin much more user friendly

Issues

If you have any issues or suggestions please create an issue or a pull request.

Compatibility

This plugin currently requires Obsidian v0.9.10+

Install

You can install the plugin via the Community Plugins tab within Obsidian.

Manually installing the plugin

  • Copy over main.js, manifest.json to your vault VaultFolder/.obsidian/plugins/your-plugin-id/.

obsidian-discordrpc's People

Contributors

blankparticle avatar leoccyao avatar lukeleppan 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

Watchers

 avatar  avatar

obsidian-discordrpc's Issues

Support custom messages/statistics (such as word counts) in rich presence

After months of showing off all my amazing vault names to my friends, I wanted to do a bit more with my Rich Presence. Word count progress as I write, maybe?

I actually added a few lines of code to my own build to achieve this. For example, passing this string to status makes today's word and character counts appear (thanks to your Better Word Count plugin!):

`${this.getApp().plugins.plugins["better-word-count"].dataManager.todayCounts.words} words, ${this.getApp().plugins.plugins["better-word-count"].dataManager.todayCounts.characters} chars today`

image

While adding the following to onload() makes the word count refresh every 30 seconds (staying reasonably updated, while also abiding by Discord API limits), instead of just when a new file is opened:

this.registerInterval(window.setInterval(async () => 
      this.setActivity(this.app.vault.getName(), this.currentFile.basename, this.currentFile.extension)
, 30000));

What I'd love to see is some more customizable way to set Rich Presence messages, beyond the vault/filename customization options. For example, maybe the templating syntax for the Better Word Count status bar could also be implemented in this plugin, with the possibility of users also defining their own code snippets such as the words/characters today one?

Incompatibility with mobile

This plugin is incompatible with mobile. I assume this is not easily fixed, so it would be helpful to mark the plug-in as "Desktop Only" to clarify such.

The plugin doesn't connect to discord at all

When i installled the plugin , it shows me a message that it failed to connect to discord , it is the same message when i click on "Reconnect to Discord"
I hope there is a solution please

Failed to connect to Discord error

Hi, I can't seem to get this plugin to work at all. Clicking Reconnect to Discord in the status bar causes the "Failed to connect to Discord" error to display immediately. Discord app is running. Is there anything I can do to help troubleshoot? Thanks!

Obsidian v0.11.13
Discord Rich Presence 1.5.0
Ubuntu 20.04

Cannot connect to Discord Canary

I had Discord Canary for Windows installed. I did not have the regular non-testing-client version of discord installed.
Discord Rich Presence refused to connect.
After downloading and installing the regular build of discord, Discord Rich Presence had no trouble connecting.

OS: Windows 11
Discord Canary: 108697 (343d7a7)
Obsidian: 0.13.12
Discord Rich Presence: 1.5.0

How to compile Locally?

I run npm i and it gives me this info

npm WARN [email protected] requires a peer of register-scheme@github:devsnek/node-register-scheme but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

audited 271 packages in 2.791s

25 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

and when i load the compiled plugin, it shows

app.js:1 Plugin failure: obsidian-discordrpc Error: Cannot find module 'register-scheme'
Require stack:
- electron/js2c/renderer_init
    at Module._resolveFilename (internal/modules/cjs/loader.js:887)
    at Function.o._resolveFilename (electron/js2c/renderer_init.js:33)
    at Module._load (internal/modules/cjs/loader.js:732)
    at Function.f._load (electron/js2c/asar_bundle.js:5)
    at Function.o._load (electron/js2c/renderer_init.js:33)
    at Module.require (internal/modules/cjs/loader.js:959)
    at require (internal/modules/cjs/helpers.js:88)
    at pe (app.js:1)
    at a (app.js:1)
    at anonymous (eval at <anonymous> (app.js:1), <anonymous>:7:20)

I tried manually cloning https://github.com/devsnek/node-register-scheme into node_modules folder and still its them same.
I am new to npm, njs :(

It would be helpful if you can add some instructions for nubs like me.
Thanks.

Idea: Ability to hide specific note titles

Would it be possible to add the ability to hide specific notes using a specifiable field property (YAML-based or works with Dataview preferred) or tag?

Use case example:

I've been using Obsidian as a mixture of PKM and daily notes. This includes having notes on people so that I can link them in my daily notes (eg. 11:00 AM Meeting with [[Jane Smith]]) While I don't mind sharing PKM or daily note titles on Obsidian, I'd prefer to keep some notes (like a person's name) private while I'm editing their note.

Bug: Plugin does not connect to Discord

Hello,

I am unable to connect this plugin to DC. No error message is generated, neither when disconnecting nor when reconnecting. Nonetheless, DC is not showing a link, and also doesn't prompt me to link Obsidian (as it usually does when an external app asks to be linked).


Obsidian version: 0.15.9
Plugin Version: 1.5.0


Any help is welcome.

Thank you.
Sincerely,
~Gw


Edit: Running W11

Does not detect when a new file is created and being edited

Hello,

I'm not sure if this is a bug from my side, but I noticed that the plugin does not detect the file when I create a new file to start working on it. The only way to resolve this is to manually turn off and on again in the community plugins and then it is able to detect the file again. If I then create another new file to edit, the problem rises again.

Note: It doesn't detect the file in a sense that it does not describe precisely what I am working on even after I have named the newly created file. It only says "Editing Untitled (XX::XX elapsed)" instead of "Editing Filename (XX:XX elapsed)".

For reference,
image
image

After turning off and on again,
image

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.