From c5f6190a66c7500e57a2fa22214ec0c688c97e83 Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Mon, 23 Dec 2024 18:47:58 -0600 Subject: [PATCH] Show battery on lock screen --- modules/home-manager/default.nix | 12 ++++++------ modules/home-manager/eww/eww.scss | 14 ++++++++++---- modules/home-manager/eww/eww.yuck | 10 +++++----- modules/nixos/default.nix | 17 ++++++++++++++--- nixos/foxtrot.nix | 22 ++++++++++++++++++++++ 5 files changed, 57 insertions(+), 18 deletions(-) diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix index 27ed502..d73cca1 100644 --- a/modules/home-manager/default.nix +++ b/modules/home-manager/default.nix @@ -35,12 +35,12 @@ }; }; - eww = { - programs.eww = { - enable = true; - # NOTE: might be better as a mk out of store symlink or w/e - configDir = ./eww; - }; + eww = {config, ...}: { + # programs.eww = { + # enable = true; + # }; + + home.file.".config/eww".source = config.lib.file.mkOutOfStoreSymlink /etc/nixos/flake/modules/home-manager/eww; }; mako = { diff --git a/modules/home-manager/eww/eww.scss b/modules/home-manager/eww/eww.scss index 2b26d6d..07ebc6a 100644 --- a/modules/home-manager/eww/eww.scss +++ b/modules/home-manager/eww/eww.scss @@ -34,6 +34,8 @@ $rosewater: #f5e0dc; .bar { background-color: $base; color: $text; + border-radius: 5px; + border: solid 0px $base; font-family: IosevkaLyteTerm; font-size: 12.0pt; } @@ -69,8 +71,8 @@ $rosewater: #f5e0dc; .bar0>*, .bar1>*, .bar>* { - padding-left: 10px; - padding-right: 10px; + padding-left: 8px; + padding-right: 8px; } .vol .muted, @@ -85,8 +87,12 @@ $rosewater: #f5e0dc; .workspace { /* height: 100%; */ - padding-left: 10px; - padding-right: 10px; + /* height: 32px; */ + margin: 0; + padding-top: 0px; + padding-bottom: 0px; + padding-left: 5px; + padding-right: 5px; color: #666666; } diff --git a/modules/home-manager/eww/eww.yuck b/modules/home-manager/eww/eww.yuck index e24f8d5..0133c45 100644 --- a/modules/home-manager/eww/eww.yuck +++ b/modules/home-manager/eww/eww.yuck @@ -12,7 +12,7 @@ :geometry (geometry :x "0%" - :y "0%" + :y "5px" :width "100%" :height "32px" :anchor "bottom center") @@ -25,10 +25,10 @@ :geometry (geometry :x "0%" - :y "0%" - :width "100%" - :height "32px" - :anchor "bottom center") + :y "20%" + :width "90%" + :height "60px" + :anchor "top center") (bar)) (defwidget rightsidestuff [] diff --git a/modules/nixos/default.nix b/modules/nixos/default.nix index fefc576..67ed909 100644 --- a/modules/nixos/default.nix +++ b/modules/nixos/default.nix @@ -433,10 +433,21 @@ services.logind = { lidSwitch = "suspend-then-hibernate"; extraConfig = '' - HandleLidSwitchDocked=ignore - HandlePowerKey=suspend-then-hibernate + KillUserProcesses=no + HandlePowerKey=suspend + HandlePowerKeyLongPress=poweroff + HandleRebootKey=reboot + HandleRebootKeyLongPress=poweroff + HandleSuspendKey=suspend + HandleSuspendKeyLongPress=hibernate + HandleHibernateKey=hibernate + HandleHibernateKeyLongPress=ignore + HandleLidSwitch=suspend + HandleLidSwitchExternalPower=suspend + HandleLidSwitchDocked=suspend + HandleLidSwitchDocked=suspend IdleActionSec=11m - IdleAction=suspend-then-hibernate + IdleAction=ignore ''; }; }; diff --git a/nixos/foxtrot.nix b/nixos/foxtrot.nix index faa2696..7c4cf1e 100644 --- a/nixos/foxtrot.nix +++ b/nixos/foxtrot.nix @@ -294,6 +294,28 @@ in # TODO: nixify this }; + programs.hyprlock.settings = { + label = [ + { + monitor = ""; + font_size = 20; + + halign = "center"; + valign = "center"; + text_align = "center"; + color = "rgba(255, 255, 255, 0.5)"; + + position = "0 -500"; + font_family = "IosevkaLyteTerm"; + text = "cmd[update:1000] acpi"; + + shadow_passes = 3; + shadow_size = 1; + shadow_color = "rgba(0, 0, 0, 1.0)"; + shadow_boost = 1.0; + } + ]; + }; services.hypridle = let secondsPerMinute = 60; lockSeconds = 10 * secondsPerMinute;