Git Product home page Git Product logo

krita-rpc's Introduction

Krita DRP

A Python plugin that adds Discord Rich Presence support to Krita

How to install

  1. Press the "Code" button and download zip file.
  2. Open pykrita folder
  • Windows:
    1. Press the Windows + R keys, the "Run" window will appear.
    2. Paste %UserProfile%\AppData\Roaming\krita\pykrita in this window, then press enter.
  • Linux:
    1. Navigate to ~/.local/share/krita/pykrita
  1. Open file you just downloaded (you may need 7z or WinRAR if you can't open archive)
  2. Open folder Krita-DRP-master
  3. Extract folder discord_rpc and file discord_rpc.desktop into the "pykrita" folder.
  4. Now open Krita, and click on Settings -> Configure Krita… in the menu bar.
  5. Go to Python Plugin Manager, and activate "Discord Rich Presence".
  6. There you go! You just need to restart Krita for the feature to activate

krita-rpc's People

Contributors

firstbober avatar fuzzyexpress avatar olkris2666 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

krita-rpc's Issues

Support for arrpc

Open source implementation of rich presence.

when i tried to run the krita app with the plugin enable this is what it put out in relation with the plugin

/app/lib/krita-python-libs/krita added to PYTHONPATH
krita.scripting: "Traceback (most recent call last):"
krita.scripting: "  File \"/home/Pacn/.var/app/org.kde.krita/data/krita/pykrita/discord_rpc/__init__.py\", line 1, in <module>"
krita.scripting: "    from .discord_rpc import *"
krita.scripting: "  File \"/home/Pacn/.var/app/org.kde.krita/data/krita/pykrita/discord_rpc/discord_rpc.py\", line 12, in <module>"
krita.scripting: "    RPC = Presence(DISCORD_RPC_CLIENT_ID)  # Initialize the client class"
krita.scripting: "  File \"/home/Pacn/.var/app/org.kde.krita/data/krita/pykrita/discord_rpc/presence.py\", line 13, in __init__"
krita.scripting: "    super().__init__(*args, **kwargs)"
krita.scripting: "  File \"/home/Pacn/.var/app/org.kde.krita/data/krita/pykrita/discord_rpc/baseclient.py\", line 28, in __init__"
krita.scripting: "    raise DiscordNotFound"
krita.scripting: "DiscordNotFound: Could not find Discord installed and running on this machine."
krita.scripting: "Could not import discord_rpc"
krita.scripting: Error loading plugin "discord_rpc"

Even when running an arrpc server.
It would be nice to not having to rely on the official rpc that includes proprietary libraries.

Prevents Krita from launching.

Krita seems to just freeze out on "Loading Main Window" with this plugin enabled. Running the latest version. Just as a hands up, tried resetting configs and re-starting after enabling rich presence freezes out the app. If there are any logs I can provide, please let me know.

Script Error

Here's the log. I couldn't figure out how to fix it. The script still works, but it's annoying to have the error up all the time.

`ServerError
Python 3.8.1: C:\Program Files\WindowsApps\49800KritaProject.Krita_5.1.5.0_x64__n3kgb906j1zjg\krita\bin\krita.exe
Sat Aug 5 21:14:41 2023

A problem occurred in a Python script. Here is the sequence of
function calls leading up to the error, in the order they occurred.

C:\Users\nebez\AppData\Roaming\krita\pykrita\discord_rpc\discord_rpc.py in update_rpc(self=<discord_rpc.discord_rpc.DiscordRpc object>)
31 self.time = time.time()
32 if self.file != Krita.instance().activeDocument().fileName():
33 RPC.update(details="Drawing something cool",
34 state=str(Krita.instance().activeDocument().name()) or "Unnamed",
35 large_image="krita_logo", start=int(self.time))
global RPC = <discord_rpc.presence.Presence object>
RPC.update = <bound method Presence.update of <discord_rpc.presence.Presence object>>
details undefined
state undefined
builtinstr = <class 'str'>
builtinKrita = <PyKrita.krita.Krita object>
Krita.instance =
).activeDocument undefined
large_image undefined
start undefined
builtinint = <class 'int'>
self = <discord_rpc.discord_rpc.DiscordRpc object>
self.time = 1691262773.2325375

C:\Users\nebez\AppData\Roaming\krita\pykrita\discord_rpc\presence.py in update(self=<discord_rpc.presence.Presence object>, pid=7364, state='1', details='Drawing something cool', start=1691262773, end=None, large_image='krita_logo', large_text=None, small_image=None, small_text=None, party_id=None, party_size=None, join=None, spectate=None, match=None, buttons=None, instance=True, _donotuse=True)
34 payload = _donotuse
35 self.send_data(1, payload)
36 return self.loop.run_until_complete(self.read_output())
37
38 def clear(self, pid: int = os.getpid()):
self = <discord_rpc.presence.Presence object>
self.loop =
self.loop.run_until_complete = >
self.read_output = <bound method BaseClient.read_output of <discord_rpc.presence.Presence object>>

C:\Users\nebez\AppData\Local\PowerToys\asyncio\base_events.py in run_until_complete(self=, future=<Task finished name='Task-53' coro=<BaseClient.r...ate" length must be at least 2 characters long')>)

C:\Users\nebez\AppData\Roaming\krita\pykrita\discord_rpc\baseclient.py in read_output(self=<discord_rpc.presence.Presence object>)
86 payload = json.loads(data.decode('utf-8'))
87 if payload["evt"] == "ERROR":
88 raise ServerError(payload["data"]["message"])
89 return payload
90
global ServerError = <class 'discord_rpc.exceptions.ServerError'>
payload = {'cmd': 'SET_ACTIVITY', 'data': {'code': 4000, 'message': 'child "activity" fails because [child "state" fa...tate" length must be at least 2 characters long]]'}, 'evt': 'ERROR', 'nonce': '1691262881.96334934234619140625'}
ServerError: Child "activity" fails because child "state" fails because "state" length must be at least 2 characters long
cause = None
class = <class 'discord_rpc.exceptions.ServerError'>
context = None
delattr = <method-wrapper 'delattr' of ServerError object>
dict = {}
dir =
doc = None
eq = <method-wrapper 'eq' of ServerError object>
format =
ge = <method-wrapper 'ge' of ServerError object>
getattribute = <method-wrapper 'getattribute' of ServerError object>
gt = <method-wrapper 'gt' of ServerError object>
hash = <method-wrapper 'hash' of ServerError object>
init = <bound method ServerError.init of ServerErro...ate" length must be at least 2 characters long')>
init_subclass =
le = <method-wrapper 'le' of ServerError object>
lt = <method-wrapper 'lt' of ServerError object>
module = 'discord_rpc.exceptions'
ne = <method-wrapper 'ne' of ServerError object>
new =
reduce =
reduce_ex =
repr = <method-wrapper 'repr' of ServerError object>
setattr = <method-wrapper 'setattr' of ServerError object>
setstate =
sizeof =
str = <method-wrapper 'str' of ServerError object>
subclasshook =
suppress_context = False
traceback =
weakref = None
args = ('Child "activity" fails because child "state" fai..."state" length must be at least 2 characters long',)
with_traceback =

The above is a description of an error in a Python program. Here is
the original traceback:

Traceback (most recent call last):
File "C:\Users\nebez\AppData\Roaming\krita\pykrita\discord_rpc\discord_rpc.py", line 33, in update_rpc
RPC.update(details="Drawing something cool",
File "C:\Users\nebez\AppData\Roaming\krita\pykrita\discord_rpc\presence.py", line 36, in update
return self.loop.run_until_complete(self.read_output())
File "asyncio\base_events.py", line 612, in run_until_complete
File "C:\Users\nebez\AppData\Roaming\krita\pykrita\discord_rpc\baseclient.py", line 88, in read_output
raise ServerError(payload["data"]["message"])
discord_rpc.exceptions.ServerError: Child "activity" fails because child "state" fails because "state" length must be at least 2 characters long

`

Krita hangs at launching when offline

I can't work offline with this extension enabled, if I'm online it launches quickly, but if I turn off wifi, krita seems to just hang in the loading screen and even the operating system starts reporting that the application is not responding, turn on wifi and it immediately continues. maybe the code needs to handle connection errors more gracefully to allow offline work? If it matters I'm on Debian 12 using Krita 5.2.2 AppImage.

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.