askmrsinh/touchpad-indicator

Pre-check for xinput

kitingChris opened this issue · 3 comments

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

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 ;)

Yup, checking beforehand would be better.