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

GNOME Extension X11 Gestures hardcodes Touchegg path #137621

Closed
maydayv7 opened this issue Sep 13, 2021 · 14 comments · Fixed by #148457
Closed

GNOME Extension X11 Gestures hardcodes Touchegg path #137621

maydayv7 opened this issue Sep 13, 2021 · 14 comments · Fixed by #148457
Labels
0.kind: bug Something is broken 6.topic: GNOME GNOME desktop environment and its underlying platform

Comments

@maydayv7
Copy link

maydayv7 commented Sep 13, 2021

Describe the bug

gnomeExtensions.x11-gestures (from nixpkgs) is a GNOME extension which searches for the package touchegg in /usr

Because it can't detect the installed package it sends a notification that the touchegg package must be installed, and subsequently does not inhibit the default gestures provided by the package. Also, there is no built-in way to tell it to use another path.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Install the gnomeExtensions.x11-gestures and touchegg (Please see additional context) packages
  2. Enable the X11 Gestures extension

Expected behavior

The extension must recognize the actual path for touchegg in /nix/store and work properly

Additional context

Since the touchegg package in the repos is extremely outdated (v1.1.1), I am using an overlay to install the latest version v2.0.11 (see #116393 for updating the package in the repos).

Also, #137131 may be relevant

Maintainers

@piegamesde Extensions maintainer
@JoseExposito Creator of the extension and touchegg

Metadata

 - system: `"x86_64-linux"`
 - host os: `Linux 5.10.62, NixOS, 21.05.3021.8b0b81dab17 (Okapi)`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.3.15`
 - channels(v7): `"home-manager-21.05"`
 - channels(root): `"nixos-21.05.3021.8b0b81dab17"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
@piegamesde
Copy link
Member

I'll see how difficult it is to fix the path. However, I am reluctant to do custom dependencies patches, so I'd block this on #116393.

@veprbl veprbl added the 6.topic: GNOME GNOME desktop environment and its underlying platform label Sep 13, 2021
@maydayv7
Copy link
Author

maydayv7 commented Sep 14, 2021

I don't think there are any custom dependency patches required (it is just an extension, and apart from inhibiting the default gestures, it works properly as is).

@maydayv7
Copy link
Author

maydayv7 commented Sep 14, 2021

I think this is where it searches for the system touchegg config, to determine if the package is installed

EDIT: Confirmed that editing src/touchegg/ToucheggConfig.js and replacing usr with path in /nix/store fixes the issue

@AdsonCicilioti
Copy link
Contributor

AdsonCicilioti commented Dec 3, 2021

I think this is where it searches for the system touchegg config, to determine if the package is installed

EDIT: Confirmed that editing src/touchegg/ToucheggConfig.js and replacing usr with path in /nix/store fixes the issue

Why /nix/store? Wouldn't it be better on /run/current-system/sw?

Has anyone done this patch? Let's do it?

@maydayv7
Copy link
Author

maydayv7 commented Dec 3, 2021

That should be the best thing to do. I've tried to patch the extension using postPatch, but for some reason it doesn't seem to work, and I'm pretty new to Nix, so I've just left it for the time-being

@JoseExposito
Copy link

Ops, forgot to notify it here. I fixed this by following the XDG Base Directory Specification.

Both the GNOME extension and Touchégg use the $XDG_CONFIG_DIRS env var to find the system configuration:
https://github.com/JoseExposito/gnome-shell-extension-x11gestures/blob/master/src/touchegg/ToucheggConfig.js#L165

The same applies for the user config with $XDG_CONFIG_HOME:
https://github.com/JoseExposito/gnome-shell-extension-x11gestures/blob/master/src/touchegg/ToucheggConfig.js#L146

A NixOS maintainer suggested this fix.

@maydayv7
Copy link
Author

maydayv7 commented Dec 3, 2021

Thanks a lot! #145382 seems to have updated the extension to the version which has the fixes, so I'll close this issue

@maydayv7 maydayv7 closed this as completed Dec 3, 2021
@JoseExposito
Copy link

I think that the $XDG_CONFIG_DIRS needs to be set in the package to point to the right path. Not sure if that work is done though, since I'm not a NixOS user...

@AdsonCicilioti
Copy link
Contributor

AdsonCicilioti commented Dec 3, 2021

Still i get it
image

The gestures works with default touchegg gestures on the same time. Switching to next workspace and snap window to half side screen
image

@maydayv7 maydayv7 reopened this Dec 3, 2021
@AdsonCicilioti
Copy link
Contributor

AdsonCicilioti commented Dec 3, 2021

I made a workaround. I created a blank .config/touchegg/touchegg.conf. So the extension managed to populate the file with its gestures and now I only have the extension gestures. But the "Not installed" alert still persist.

@AdsonCicilioti
Copy link
Contributor

AdsonCicilioti commented Dec 3, 2021

@JoseExposito

My conf dirs:

$ echo $XDG_CONFIG_DIRS
/etc/xdg:/home/balllazo/.local/share/flatpak/exports/etc/xdg:/var/lib/flatpak/exports/etc/xdg:/home/balllazo/.nix-profile/etc/xdg:/etc/profiles/per-user/balllazo/etc/xdg:/nix/var/nix/profiles/default/etc/xdg:/run/current-system/sw/etc/xdg:/nix/store/5h67rdlif30b5q000gx2kdw3wkjv8v4c-gnome-settings-daemon-41.0/etc/xdg:/nix/store/5h67rdlif30b5q000gx2kdw3wkjv8v4c-gnome-settings-daemon-41.0/etc/xdg

touchegg/touchegg.conf It's not in any of these places.
It's in /run/current-system/sw/share

@JoseExposito
Copy link

In that case you'd need to add :/run/current-system/sw/share at the end of $XDG_CONFIG_DIRS. However, I'm not sure what's the NixOS way of doing it. I'm sure there is a way to fix this in the package.

@AdsonCicilioti
Copy link
Contributor

Ok. Thanks!

@AdsonCicilioti
Copy link
Contributor

@JoseExposito help us with your review on #148457

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken 6.topic: GNOME GNOME desktop environment and its underlying platform
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants