Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to determine Discord IPC socket path #131

Open
xbz-24 opened this issue Oct 26, 2023 · 6 comments
Open

Failed to determine Discord IPC socket path #131

xbz-24 opened this issue Oct 26, 2023 · 6 comments
Labels
bug Something isn't working

Comments

@xbz-24
Copy link

xbz-24 commented Oct 26, 2023

Description

im using standard build standard setup, I have used discord RPC before in other OS and have worked fine (mint, windows) , but since I installed artix I tried to install my favorite plugin and its not working when I do :messages in nvim i get:

[presence.nvim] Setting up plugin for linux
[presence.nvim] Failed to determine Discord IPC socket path
[presence.nvim] Using id 99298229-b853-403f-a2a0-91503a0630ff
[presence.nvim] Completed plugin setup
[presence.nvim] Getting nvim socket paths...
[presence.nvim] Executing command: ss -lx|grep "nvim.*/0"
[presence.nvim] Custom setup not detected, using defaults
[presence.nvim] Handling BufEnter event...
[presence.nvim] Discord IPC socket not found, skipping...
[presence.nvim] Got nvim socket paths: {}
[presence.nvim] No other remote nvim instances
[presence.nvim] Handling FocusGained event...
[presence.nvim] Discord IPC socket not found, skipping...
[presence.nvim] Handling FocusGained event...
[presence.nvim] Discord IPC socket not found, skipping...
[presence.nvim] Handling FocusGained event...
[presence.nvim] Discord IPC socket not found, skipping...
Press ENTER or type command to continue

Please help I have been very interested in using this amoing LunarVim but since its not working there as well I tried deleting all my config for neovim just to set this up properly and avoid other errors but still didnt found out a solution, theres probably a package im missing or my directories are named other way since Artix is not a popular distro, please let me know which parts of the code I need to analyze and fix to make this work since this is my favorite plugin

Neovim version

[daily@dev ~]$ nvim --version
NVIM v0.9.4
Build type: Release
LuaJIT 2.1.1696795921

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info
[daily@dev ~]$

OS information

Artix x86_64, 6.5.7-artix-1-1 with runit init system

Steps to reproduce

call plug#begin('~/.config/nvim/plugged')
Plug 'git@github.com:andweeb/presence.nvim.git'
call plug#end()

let g:presence_auto_update = 1
let g:presence_neovim_image_text = "Editando con Neovim"
let g:presence_main_image = "neovim"
let g:presence_enable_line_number = 0
let g:presence_show_time = 1

let g:presence_editing_text = "Editando %s"
let g:presence_reading_text = "Leyendo %s"
let g:presence_log_level = "debug"

Logs

image

@xbz-24 xbz-24 added the bug Something isn't working label Oct 26, 2023
@xbz-24
Copy link
Author

xbz-24 commented Oct 26, 2023

-- Find the Discord socket from temp runtime directories
function Presence:get_discord_socket_path()
local sock_name = "discord-ipc-0"
local sock_path = nil

if self.os.is_wsl then
    -- Use socket created by relay for WSL
    sock_path = "/var/run/"..sock_name
elseif self.os.name == "windows" then
    -- Use named pipe in NPFS for Windows
    sock_path = [[\\.\pipe\]]..sock_name
elseif self.os.name == "macos" then
    -- Use $TMPDIR for macOS
    local path = os.getenv("TMPDIR")

    if path then
        sock_path = path:match("/$")
            and path..sock_name
            or path.."/"..sock_name
    end
elseif self.os.name == "linux" then
    -- Check various temp directory environment variables
    local env_vars = {
        "XDG_RUNTIME_DIR",
        "TEMP",
        "TMP",
        "TMPDIR",
    }

    for i = 1, #env_vars do
        local var = env_vars[i]
        local path = os.getenv(var)
        if path then
            self.log:debug(string.format("Using runtime path: %s", path))
            sock_path = path:match("/$") and path..sock_name or path.."/"..sock_name
            break
        end
    end
end

return sock_path

end

image

@xbz-24
Copy link
Author

xbz-24 commented Oct 26, 2023

this part of the code is not working, can someone help me fix this?

@xbz-24
Copy link
Author

xbz-24 commented Oct 26, 2023

guys I need help

[daily@dev presence]$ find /run/user/$(id -u) -name "discord-ipc-0"
find: ‘/run/user/1000’: No such file or directory
[daily@dev presence]$ echo $XDG_RUNTIME_DIR
echo $TEMP
echo $TMP
echo $TMPDIR

[daily@dev presence]$

@xbz-24
Copy link
Author

xbz-24 commented Oct 26, 2023

-- Find the Discord socket from temp runtime directories
function Presence:get_discord_socket_path()
local sock_name = "discord-ipc-0"
local sock_path = nil

if self.os.is_wsl then
    -- Use socket created by relay for WSL
    sock_path = "/var/run/"..sock_name
elseif self.os.name == "windows" then
    -- Use named pipe in NPFS for Windows
    sock_path = [[\\.\pipe\]]..sock_name
elseif self.os.name == "macos" then
    -- Use $TMPDIR for macOS
    local path = os.getenv("TMPDIR")

    if path then
        sock_path = path:match("/$")
            and path..sock_name
            or path.."/"..sock_name
    end
elseif self.os.name == "linux" then
    -- Check various temp directory environment variables
    local env_vars = {
        "XDG_RUNTIME_DIR",
        "TEMP",
        "TMP",
        "TMPDIR",
    }

    for i = 1, #env_vars do
        local var = env_vars[i]
        local path = os.getenv(var)
        if path then
            self.log:debug(string.format("Using runtime path: %s", path))
            sock_path = path:match("/$") and path..sock_name or path.."/"..sock_name
            break
        end
    end
end

return sock_path

end

@xbz-24
Copy link
Author

xbz-24 commented Oct 26, 2023

I tried echoing these enviroment variables none of them worked

@xbz-24
Copy link
Author

xbz-24 commented Oct 26, 2023

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant