1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-12-04 08:01:02 +01:00
home-manager/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.contacts: fix eval error 2025-12-03 04:10:48 +01:00
config home-cursor: sway depend on cfg.size instead of gtk.cursorTheme.size (#7176) 2025-05-31 19:31:59 -05:00
files home-manager: add support for custom backup command (#6424) (#7153) 2025-10-30 12:26:13 -05:00
i18n/input-method fcitx5: set im-module for X11 GTK apps 2025-11-24 18:40:58 +01:00
launchd launchd+targets/darwin: Escape XML in plists (#7356) 2025-08-09 11:22:08 -05:00
lib maintainers: add jtrrll 2025-11-09 10:12:54 -06:00
lib-bash home-manager: move profile management 2025-01-03 11:22:59 +01:00
misc news: ludusavi's default backup path changed entry 2025-12-02 21:57:23 -06:00
po Translate using Weblate (Faroese) 2025-11-30 14:18:18 -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
targets GPU freedom (#8239) 2025-11-30 14:48:38 +01:00
dbus.nix dbus: Create with pacakges options (#7064) 2025-05-15 12:59:12 -05:00
default.nix treewide: fold -> foldr 2025-11-26 09:23:05 -06:00
deprecations.nix glab: remove module 2025-11-15 09:44:58 +01:00
files.nix home-manager: add support for custom backup command (#6424) (#7153) 2025-10-30 12:26:13 -05:00
home-environment.nix home-environment: extend release check to include pkgs 2025-12-02 21:35:34 -06:00
manual.nix treewide: reformat nixfmt-rfc-style 2025-04-08 08:50:05 -07:00
modules.nix modules: add minimal entrypoint to only enable core modules 2025-11-22 21:50:04 -06:00
systemd-activate.sh systemd: don't try to restart templates 2024-06-26 18:14:48 +02:00
systemd.nix systemd: make unit definitions freeform modules 2025-09-17 16:26:12 +02:00
wayland.nix wayland: create tray.target if xsession is not enabled (#6332) 2025-02-06 22:50:03 +01:00
xresources.nix treewide: reformat nixfmt-rfc-style 2025-04-08 08:50:05 -07:00
xsession.nix xsession: only require xdg autostart target if explicitely enabled (#8237) 2025-11-30 14:35:54 +01:00