darkhz / invidtui

A TUI based Invidious client
MIT License
189 stars 6 forks source link

ipc server can only bind to socket when running mpv as root #5

Closed Cosmic-Onion closed 2 years ago

Cosmic-Onion commented 2 years ago

ipc server can only bind to socket when running mpv as root, when installed through AUR and release binary.

Error: Error: Could not connect to socket is printed from the MPVConnect function.

darkhz commented 2 years ago

Hmm, weird. I'm able to create and bind to sockets as a non-root user. What are the permissions on your config dir (~/.config, ~/.config/invidtui or ~/.invidtui paths)?

Cosmic-Onion commented 2 years ago

yes it is strange.

ls -la drwxr-xr-x .config drwxr-xr-x .config/invidtui

ghost commented 2 years ago

I do not know if it is the same issue, but I get this error: Error: Socket exists at /home/user/.config/invidtui/socket, is another instance running?

It happens every time I close mpv. So, every time I have to go to invidtui folder and delete "socket" file, and it starts to work well. Any way to avoid this?

darkhz commented 2 years ago

@bambirombi use the --close-instances option.

ghost commented 2 years ago

@darkhz It worked, but I have to do that every time I start invidtui. Is there anyway of not having to do that all the time? I mean simply putting invidtui in terminal and open it. I do not have this problem with other tuis as ytui-music or yewtube.

darkhz commented 2 years ago

@bambirombi you'll have to do a clean exit, i.e quitting from invidtui rather than closing mpv itself. Invidtui checks if a socket is present so that it doesn't load multiple instances of itself, so on quitting from invidtui (i.e, pressing 'q') will automatically delete the socket file. Closing mpv will not delete the socket file.

I'll implement a feature where the mpv socket gets deleted on closing mpv too.

ghost commented 2 years ago

@darkhz Thanks! That is exactly the behavior I want.

hhakk commented 9 months ago

@Cosmic-Onion Hi, I ran into the same problem. Are/were you by any chance running this: https://github.com/wis/mpvSockets (in .config/mpv/scripts)?

The mpvSockets script starts mpv always with a mpv --input-ipc-server flag pointing to /tmp/mpvSockets/<pid>, which interferes with invidtui.

@darkhz I suppose this might be of interest to you as well as I am probably not the only one running mpvSockets script and trying this program out.