With a little bit of tracing I found that the lid event and relevant scripts are indeed executed but after invoking the 'CheckPolicy' function in the /etc/acpi/lid.sh the script halted. This is because the script checks the system to see if there are other program being in charge of power management and if there is acpi gets aborted.
So, to enforce screen locking after resume (or before sleep), we'll need to setup a service in systemd that gets executed at the appropriate time. After a bit of searching and playing with the options, I found this ready-to-use unit file by Karsten Gebbert:
to use this, download the .service file to /etc/systemd/system and enable the service with the following command:
(sudo) systemctl enable i3lock@[user]Where
To check if the service is enabled correctly you can either just try to suspend and see if the i3lock is fired up or check the list of currently enabled services:
systemctl list-unit-files | grep i3lockif you have successfully enabled it, there should be message like this:
Note on the file name:
With an @ in the file name means this file is a template and can be enabled with specified instance name if provided. In this case the instance name will be