summaryrefslogtreecommitdiff
path: root/hosts/omar/desktop-environment/window-manager.nix
diff options
context:
space:
mode:
authorLinnnus <[email protected]>2024-12-29 19:17:35 +0000
committerLinnnus <[email protected]>2025-01-27 19:50:41 +0000
commit47e2c211d343a73260a65995514f46f2ccba103d (patch)
tree083d306c1f215932b04a375e3f70de1dea5e25bd /hosts/omar/desktop-environment/window-manager.nix
parent3eb0a3c2d694e65053227d6fd33eb44edfccdd50 (diff)
hosts/omar: Refactor desktop-environment, fix DWM status formatting
Diffstat (limited to 'hosts/omar/desktop-environment/window-manager.nix')
-rw-r--r--hosts/omar/desktop-environment/window-manager.nix25
1 files changed, 25 insertions, 0 deletions
diff --git a/hosts/omar/desktop-environment/window-manager.nix b/hosts/omar/desktop-environment/window-manager.nix
new file mode 100644
index 0000000..1237148
--- /dev/null
+++ b/hosts/omar/desktop-environment/window-manager.nix
@@ -0,0 +1,25 @@
+{pkgs, ...}:
+
+{
+ services.xserver.windowManager.dwm.enable = true;
+
+ # Show battery and clock in status bar. This is a background daemon which
+ # updates the root window, which DWM uses for status.
+ systemd.user.services.dwm-battery = {
+ description = "Battery status update";
+ partOf = ["graphical-session.target"];
+ wantedBy = ["graphical-session.target"];
+
+ serviceConfig.ExecStart = pkgs.writeShellScript "dwm-battery" ''
+ 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
+ ];
+}