aboutsummaryrefslogtreecommitdiff
path: root/modules/i3status.nix
blob: 16b73c4bd516bf8c13b688eac4908f85c6acdb56 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
{ config, lib, pkgs, ... }:
let
  cfg = config.modules.i3status;
in
{
  options.modules.i3status = {
    enable = lib.mkEnableOption "i3status";
    battery = lib.mkEnableOption "battery module";
    wireless = lib.mkOption {
      type = lib.types.bool;
      description = "enable wifi module";
      default = true;
    };
  };

  config = lib.mkIf cfg.enable {
    home.packages = with pkgs; [
    ];
    programs.i3status = {
      enable = true;
      enableDefault = false;
      general = {
        colors = false;
        color_good = "#cacaca";
        color_degraded = "#aca98a";
        color_bad = "#ac8a8c";
        interval = 60;
        separator = " ";
      };
      modules = {
        "volume master" = {
          position = 1;
          settings = {
            format = " %volume";
            format_muted = "";
            device = "default";
#            mixer = "Master";
#            mixer_idx = 0;
          };
        };
        "wireless _first_" = {
          enable = cfg.wireless;
          position = 3;
          settings = {
            format_up = "";
            format_down = "󰖪";
          };
        };
        "ethernet _first_" = {
          position = 2;
          enable = !cfg.wireless;
        };
        # i have some laptops that use bat1 
        "battery all" = {
          position = 4;
          enable = cfg.battery;
          settings = {
            format = "%status %percentage";
            format_percentage = "%.00f%s";
            status_chr = "󱐋";
            status_bat = "󰁹";
            status_idle = "󱐋";
          };
        };
        "tztime local" = {
          position = 10;
          settings = {
            format = "󰥔 %-I:%M %P";
          };
        };
      };
    };
  };
}