Systemd/logind/ru: Difference between revisions

From NixOS Wiki
Unabomberlive (talk | contribs)
Created page with "Долгое нажатие кнопки питания (5 секунд или дольше) для выполнения жесткого сброса обрабатывается BIOS/EFI вашего компьютера и поэтому все еще возможно."
Tags: Mobile edit Mobile web edit
Unabomberlive (talk | contribs)
Created page with "== Обработка нажатий клавиши питания =="
Line 4: Line 4:
Its main manual page is <code>systemd-logind.service(8)</code>. Its configuration options are described in <code>logind.conf(5)</code>.
Its main manual page is <code>systemd-logind.service(8)</code>. Its configuration options are described in <code>logind.conf(5)</code>.
</div>
</div>
<div lang="en" dir="ltr" class="mw-content-ltr">
<span id="Handling_of_power_keys"></span>
== Handling of power keys ==
== Обработка нажатий клавиши питания ==
</div>
<div lang="en" dir="ltr" class="mw-content-ltr">
<div lang="en" dir="ltr" class="mw-content-ltr">
<code>logind</code> handles power and standby hardware switches. The Arch wiki has a [https://wiki.archlinux.org/index.php/Power_management#ACPI_events good overview of which ACPI events are handled].
<code>logind</code> handles power and standby hardware switches. The Arch wiki has a [https://wiki.archlinux.org/index.php/Power_management#ACPI_events good overview of which ACPI events are handled].

Revision as of 10:47, 6 August 2024

logind это менеджер входа в систему являющийся компонентом Systemd.

Its main manual page is systemd-logind.service(8). Its configuration options are described in logind.conf(5).

Обработка нажатий клавиши питания

logind handles power and standby hardware switches. The Arch wiki has a good overview of which ACPI events are handled.

Не выключать компьютер при нажатие клавиши питания

When you use a laptop, often you don’t want an accidental short press of the power button to shut down your system. You can add the following snippet to your logind config:

services.logind.extraConfig = ''
    # не выключать компьютер при коротком нажатии клавиши питания
    HandlePowerKey=ignore
  '';

Долгое нажатие кнопки питания (5 секунд или дольше) для выполнения жесткого сброса обрабатывается BIOS/EFI вашего компьютера и поэтому все еще возможно.

Ignore hardware keys when using systemd-inhibit

systemd-inhibit allows you to put a lock on e.g. shutdown or sleep that is in place as long the given process is running. By default, the hardware key actions configured in logind override such inhibits.

Say you want your laptop to stay awake when closing the lid in some circumstances, for example if you want to listen to music. If you start your lock screen with an inhibit on the lid switch

systemd-inhibit --what=handle-lid-switch lock-screen-tool

logind logind still overrides that user decision. For it to work, you need to tell logind to ignore the lid switch in your system config:

services.logind.extraConfig = ''
  # хотите иметь возможность слушать музыку при закрытом ноутбуке
  LidSwitchIgnoreInhibited=no
'';