1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-12-03 15:41:02 +01:00
home-manager/tests/modules
Patrick Steinhardt 281e9398cc swayidle: improve confusing "events" configuration
With swayidle one can configure two different kinds of hooks:

  - Idle timeouts are executed after the session has been idle for a
    specific amount of time.

  - Events are executed when systemd notifies us that for example the
    user session is locked or that the device is about to suspend.

While not obvious, there is a significant difference between how these
two kinds are configured: there can be several timeouts with separate
commands to be executed, but each event can only be specified once. If
an event is specified multiple times, then the last command wins.

This can be very easy to miss in swayidle's documentation. Furthermore,
because the config is a list of `{ event = "..."; command = "..."; }`
attrset, we double down on this confusion and make it seem like having
multiple handlers for an event was actually supported.

Fix this by converting from a list of "event" submodules to an attrset
where the key is the event name and the value is the command to be
executed. This makes it impossible to specify multiple commands for a
single event by accident.

If a user _does_ want to have multiple commands executed on any event
they can for example use `pkgs.writeShellScript` and manually chain the
commands in that script.
2025-12-02 22:24:56 -06:00
..
accounts accounts.email: add option to disable an account 2025-08-07 14:08:46 -05:00
config treewide: remove no-ops (#8061) 2025-10-26 15:43:53 -05:00
dbus dbus: Create with pacakges options (#7064) 2025-05-15 12:59:12 -05:00
files treewide: reformat nixfmt-rfc-style 2025-04-08 08:50:05 -07:00
home-environment home-environment: extend release check to include pkgs 2025-12-02 21:35:34 -06:00
i18n/input-method fcitx5: fix iniFormat usage (#6899) 2025-04-23 15:10:12 -05:00
launchd launchd+targets/darwin: Escape XML in plists (#7356) 2025-08-09 11:22:08 -05:00
misc tests/gtk4: add test for stateversion change 2025-11-28 14:14:32 -06:00
programs infat: add module 2025-12-02 21:39:05 -06:00
services swayidle: improve confusing "events" configuration 2025-12-02 22:24:56 -06:00
systemd treewide: remove no-ops (#8061) 2025-10-26 15:43:53 -05:00
targets-darwin treewide: reformat nixfmt-rfc-style 2025-04-08 08:50:05 -07:00
targets-linux generic-linux-gpu: add module 2025-11-09 09:02:58 -06:00
xresources treewide: reformat nixfmt-rfc-style 2025-04-08 08:50:05 -07:00