System Description
A new mid-range HP laptop (Intel i5, 7th Gen, 8GB RAM) on which I installed Ubuntu Minimal. Then, I installed the Gnome desktop environment by doing apt install vanilla-gnome-desktop
.
Problem
The airplane-mode key (️✈ ) was not working. Also, whenever I shut the lid, instead of locking the screen, Airplane Mode would turn on.
A Google search led me to this answer and I followed the steps given.
$ sudo sh -c 'printf "#!/bin/sh\n/usr/bin/setkeycodes e057 240 e058 240\n" > /etc/init.d/hp-keycodes'
$ sudo chmod +x /etc/init.d/hp-keycodes
$ sudo ln -s /etc/init.d/hp-keycodes /etc/rc2.d/S01hp-keycodes
Now, two things are broken.
- Pressing the airplane-mode key still does nothing.
- The first time I shut the lid of the laptop, it goes into suspend (sleep) mode and when I open the lid, I can resume working as usual. But when I shut the laptop lid for a second time, on reopening the lid I find that the system has crashed. The screen is frozen (showing the windows that were open before I shut the lid), the mouse pointer is stuck, and shortcuts such as Alt+F2, Ctrl+Alt+Del, Ctrl+Alt+F1-F6 do not work. I have to reboot the laptop to resume working.
However, this problem does not occur while running other desktop environments like LXDE, MATE and Unity! The airplane-mode key works fine and there is no problem on closing and opening the lid.
Why is this weird problem happening? What can I do to resolve it?