> For the complete documentation index, see [llms.txt](https://utm-1.gitbook.io/utm-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://utm-1.gitbook.io/utm-docs/dokumentaciya/utm-it/programmnoe-obespechenie/linux-servera/nastroiki/nastroika-zakrytiya-kryshki-noutbuka.md).

# Настройка закрытия крышки ноутбука

## Ссылки

Заставьте Ubuntu не переходить в режим ожидания при закрытии крышки ноутбука: [itsfoss.com](https://itsfoss.com/laptop-lid-suspend-ubuntu/)

## Настройка

### Через командную  строку

**Для продвинутых пользователей** можно изменить **файл конфигурации входа в систему** —&#x20;

```
sudo nano /etc/systemd/logind.conf
```

1. В файле найти строку, содержащую **HandleLidSwitch**. Она определяет действие, которое необходимо предпринять, когда закрывается крышка ноутбука:
   * **HandleLidSwitch** — для случаев, когда ноутбук работает от аккумулятора;
   * **HandleLidSwitchExternalPower** — для сценариев, в которых ноутбук подключён к электрической розетке;
   * **HandleLidSwitchDocked** — для ситуаций, когда ноутбук подключён к док-станции.
2. Изменить значение HandleLidSwitch на одно из следующих: &#x20;
   * **ignore** — ничего не делать;
   * **lock** — блокировка при закрытой крышке;
   * **poweroff** — выключение;
   * **hibernate** — переход в спящий режим (функция не работает по умолчанию, её нужно включить).&#x20;
3. Сохранить изменения и перезапустить службу systemd-logind с помощью команды в терминале:&#x20;

   ```
   systemctl restart systemd-logind.service
   ```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://utm-1.gitbook.io/utm-docs/dokumentaciya/utm-it/programmnoe-obespechenie/linux-servera/nastroiki/nastroika-zakrytiya-kryshki-noutbuka.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
