X Error: BadDevice, invalid or uninitialized input device
For errors like this:
X Error: BadDevice, invalid or uninitialized input device 168 Major opcode: 145 Minor opcode: 3 Resource id: 0x0 Failed to open device
(First, note that these are usually harmless. If you’re debugging something that has just gone wrong, almost always the problem is with something else, not these errors.) To make these messages/errors go away, edit /etc/X11/xorg.conf (don’t forget to backup, or else you may have no GUI when you reboot!), find the lines corresponding to the InputDevices you don’t have (Stylus, Cursor, Eraser), and get rid of them by commenting out everything from Section "InputDevice" to EndSection for each of them. Also, in Section "ServerLayout", comment out the corresponding lines. Changes will take effect the next time X is started (so reboot, or logout and hit Ctrl-Alt-Backspace).
Got it from the top Google search; it’s here. If you can imagine even more “step-by-step” instructions than what I wrote above, they’re here.