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

Pre-check for xinput #48

Closed kitingChris closed 4 years ago

kitingChris commented 4 years ago

On Debian Testing with GNOME Shell 3.34.4

TypeError: comp[1] is undefined
Stack trace:
  _listPointingDevices@/home/chris/.local/share/gnome-shell/extensions/touchpad-indicator@orangeshirt/xinput.js:60:13
  _init@/home/chris/.local/share/gnome-shell/extensions/touchpad-indicator@orangeshirt/xinput.js:42:32
  XInput@/home/chris/.local/share/gnome-shell/extensions/touchpad-indicator@orangeshirt/xinput.js:37:9
  TouchpadIndicatorSettings@/home/chris/.local/share/gnome-shell/extensions/touchpad-indicator@orangeshirt/prefs.js:44:22
  buildPrefsWidget@/home/chris/.local/share/gnome-shell/extensions/touchpad-indicator@orangeshirt/prefs.js:239:20
  _showPrefs@resource:///org/gnome/shell/extensionPrefs/main.js:57:22
  _extensionsLoaded@resource:///org/gnome/shell/extensionPrefs/main.js:320:13
  _scanExtensions/<@resource:///org/gnome/shell/extensionPrefs/main.js:298:13
  asyncCallback@resource:///org/gnome/gjs/modules/overrides/Gio.js:132:13
  main@resource:///org/gnome/shell/extensionPrefs/main.js:707:5
  @<main>:1:43
kitingChris commented 4 years ago

I had a look into xinput.js:60:13

        let comp = Lib.executeCmdSync('xinput --list');
        let allDeviceLines = comp[1].split('\n');

Found out xinput was missing on my new system....

But perhaps checking if xinput is available and throwing an error with a more helpful message might be an idea ;)

askmrsinh commented 4 years ago

Yup, checking beforehand would be better.

askmrsinh commented 4 years ago

Done via https://github.com/user501254/TouchpadIndicator/commit/a1e088b35e40391d07f47d9251c8fb87ba45d41a. https://github.com/user501254/TouchpadIndicator/blob/a1e088b35e40391d07f47d9251c8fb87ba45d41a/xinput.js#L61-L67