From a47e785ae7268cdf0a53e9216a49d5c42ecec733 Mon Sep 17 00:00:00 2001 From: Colin Date: Mon, 15 May 2023 02:51:57 +0000 Subject: [PATCH] sway: tidy --- hosts/modules/gui/sway/default.nix | 39 ++++++------------------ hosts/modules/gui/sway/waybar-config.nix | 2 +- hosts/modules/gui/sway/waybar-style.css | 2 ++ 3 files changed, 13 insertions(+), 30 deletions(-) diff --git a/hosts/modules/gui/sway/default.nix b/hosts/modules/gui/sway/default.nix index 6828ccfe..61267fed 100644 --- a/hosts/modules/gui/sway/default.nix +++ b/hosts/modules/gui/sway/default.nix @@ -4,9 +4,6 @@ with lib; let cfg = config.sane.gui.sway; - waybar-config = import ./waybar-config.nix pkgs; - # waybar-config-text = lib.generators.toJSON {} waybar-config; - waybar-config-text = (pkgs.formats.json {}).generate "waybar-config.json" waybar-config; # bare sway launcher sway-launcher = pkgs.writeShellScriptBin "sway-launcher" '' @@ -144,34 +141,18 @@ in enable = true; wrapperFeatures.gtk = true; }; - sane.user.fs.".config/sway/config" = sane-lib.fs.wantedText (import ./sway-config.nix { - inherit config pkgs; - }); + sane.user.fs.".config/sway/config" = sane-lib.fs.wantedText + (import ./sway-config.nix { inherit config pkgs; }); - sane.user.fs.".config/waybar/config" = sane-lib.fs.wantedSymlinkTo waybar-config-text; + sane.user.fs.".config/waybar/config" = + let + waybar-config = import ./waybar-config.nix { inherit pkgs; }; + in sane-lib.fs.wantedSymlinkTo ( + (pkgs.formats.json {}).generate "waybar-config.json" waybar-config + ); - # style docs: https://github.com/Alexays/Waybar/wiki/Styling - sane.user.fs.".config/waybar/style.css" = sane-lib.fs.wantedText (builtins.readFile ./waybar-style.css); - # style = '' - # * { - # border: none; - # border-radius: 0; - # font-family: Source Code Pro; - # } - # window#waybar { - # background: #16191C; - # color: #AAB2BF; - # } - # #workspaces button { - # padding: 0 5px; - # } - # .custom-spotify { - # padding: 0 10px; - # margin: 0 4px; - # background-color: #1DB954; - # color: black; - # } - # ''; + sane.user.fs.".config/waybar/style.css" = sane-lib.fs.wantedText + (builtins.readFile ./waybar-style.css); }) ]; } diff --git a/hosts/modules/gui/sway/waybar-config.nix b/hosts/modules/gui/sway/waybar-config.nix index 06dfb8b7..4f2e4868 100644 --- a/hosts/modules/gui/sway/waybar-config.nix +++ b/hosts/modules/gui/sway/waybar-config.nix @@ -1,6 +1,6 @@ # docs: https://github.com/Alexays/Waybar/wiki/Configuration # format specifiers: https://fmt.dev/latest/syntax.html#syntax -pkgs: +{ pkgs }: [ { # TOP BAR layer = "top"; diff --git a/hosts/modules/gui/sway/waybar-style.css b/hosts/modules/gui/sway/waybar-style.css index 46c7d5f2..a507ce15 100644 --- a/hosts/modules/gui/sway/waybar-style.css +++ b/hosts/modules/gui/sway/waybar-style.css @@ -1,3 +1,5 @@ +/* style docs: https://github.com/Alexays/Waybar/wiki/Styling */ + * { font-family: monospace; }