Skip to content

Commit 4ebc38b

Browse files
Add laptop to niri documentation (#196)
* add laptop to niri doc * Update niri.mdx --------- Co-authored-by: Lemmy <studio@quadbyte.net>
1 parent 1bca31e commit 4ebc38b

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

  • src/content/docs/v5/compositor-settings

src/content/docs/v5/compositor-settings/niri.mdx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,3 +220,23 @@ layer-rule {
220220
match namespace="^noctalia-desktop-widget-weather-"
221221
}
222222
```
223+
224+
## Laptop
225+
226+
To lock the screen when you close your laptop lid, add this to your Niri config file:
227+
``` kdl
228+
switch-events {
229+
lid-close { spawn-sh "noctalia msg session lock-and-suspend"; }
230+
}
231+
```
232+
233+
You may also need to edit your `logind.conf` to set:
234+
```
235+
HandleLidSwitch=ignore
236+
HandleLidSwitchExternalPower=ignore
237+
```
238+
239+
:::note
240+
This file is usually located in `/etc/systemd/logind.conf` or `/etc/elogind/logind.conf` if you don't use systemd.
241+
If you can't find it, use this command: `find / -name "logind.conf" 2>/dev/null`.
242+
:::

0 commit comments

Comments
 (0)