diff options
Diffstat (limited to 'hosts')
-rw-r--r-- | hosts/omar/desktop-environment/default.nix | 1 | ||||
-rw-r--r-- | hosts/omar/desktop-environment/input.nix | 1 | ||||
-rw-r--r-- | hosts/omar/desktop-environment/window-manager.nix | 36 |
3 files changed, 17 insertions, 21 deletions
diff --git a/hosts/omar/desktop-environment/default.nix b/hosts/omar/desktop-environment/default.nix index 48598eb..52800e0 100644 --- a/hosts/omar/desktop-environment/default.nix +++ b/hosts/omar/desktop-environment/default.nix @@ -1,5 +1,4 @@ # This module configures a desktop environment specific to this host. - { imports = [ ./window-manager.nix diff --git a/hosts/omar/desktop-environment/input.nix b/hosts/omar/desktop-environment/input.nix index bb138c7..63cddca 100644 --- a/hosts/omar/desktop-environment/input.nix +++ b/hosts/omar/desktop-environment/input.nix @@ -1,5 +1,4 @@ { - # Configure keymap in X11 services.xserver.xkb.layout = "dk"; services.xserver.xkb.options = "caps:escape"; diff --git a/hosts/omar/desktop-environment/window-manager.nix b/hosts/omar/desktop-environment/window-manager.nix index 926268e..0a6d878 100644 --- a/hosts/omar/desktop-environment/window-manager.nix +++ b/hosts/omar/desktop-environment/window-manager.nix @@ -1,6 +1,4 @@ -{pkgs, ...}: - -{ +{pkgs, ...}: { services.xserver.windowManager.dwm.enable = true; # Show battery and clock in status bar. This is a background daemon which @@ -11,25 +9,25 @@ wantedBy = ["graphical-session.target"]; serviceConfig.ExecStart = pkgs.writeShellScript "dwm-battery" '' - while true; do - echo -n "$(date +%H:%M) - "; + while true; do + echo -n "$(date +%H:%M) - "; - # See: https://www.kernel.org/doc/Documentation/ABI/testing/sysfs-class-power - case "$(cat /sys/class/power_supply/BAT0/status)" in - Charging) echo -n "🔋 " ;; - Discharging) echo -n "🪫 " ;; - "Not charging") echo -n "🪫 " ;; - Full) echo -n "🔋 " ;; - Unknown) echo -n "? " ;; - ""|*) echo -n "?? " ;; - esac + # See: https://www.kernel.org/doc/Documentation/ABI/testing/sysfs-class-power + case "$(cat /sys/class/power_supply/BAT0/status)" in + Charging) echo -n "🔋 " ;; + Discharging) echo -n "🪫 " ;; + "Not charging") echo -n "🪫 " ;; + Full) echo -n "🔋 " ;; + Unknown) echo -n "? " ;; + ""|*) echo -n "?? " ;; + esac - echo -n "$(cat /sys/class/power_supply/BAT0/capacity)%" + echo -n "$(cat /sys/class/power_supply/BAT0/capacity)%" - echo - sleep 5 - done | ${pkgs.dwm-setstatus}/bin/dwm-setstatus - ''; + echo + sleep 5 + done | ${pkgs.dwm-setstatus}/bin/dwm-setstatus + ''; }; environment.systemPackages = with pkgs; [ |