From 143ae9c5285815b82d5d192c505a842512ba4322 Mon Sep 17 00:00:00 2001 From: Linnnus Date: Sun, 29 Dec 2024 15:29:49 +0000 Subject: hosts/omar: Show battery and clock in DWM bar --- hosts/omar/desktop-environment/default.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'hosts/omar/desktop-environment/default.nix') 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 -- cgit v1.2.3