blob: 2389a8aaad37b0b66858ebef05daa75b518c40aa (
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
|
{
config,
lib,
pkgs,
...
}:
let
cfg = config.personal.x.i3;
cfgStylix = config.stylix.targets.i3;
mkDeviceOption = lib.mkOption {
type = with lib.types; nullOr str;
default = null;
};
ifDevice = device: attrs: lib.optional (device != null) ({ inherit device; } // attrs);
in
{
options.personal.x.i3 = {
devices = {
wifi = mkDeviceOption;
eth = mkDeviceOption;
vpn = mkDeviceOption // {
default = "tun0";
};
};
};
config = lib.mkIf cfg.enable {
xsession.windowManager.i3.config.bars = [
{
statusCommand = "${pkgs.i3status-rust}/bin/i3status-rs ~/.config/i3status-rust/config-default.toml";
fonts = { inherit (cfgStylix.exportedBarConfig.fonts) size; };
}
];
programs.i3status-rust = {
enable = true;
bars = {
default = {
icons = "material-nf";
blocks =
(ifDevice cfg.devices.wifi {
block = "net";
device = cfg.devices.wifi;
format = " ^icon_net_wireless $ssid ";
})
++ (ifDevice cfg.devices.eth {
block = "net";
device = cfg.devices.eth;
format = " ^icon_net_wired $ip ";
inactive_format = " ^icon_net_wired × ";
missing_format = " ^icon_net_wired × ";
})
++ (ifDevice cfg.devices.vpn {
block = "net";
device = cfg.devices.vpn;
format = " ^icon_net_vpn $ip ";
inactive_format = " ^icon_net_vpn × ";
missing_format = " ^icon_net_vpn × ";
})
++ [
{
block = "disk_space";
info_type = "used";
path = "/";
warning = 50.0;
alert = 90.0;
format = " $icon $percentage ";
}
(
let
format = " $icon $percentage ";
in
{
block = "battery";
inherit format;
full_format = format;
charging_format = format;
empty_format = format;
not_charging_format = format;
}
)
{
block = "backlight";
}
{
block = "sound";
}
{
block = "sound";
}
{
block = "time";
interval = 1;
format = " $timestamp.datetime(f:'%a. %b. %d, %H:%M:%S') ";
}
];
};
};
};
};
}
|