1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-09-21 13:57:31 +02:00

cbatticon: Add support for batteryId

For devices with more than one battery, cbatticon allows to set the
battery ID as optional positional argument. If this argument is not
given, it default to the first battery it would list with `cbatticon
-p`. This commit adds support for the batteryId option to the cbatticon
module.
This commit is contained in:
Silvio Ankermann 2023-10-23 10:00:02 +02:00 committed by Mikilio
parent f833d2a354
commit 17ead612c6
No known key found for this signature in database
GPG key ID: 5B2F1A890CF33F3F

View file

@ -24,7 +24,7 @@ let
++ optional (cfg.updateIntervalSeconds != null) ++ optional (cfg.updateIntervalSeconds != null)
"--update-interval ${toString cfg.updateIntervalSeconds}" "--update-interval ${toString cfg.updateIntervalSeconds}"
++ optional (cfg.hideNotification != null && cfg.hideNotification) ++ optional (cfg.hideNotification != null && cfg.hideNotification)
"--hide-notification"); "--hide-notification" ++ optional (cfg.batteryId != null) cfg.batteryId);
in { in {
meta.maintainers = [ maintainers.pmiddend ]; meta.maintainers = [ maintainers.pmiddend ];
@ -94,6 +94,15 @@ in {
default = null; default = null;
description = "Hide the notification popups."; description = "Hide the notification popups.";
}; };
batteryId = mkOption {
type = types.nullOr types.str;
default = null;
description = ''
ID of the battery to monitor. List with {command}`cbatticon -p`.
Defaults to the first entry in the list.
'';
};
}; };
}; };