2

when I close the lid, the computer suspend and lock the screen. If I changed the keyboard layout before I locked it, I can't change it back and unlock the screen.

When I press the shortcut for lock screen, it shows me different lock screen, in this lock screen I can change the keyboard layout.

I want that when I close the lid, the computer will press automatically on the lock screen shortcut, so I won't have to check the keyboard layout before I lock the screen. is that possible?

Edit: I found that I need to write a script that indicates when the lid close and when it does- simulate super + L keys press. The problem is that I don't know how to write this kind of script. I found the link below which has the "OnLidClose" event, but I dont know exactly how to use it. I put the code at the link in /etc/acpi/events/lm_lid and I tried to put the "OdLidClose" code in /etc/acpi/lid.sh, but it copied "$?" as "0".

link: Catch lid close and open events

Sagi314
  • 71
  • Possible via custom script. The lid suspend will have to be disabled and all the actions in sequence will have to be done by the script itself. – Sergiy Kolodyazhnyy May 20 '19 at 17:40
  • thanks for replying. I thought it would be something like this. I currently found some information about acpi, but I don't know to write this kind of code.. I only managed to create the file lid.sh – Sagi314 May 20 '19 at 18:10
  • Someone should write one and post. I would do that but somewhat busy lately. And yes, acpi is the way to go. – Sergiy Kolodyazhnyy May 20 '19 at 18:20
  • I'm sorry to bother you, but can you help me please when you have time? I tried to write some scripts but it didn't work.. @SergiyKolodyazhnyy – Sagi314 May 22 '19 at 05:37
  • I will try to come up with something. Probably try to post it by Monday. Are you using just stock Ubuntu with GNOME desktop ? – Sergiy Kolodyazhnyy May 23 '19 at 00:05
  • I'm using ubuntu 19.04 with Gnome. Thanks a lot! @SergiyKolodyazhnyy – Sagi314 May 23 '19 at 03:43

0 Answers0