From 35b7783082a1928369dfc56dae86c0b11d736dbe Mon Sep 17 00:00:00 2001 From: coolneng Date: Wed, 27 Aug 2025 04:17:30 +0200 Subject: [PATCH] Notify of low battery via swaynag --- modules/periodic.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/modules/periodic.nix b/modules/periodic.nix index 19c52fb..c178a25 100644 --- a/modules/periodic.nix +++ b/modules/periodic.nix @@ -137,4 +137,15 @@ in startAt = "10:00:00"; after = [ "network-online.target" ]; }; + + # Show notification when the battery is low + systemd.user.services.swaynag-battery = { + description = "Show notification when the battery is low"; + path = [ + swaynag-battery + sway + ]; + script = "${pkgs.swaynag-battery}/bin/swaynag-battery --threshold 10"; + wantedBy = [ "sway-session.target" ]; + }; }