gnome-shell-extension-gsconnect icon indicating copy to clipboard operation
gnome-shell-extension-gsconnect copied to clipboard

I can't control the GNOME 45 cursor

Open fabrixx opened this issue 1 year ago • 1 comments

Describe the bug

I can get everything to work correctly but although I have set all the permissions, if I swipe my finger on the smartphone nothing happens on the Desktop. The other functions have no problems and work very well. I use Arch Linux is only a KDE funcion?

Steps to reproduce

No response

Expected behavior

No response

GSConnect version

56

Installed from

GNOME Extensions website

GNOME Shell version

45.2

Linux distribution/release

Arch Linux Gnome

Paired device(s)

Vivo X70 Pro Plus

KDE Connect app version

1.29.0

Plugin(s)

No response

Support log

No response

Screenshots

No response

Notes

No response

fabrixx avatar Dec 08 '23 10:12 fabrixx

I'm having the same problem on Fedora 39 with Gnome 45. I remember it worked perfectly a few weeks ago. By taking a look at the logs, I could find the following problem:

dez 16 20:43:50 org.gnome.Shell.Extensions.GSConnect[3137]: [/service/device.js:_readLoop:364]: Redmi Note 7: {
                                                              "id": 1702770228802,
                                                              "type": "kdeconnect.mousepad.request",
                                                              "body": {
                                                                "dx": -22,
                                                                "dy": -45
                                                              }
                                                            }
dez 16 20:43:50 org.gnome.Shell.Extensions.GSConnect[3137]: [/service/components/ydotool.js:set args:81]: ydotool,mousemove,--,-22,-45: Falha ao executar processo filho “ydotool” (Arquivo ou diretório inexistente)
                                                            set args@/home/djouze/.local/share/gnome-shell/extensions/[email protected]/service/components/ydotool.js:81:28
                                                            movePointer@/home/djouze/.local/share/gnome-shell/extensions/[email protected]/service/components/ydotool.js:93:59
                                                            _handleInput@/home/djouze/.local/share/gnome-shell/extensions/[email protected]/service/plugins/mousepad.js:206:29
                                                            handlePacket@/home/djouze/.local/share/gnome-shell/extensions/[email protected]/service/plugins/mousepad.js:172:22
                                                            handlePacket@/home/djouze/.local/share/gnome-shell/extensions/[email protected]/service/device.js:441:25
                                                            _readLoop@/home/djouze/.local/share/gnome-shell/extensions/[email protected]/service/device.js:365:22
                                                            async*setChannel@/home/djouze/.local/share/gnome-shell/extensions/[email protected]/service/device.js:346:18
                                                            _onChannel@/home/djouze/.local/share/gnome-shell/extensions/[email protected]/service/manager.js:229:20
                                                            channel@/home/djouze/.local/share/gnome-shell/extensions/[email protected]/service/core.js:436:19
                                                            _onIdentity@/home/djouze/.local/share/gnome-shell/extensions/[email protected]/service/backends/lan.js:390:18
                                                            async*_onIncomingIdentity@/home/djouze/.local/share/gnome-shell/extensions/[email protected]/service/backends/lan.js:344:18
                                                            @/home/djouze/.local/share/gnome-shell/extensions/[email protected]/service/daemon.js:720:17
dez 16 20:43:50 org.gnome.Shell.Extensions.GSConnect[3137]: [/service/device.js:_readLoop:364]: Redmi Note 7: {
                                                              "id": 1702770228817,
                                                              "type": "kdeconnect.mousepad.request",
                                                              "body": {
                                                                "dx": -32,
                                                                "dy": -42
                                                              }
                                                            }

The extension seems to use a program called 'ydotool' for automation purposes under X11 and Wayland. I think Fedora 39 doesn't come with this installed by default anymore? Either way... After installing it and enabling the systemd service for it I get the following result in the logs:

