The configuration depends on your OS and distribution.
Some Linux distributions use /etc/systemd/logind.conf
to set the behaviour.
There should be a line with HandleLidSwitch
under section [Login]
in there. On Ubuntu (at least on 14.*) and Arch it is commented out by default, showing the default setting:
[Login]
# [...]
#HandleLidSwitch=suspend
# [...]
To change the settings you have to uncomment the line and change the value.
According to the logind.conf(5)
manpage if you set it to lock
[...] all running sessions will be screen locked.
[Login]
# [...]
HandleLidSwitch=lock
# [...]
This may or may not work with i3, it probably again depends on the distribution and display manager.
If it does not do what you want, set HandleLidSwitch
to ignore
:
[Login]
# [...]
HandleLidSwitch=ignore
# [...]
This will at least prevent the machine from going to sleep.
you can have a look in you `/etc/apci/` folder. There could be some events and scripts that get triggered depending on certain ACPI-critical buttons
None of the scripts I found there refer to lid-related events. Mostly just stuff on brightness, power or wireless.
The configuration depends on your OS and distribution. Some Linux distributions use `/etc/systemd/logind.conf` to set the behaviour. There should be a line with `HandleLidSwitch` in there. Uncomment it and set it to `lock`. If this does not do what you want, set it to `ignore` and go from there.
I'm using Ubuntu (I'll edit that in). `HandleLidSwitch` is commented out already in that file.
What I meant with "uncomment" was to remove the comment sign (`#`). And then change the value to `lock` or `ignore`, at the moment it is probably `suspend`.