askmrsinh / touchpad-indicator

Touchpad management GNOME Shell Extension.
https://extensions.gnome.org/extension/131/touchpad-indicator/
GNU General Public License v2.0
83 stars 20 forks source link

"global is not defined" error #49

Open peter-lyons-kehl opened 4 years ago

peter-lyons-kehl commented 4 years ago

Touchpad Indicator fails with:

ReferenceError: global is not defined

Stack trace:
  logger@/home/pkehl/.local/share/gnome-shell/extensions/touchpad-indicator@orangeshirt/lib.js:109:5
  executeCmdSync@/home/pkehl/.local/share/gnome-shell/extensions/touchpad-indicator@orangeshirt/lib.js:131:9
  _isUsable@/home/pkehl/.local/share/gnome-shell/extensions/touchpad-indicator@orangeshirt/synclient.js:60:24
  _init@/home/pkehl/.local/share/gnome-shell/extensions/touchpad-indicator@orangeshirt/synclient.js:45:30
  Synclient@/home/pkehl/.local/share/gnome-shell/extensions/touchpad-indicator@orangeshirt/synclient.js:40:14
  TouchpadIndicatorSettings@/home/pkehl/.local/share/gnome-shell/extensions/touchpad-indicator@orangeshirt/prefs.js:43:25
  buildPrefsWidget@/home/pkehl/.local/share/gnome-shell/extensions/touchpad-indicator@orangeshirt/prefs.js:242:20
  _init@resource:///org/gnome/Shell/Extensions/js/extensionsService.js:207:40
  OpenExtensionPrefsAsync/<@resource:///org/gnome/Shell/Extensions/js/extensionsService.js:122:28
  asyncCallback@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:132:13
  run@resource:///org/gnome/Shell/Extensions/js/dbusService.js:175:20
  main@resource:///org/gnome/Shell/Extensions/js/main.js:19:13
  run@resource:///org/gnome/gjs/modules/script/package.js:222:19
  start@resource:///org/gnome/gjs/modules/script/package.js:206:5
  @/usr/share/gnome-shell/org.gnome.Shell.Extensions:1:17

I do have many other GNOME extensions, but I've turned them all off, I rebooted, and still the same error. That error shows up in "Extensions" application > locate "Touchpad Indicator" > wheel next to it: image

Touchpad Indicator has always been failing for me since I've installed it at least a year ago. My system is current Manjaro, GNOME version 3.36.1, X11.

Thank you in advance.

askmrsinh commented 4 years ago

Please try installing the xorg-xinput package on your system.

askmrsinh commented 4 years ago

It seems that the extension fails when trying to log to the system journal. This should not be happening. Try changing global.log(LOG_PREFIX + message); to log(LOG_PREFIX + message); in lib.js file and see if that helps.

peter-lyons-kehl commented 4 years ago

Hi Ashesh,

Thank you for Touchpad Indicator, and for a quick response. Confirming

It would help the users if you put a note to README.md about installing xorg-xinput - if it will stay as mandatory.

askmrsinh commented 4 years ago

Technically, the extension should work even without xinput command being present. However, the functionality would be limited.

There was an enhancement for pre-checking xinput (issue https://github.com/user501254/TouchpadIndicator/issues/48). I think the second edit (ie. changing global.log to log) was necessary in your case for the extension to work. It would be great if you could verify by uninstalling the xorg-xinput package and restarting the gnome shell. In that case I can make the required changes permanent.

peter-lyons-kehl commented 4 years ago

Thank you for the feedback and the direction. I've uninstalled xorg-xinput, re-logged in, but it failed. Logs:

2020-04-19T19:13:45.344Z Failed to execute child process “synclient” (No such file or directory)
2020-04-19T19:13:45.349Z Failed to execute child process “xinput” (No such file or directory)
2020-04-19T19:13:45.355Z Failed to execute child process “xinput” (No such file or directory)

And an error in Touchpad Indicator's settings:

TypeError: comp[1] is undefined
Stack trace:
  _listPointingDevices@/home/pkehl/.local/share/gnome-shell/extensions/touchpad-indicator@orangeshirt/xinput.js:76:30
  _init@/home/pkehl/.local/share/gnome-shell/extensions/touchpad-indicator@orangeshirt/xinput.js:46:37
  XInput@/home/pkehl/.local/share/gnome-shell/extensions/touchpad-indicator@orangeshirt/xinput.js:40:14
  TouchpadIndicatorSettings@/home/pkehl/.local/share/gnome-shell/extensions/touchpad-indicator@orangeshirt/prefs.js:44:22
  buildPrefsWidget@/home/pkehl/.local/share/gnome-shell/extensions/touchpad-indicator@orangeshirt/prefs.js:242:20
  _init@resource:///org/gnome/Shell/Extensions/js/extensionsService.js:207:40
  OpenExtensionPrefsAsync/<@resource:///org/gnome/Shell/Extensions/js/extensionsService.js:122:28
  asyncCallback@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:132:13
  run@resource:///org/gnome/Shell/Extensions/js/dbusService.js:175:20
  main@resource:///org/gnome/Shell/Extensions/js/main.js:19:13
  run@resource:///org/gnome/gjs/modules/script/package.js:222:19
  start@resource:///org/gnome/gjs/modules/script/package.js:206:5
  @/usr/share/gnome-shell/org.gnome.Shell.Extensions:1:17