dez 16 20:47:25 org.gnome.Shell.Extensions.GSConnect[3137]: [/service/device.js:_readLoop:364]: Redmi Note 7: {
                                                              "id": 1702770443959,
                                                              "type": "kdeconnect.mousepad.request",
                                                              "body": {
                                                                "dx": 405,
                                                                "dy": -724
                                                              }
                                                            }
dez 16 20:47:25 org.gnome.Shell.Extensions.GSConnect[3137]: [/service/device.js:_readLoop:364]: Redmi Note 7: {
                                                              "id": 1702770443976,
                                                              "type": "kdeconnect.mousepad.request",
                                                              "body": {
                                                                "dx": 609,
                                                                "dy": -956
                                                              }
                                                            }

So now the program is being invoked! Nice... but it still does not work. I'll edit this later if I find out how to solve it. The thing is, it seems like it's not the extension that is failing here.

EDIT:

If I try to invoke the command manually as in ydotool mousemove -- -22 -45 it fails with the following error:

failed to connect socket `/run/user/1000/.ydotool_socket': No such file or directory
Please check if ydotoold is running.

If I use the environment variable to specify where the socket is, as in YDOTOOL_SOCKET=/tmp/.ydotool_socket ydotool mousemove -- -22 -45, the command works! I'd guess this is the error that is happening, though it's not being reported by GSConnect's log...

EDIT1:

Solved it, though I'm not happy with the solution. For the socket thingy, I guess you could either change where the socket is created or set the environment variable that specifies the correct path to it. I went with the second option.

Wrote under ~/.profile:

export YDOTOOL_SOCKET=/tmp/.ydotool_socket

By doing this, the environment variable will be set for the gnome-shell process (at least when running on X11). It still does not work, and when testing on the terminal it complains about insufficient permissions, as the socket is listed as: srw-------. 1 root root 0 dez 16 21:43 /tmp/.ydotool_socket.

To change the permissions, I took the easy and lazy way and overrode the systemd service file with sudo systemctl edit ydotool.service. In there, I changed the way the daemon is executed so that it uses my user's UID:GID:

[Service]
ExecStart=
ExecStart=/usr/bin/ydotoold --socket-own=1000:1000

That's it, it's working again now. I'd still like to now what changes in the distribution made it stop working in the first place.

TLDR:

  • Make sure ydotool is installed in your system.
  • Check GSConnect's log to verify that it's indeed sending the mouse requests.
  • Make sure ydotool.service is enabled and started.
  • Make sure ydotool can find the path to its daemon's socket. You may need to change YDOOTOL_SOCKET envvar or create the socket in another location by changing the ExecStart line in ydotool.service.
  • Make sure you have permission to access the socket. You might need to perform some changes to that, one of which may be to use the --socket-own option in ExecStart for ydootol.service

JoseGuilhermeCR avatar Dec 16 '23 23:12 JoseGuilhermeCR

Was this fixed in https://github.com/GSConnect/gnome-shell-extension-gsconnect/pull/1718?

andyholmes avatar Mar 02 '24 02:03 andyholmes

Yes.

Stopped the ydotool service just to be sure and installed the version with the commit in #1718. Not only did the mouse work, the keyboard also did (for some reason it does not under ydotool, even though the tool supports it).

By the way, is ydotool only used as a fallback then? I took a look at the code and it seemed like so. Guess I didn't really investigate this enough back in december :sweat_smile:.

JoseGuilhermeCR avatar Mar 02 '24 13:03 JoseGuilhermeCR

By the way, is ydotool only used as a fallback then?

Yeah, it's for desktop environments that aren't GNOME Shell, I suppose. We never intended for that, but someone contributed and maintains it :)

andyholmes avatar Mar 02 '24 20:03 andyholmes

Problem fixed for me as well, using the latest nightly build. Thank you! :heart: I talk about this extension all the time to people new to Linux/Gnome, it's a killer feature.

johanricher avatar Mar 16 '24 17:03 johanricher