nix-config/modules/both/i3/i3status-rust.nix

93 lines
2.4 KiB
Nix
Raw Normal View History

2024-04-09 23:59:34 +02:00
{
config,
pkgs,
lib,
...
}: {
home-manager.users.${config.host.user} = {
config,
osConfig,
lib,
...
}: {
xsession.windowManager.i3.config.bars = [
{
fonts = {
names = ["FiraCode Nerd Font"];
style = "Mono";
size = 10.0;
};
position = "bottom";
statusCommand = "${pkgs.i3status-rust}/bin/i3status-rs ~/.config/i3status-rust/config-default.toml";
}
];
2024-04-09 23:59:34 +02:00
programs.i3status-rust = {
enable = true;
bars = {
default = {
blocks = [
{
block = "music";
2024-04-13 04:44:37 +02:00
format = "{$icon $combo.str(max_w:25,rot_interval:0.5) $play $prev $next $player.str(max_w:5,rot_interval:0.5) [$cur/$avail]|}";
2024-04-09 23:59:34 +02:00
}
{
block = "memory";
2024-04-10 19:26:08 +02:00
format = "$icon $mem_used_percents";
format_alt = "$icon $swap_used_percents (swap)";
2024-04-09 23:59:34 +02:00
}
{
block = "cpu";
interval = 1;
}
{
block = "load";
2024-04-10 19:26:08 +02:00
format = "$icon $1m";
2024-04-09 23:59:34 +02:00
interval = 1;
}
(
lib.mkIf
(!osConfig.host.isVm)
{
block = "backlight";
missing_format = "";
}
2024-04-09 23:59:34 +02:00
)
(
lib.mkIf (osConfig.host.isLaptop)
{
block = "battery";
driver = "upower";
2024-04-13 04:44:37 +02:00
device = "DisplayDevice";
format = "$icon $percentage {$time|}";
2024-04-09 23:59:34 +02:00
}
)
{
block = "net";
format = "$icon {$signal_strength $ssid.str(max_w:5,rot_interval:0.5)|}";
2024-04-10 19:26:08 +02:00
format_alt = "$icon {$signal_strength $ssid.str(max_w:5,rot_interval:0.5) $frequency|} ipv4-$ip ipv6-$ipv6 via $device";
2024-04-09 23:59:34 +02:00
}
{
block = "sound";
2024-04-13 04:44:37 +02:00
format = "$icon {$volume.bar(v:true) $volume.eng(w:2)|}";
2024-04-09 23:59:34 +02:00
headphones_indicator = true;
click = [
{
button = "left";
cmd = "pwvucontrol";
}
];
}
{
block = "time";
2024-04-10 19:26:08 +02:00
format = "$timestamp.datetime(f:'%F %R')";
2024-04-09 23:59:34 +02:00
interval = 60;
}
];
theme = "gruvbox-dark";
icons = "material-nf";
};
};
};
};
}