diff options
-rw-r--r-- | hosts/omar/desktop-environment/default.nix | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/hosts/omar/desktop-environment/default.nix b/hosts/omar/desktop-environment/default.nix index 78961b6..f187404 100644 --- a/hosts/omar/desktop-environment/default.nix +++ b/hosts/omar/desktop-environment/default.nix @@ -8,6 +8,21 @@ services.xserver.windowManager.dwm.enable = true; + systemd.services.dwm-battery = { + description = "Battery status update"; + after = ["graphical-session.target"]; + wantedBy = ["graphical-session.target"]; + + serviceConfig = { + script = '' + while true; do + echo "$(date +%H:%M) - $(cat /sys/class/power_supply/BAT0/capacity)" + sleep 5 + done | ${pkgs.dwm-setstatus}/bin/dwm-setstatus + ''; + }; + }; + environment.systemPackages = with pkgs; [ st dmenu |