How To: Disable laptop lid open / close events on any Linux using systemd

Edit /etc/systemd/logind.conf and change the HandleLidSwitch to the following:

Then you could try to restart the systemd-logind service with:

BUT it crashed my machine when I did, so perhaps just a reboot for it to take effect would be the best option.

How To: Fix USB Keyboards Missing the First Keypress in Linux

I use my laptop as a desktop with an external monitor, mouse & keyboard, and found that recently the keyboard would keep missing the first character of input – and it was driving me nuts. After much googling I found a blog post over at wulftone.com that narrowed the issue down to a USB sleep problem, and described how to blacklist a USB keyboard from going into sleep mode – and it works great!

The way to fix this issue is:

1 – Find the details of your USB keyboard via the lsusb command, like this:

2 – Once you can see your keyboard, if you can’t remember which way the vendor ID and product ID go (it’s that very order), you can get the details (in this case looking at the Microsoft keyboard on bus 003, device 002) like this:

3 – Next, edit (or create if necessary) the file: /etc/udev/rules.d/91-local.rules and place the following contents into it:

So for my USB keyboard I entered:

4 – Finally, with that done you can reload the udev rules with the following and you should be all set:

As a final note, I found that this (bizarrely) didn’t work when I used the lowercase hex codes (i.e. 045e & 00dd) – I had to put them to uppercase (045E & 00DD) for it to kick in!

Sanity restored! =D

P.S. If you want to disable your first (i.e. laptop) keyboard and/or are using laptop-mode-tools then the wulftone article has you covered. So many thanks to Trevor Bortin for this fix!