From ce4a6bb501b1ed0d556ec99575b7d1c38c2303df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonardo=20Eug=C3=AAnio?= Date: Sat, 25 Feb 2023 17:17:05 -0300 Subject: [PATCH] swaylock: extract config from sway --- user/sway/default.nix | 20 +------------------- user/sway/swaylock.nix | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 19 deletions(-) create mode 100644 user/sway/swaylock.nix diff --git a/user/sway/default.nix b/user/sway/default.nix index b528154..5a3863f 100644 --- a/user/sway/default.nix +++ b/user/sway/default.nix @@ -19,7 +19,7 @@ let ''; in { - imports = [ ./theme.nix ./mako.nix ]; + imports = [ ./theme.nix ./mako.nix ./swaylock.nix ]; config = { programs.mako.enable = true; wayland.windowManager.sway = @@ -382,24 +382,6 @@ in } ]; }; - xdg.configFile."swaylock/config".text = '' - image=${theme.background} - font=${font.interface} - font-size=${toString font.size.medium} - indicator-thickness=20 - color=${color.bg} - inside-color=#FFFFFF00 - bs-hl-color=${color.normal.red} - ring-color=${color.normal.green} - key-hl-color=${accent.color} - # divisor lines - separator-color=#aabbcc00 - line-color=#aabbcc00 - line-clear-color=#aabbcc00 - line-caps-lock-color=#aabbcc00 - line-ver-color=#aabbcc00 - line-wrong-color=#aabbcc00 - ''; services.gammastep = { enable = true; provider = "geoclue2"; diff --git a/user/sway/swaylock.nix b/user/sway/swaylock.nix new file mode 100644 index 0000000..dfd99bc --- /dev/null +++ b/user/sway/swaylock.nix @@ -0,0 +1,25 @@ +{ config, pkgs, lib, ... }: +let + inherit (pkgs.uservars) key accent font theme; + inherit (theme) color; +in +{ + programs.swaylock.settings = { + image = theme.background; + font = font.interface; + font-size = font.size.medium; + indicator-thickness = 20; + color = color.bg; + inside-color = "#FFFFFF00"; + bs-hl-color = color.normal.red; + ring-color = color.normal.green; + key-hl-color = accent.color; + # divisor lines; + separator-color = "#aabbcc00"; + line-color = "#aabbcc00"; + line-clear-color = "#aabbcc00"; + line-caps-lock-color = "#aabbcc00"; + line-ver-color = "#aabbcc00"; + line-wrong-color = "#aabbcc00"; + }; +}