Closed daUnknownCoder closed 2 days ago
Hello! Thanks for reaching out!
if my
client
name isNeutronVim
what should i keep ineditor.client
? [NeutronVim
orneutronvim
(as in readme)]
You will need to create a Discord Application. The rich presence's name is determined by the name of that application (Playing XYZ). You will then need to copy the application's ID and set editor.client
to that ID.
coz i dont have it (the image) hosted online anywhere
The image has to be hosted somewhere online. If you use a third-party hosting service, you can provide a direct URL to the icon in editor.image
. Or, you can upload the image as an asset under your application's Rich Presence -> Art Assets section and simply provide the name of the asset. Do note that it may take a while for Discord to update its file cache.
And regarding the linked issue, I haven't used Hyprland personally, but from my research, the configuration file appears to be named as hyprland.conf
. If this naming is consistent, you could configure it as follows:
editor = {
image = 'https://...',
client = '01234567890',
},
assets = {
['hyprland.conf'] = 'https://...',
-- ['hyprland.conf'] = {
-- icon = 'https://...',
-- tooltip = 'Hyprland Config', -- Optionally set a tooltip
-- },
},
I hope this helps! If you have any more questions, feel free to ask.
I haven't used Hyprland personally, but from my research, the configuration file appears to be named as
hyprland.conf
It should be anything under the ~/.config/hypr
with hypr*.conf
Hm, it seems that this would require an additional check for the entire path and a way to match against patterns, which Cord does not currently support, as it may introduce unwanted overhead and make the codebase a bit too complex. Are there any other common names for the config file besides hyprland.conf
and hypr.conf
? You could provide the same icon for each of them.
like anything under ~/.config/hypr
falls under the jurisdiction of hyprland (theres also a treesitter grammer made only for hyprland (hyprlang) -> an lsp is also in the works (hyprls)
That requires iterating over the table until a match is found, which seems to be a performance bottleneck (current implementation uses a simple table lookup), given that it runs on each presence update. One thing we can do is introduce two new fields to the configuration, one, where you specify the directories to be searched and one for pattern matching. To avoid cluttering, I'd have them organized into one general field as follows:
assets = {
ids = {}, -- regular assets are moved here
dirs = {},
patterns = {},
}
But that would be a breaking change to the configuration structure. I could inform the users in the commit's description, and/or support the old way of defining assets alongside the new way, although I'm not very fond of this idea. What do you think?
i guess theres no need for breaking stuff...
so vim.bo.filetype results in hyprlang
so this code snippet works for me:
assets = {
lazy = {
name = "Lazy",
icon = "https://avatars.githubusercontent.com/u/122150220?s=200&v=4",
tooltip = "lazy.nvim",
type = 2,
},
hyprlang = {
name = "Hyprland",
icon = "https://styles.redditmedia.com/t5_6sciw0/styles/communityIcon_h3cvittvupi91.png",
tooltip = "Hyprland",
type = 1,
},
},
Heyo i found a bug... 🐞
when doing config.display.swap_icons = true
, the icons do switch but the tooltips dont
it doesnt change from lua
to the superior text editor
or whatever the text was...
i guess theres no need for breaking stuff...
I'll still have to implement those two in the near future, but we can put it off for the time being if the treesitter approach is working for you.
when doing
config.display.swap_icons = true
, the icons do switch but the tooltips dont
Whoops, can confirm. Looks like I forgot to reassign the two. I'll push a fix asap.
and yeah the buttons thing doesnt work my config:
{
"vyfor/cord.nvim",
build = "./build",
event = "VeryLazy",
opts = {
display = {
show_cursor_position = true,
swap_icons = true,
},
editor = {
image = "untitled_design_6_1_",
client = "1258853126916800655",
},
lsp = {
show_problem_count = true,
scope = "buffer",
},
assets = {
lazy = {
name = "Lazy",
icon = "https://avatars.githubusercontent.com/u/122150220?s=200&v=4",
tooltip = "lazy.nvim",
type = 2,
},
hyprlang = {
name = "Hyprland",
icon = "https://styles.redditmedia.com/t5_6sciw0/styles/communityIcon_h3cvittvupi91.png",
tooltip = "Hyprland",
type = 1,
},
},
buttons = {
{
label = "View Repository",
url = "git",
},
},
},
},
i mean it can be i dont know how to do it or im doing it wrong coz i also checked ur dotfiles and can confirm its not working for me
If you've received the new UI update related to user profiles, I believe the issue lies within the Discord client itself, as I'm experiencing the same thing. Perhaps you could ask a friend to confirm whether the button appears for them.
If you've received the new UI update related to user profiles, I believe the issue lies within the Discord client itself, as I'm experiencing the same thing. Perhaps you could ask a friend to confirm whether the button appears for them.
the 0.0.58
discord patch right??
none of my friends use linux 🫠, i am the lone wolf who overcome the adversity of linux cli, perhaps you can switch window managers? i only use hyprland so i have no other manager and the time it would take would be a waste
No, what I mean is to ask someone on Discord to check whether you actually have the buttons on your Rich Presence, as this may be a bug on the client-side. If that does not help, try to replace git
with the actual repository url, in case it fails to fetch it from the config.
Pushed a fix to master. config.display.swap_icons
should behave correctly now. Do you have any other questions?
Pushed a fix to master.
config.display.swap_icons
should behave correctly now. Do you have any other questions?
that was quick (it works)
No, what I mean is to ask someone on Discord to check whether you actually have the buttons on your Rich Presence, as this may be a bug on the client-side. If that does not help, try to replace
git
with the actual repository url, in case it fails to fetch it from the config.
i just launched discord on my browser and there's no sign of the button (i also tried switching accounts and accessing my account thru my alt which failed)
i also tried this:
buttons = {
{
label = "View Repository",
url = "https://github.com/daUnknownCoder/NeutronVim",
},
},
Well that's strange, there are no issues on my end:
Do you mind continuing this conversation on Discord? I go by vyfor
i just launched discord on my browser and there's no sign of the button (i also tried switching accounts and accessing my account thru my alt which failed)
I'll be closing the issue as it turned out to be a bug on Discord's side. Feel free to open a new one if you have any other questions.
I am working on my own Neovim Distro, i have it in my
$NVIM_APPNAME
but idk how to useeditor.image
(i made a logo)? should i add a file location? [like~/Downloads/img.png
?] coz i dont have it hosted online anywhereif my
client
name isNeutronVim
what should i keep ineditor.client
? [NeutronVim
orneutronvim
(as in readme)]will
cord
be able to see-through things? like i opennvim-tree
and it updates, i openlazy
it updates, i opentelescope
it updates?in this:
so can i overcome the previous problem i had with jiriks's presence plugin (he forked over the unmaintained andweeb version)?: jiriks74/presence.nvim#44