From 4ee7d15cb83b7817fb3342b7eb4e1056f1b04e79 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Mon, 19 Apr 2021 14:58:52 +0200 Subject: [PATCH] home: x: setup i3status-rust --- home/x/default.nix | 1 + home/x/i3.nix | 43 ++++++++++++++++++++++++++++++++++++++++++- home/x/i3bar.nix | 22 ++++++++++++++++++++++ 3 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 home/x/i3bar.nix diff --git a/home/x/default.nix b/home/x/default.nix index 382e0e5..ca92c09 100644 --- a/home/x/default.nix +++ b/home/x/default.nix @@ -2,6 +2,7 @@ { imports = [ ./i3.nix + ./i3bar.nix ]; options.my.home.x = with lib; { diff --git a/home/x/i3.nix b/home/x/i3.nix index 96076f0..5894ce3 100644 --- a/home/x/i3.nix +++ b/home/x/i3.nix @@ -13,6 +13,17 @@ let modifier = "Mod4"; # `Super` key logoutMode = "[L]ogout, [S]uspend, [P]oweroff, [R]eboot"; + + # colors + colorBg = "#282828"; + colorRed = "#cc241d"; + colorGreen = "#98971a"; + colorYellow = "#d79921"; + colorBlue = "#458588"; + colorPurple = "#b16286"; + colorAqua = "#689d68"; + colorGray = "#a89984"; + colorDarkGray = "#1d2021"; in { config = lib.mkIf isEnabled { @@ -26,10 +37,40 @@ in inherit modifier; bars = + let + barConfigPath = + config.xdg.configFile."i3status-rust/config-top.toml".target; + in [ { - statusCommand = "i3status"; + statusCommand = "i3status-rs ${barConfigPath}"; position = "top"; + + colors = { + background = colorBg; + statusline = colorYellow; + + focusedWorkspace = { + border = colorAqua; + background = colorAqua; + text = colorDarkGray; + }; + inactiveWorkspace = { + border = colorDarkGray; + background = colorDarkGray; + text = colorYellow; + }; + activeWorkspace = { + border = colorAqua; + background = colorDarkGray; + text = colorYellow; + }; + urgentWorkspace = { + border = colorRed; + background = colorRed; + text = colorBg; + }; + }; } ]; diff --git a/home/x/i3bar.nix b/home/x/i3bar.nix new file mode 100644 index 0000000..644a06b --- /dev/null +++ b/home/x/i3bar.nix @@ -0,0 +1,22 @@ +{ config, lib, pkgs, ... }: +let + isEnabled = config.my.home.x.enable; +in +{ + config = lib.mkIf isEnabled { + home.packages = with pkgs; [ + alsaUtils # Used by `sound` block + lm_sensors # Used by `temperature` block + ]; + + programs.i3status-rust = { + enable = true; + + bars = { + top = { + theme = "gruvbox-light"; + }; + }; + }; + }; +}