1
0
mirror of https://github.com/jiriks74/presence.nvim synced 2024-11-23 20:37:50 +01:00

Fix invalid XDG runtime dir socket path

This commit is contained in:
Andrew Kwon 2021-04-29 17:30:03 -07:00
parent 9bae4debba
commit 2a678f03e8

@ -94,11 +94,16 @@ function Presence:setup(options)
self:set_option("client_id", "793271441293967371") self:set_option("client_id", "793271441293967371")
self:set_option("debounce_timeout", 15) self:set_option("debounce_timeout", 15)
local discord_socket = self:get_discord_socket()
if not discord_socket then
self.log:error("Failed to get Discord IPC socket")
end
-- Initialize discord RPC client -- Initialize discord RPC client
self.discord = Discord:init({ self.discord = Discord:init({
logger = self.log, logger = self.log,
client_id = options.client_id, client_id = options.client_id,
ipc_socket = self:get_discord_socket(), ipc_socket = discord_socket,
}) })
-- Seed instance id using unique socket address -- Seed instance id using unique socket address
@ -273,7 +278,7 @@ function Presence:get_discord_socket()
local var = env_vars[i] local var = env_vars[i]
local path = vim.loop.os_getenv(var) local path = vim.loop.os_getenv(var)
if path then if path then
return path..sock_name return path:match("/$") and path..sock_name or path.."/"..sock_name
end end
end end