2021-04-19 14:58:52 +02:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
let
|
|
|
|
isEnabled = config.my.home.x.enable;
|
2021-04-22 02:33:39 +02:00
|
|
|
i3BarTheme = config.my.theme.i3BarTheme;
|
2021-07-23 19:18:07 +02:00
|
|
|
cfg = config.my.home.x.i3bar;
|
2021-04-19 14:58:52 +02:00
|
|
|
in
|
|
|
|
{
|
2021-07-23 19:18:07 +02:00
|
|
|
options.my.home.x.i3bar = with lib; {
|
|
|
|
temperature.chip = mkOption {
|
|
|
|
type = types.str;
|
|
|
|
example = "coretemp-isa-*";
|
|
|
|
default = "";
|
|
|
|
};
|
|
|
|
temperature.inputs = mkOption {
|
|
|
|
type = types.listOf types.str;
|
|
|
|
example = ["Core 0" "Core 1" "Core 2" "Core 3"];
|
|
|
|
default = "";
|
|
|
|
};
|
|
|
|
};
|
2021-04-19 22:54:20 +02:00
|
|
|
|
2021-04-19 14:58:52 +02:00
|
|
|
config = lib.mkIf isEnabled {
|
|
|
|
home.packages = with pkgs; [
|
2021-04-19 22:54:20 +02:00
|
|
|
iw # Used by `net` block
|
2021-04-19 14:58:52 +02:00
|
|
|
lm_sensors # Used by `temperature` block
|
2021-04-20 00:23:26 +02:00
|
|
|
font-awesome
|
2021-04-19 14:58:52 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
programs.i3status-rust = {
|
|
|
|
enable = true;
|
|
|
|
|
|
|
|
bars = {
|
|
|
|
top = {
|
2021-04-19 22:54:20 +02:00
|
|
|
icons = "awesome5";
|
2021-04-22 02:33:39 +02:00
|
|
|
theme = i3BarTheme.theme.name;
|
|
|
|
settings = i3BarTheme;
|
2021-04-19 22:54:20 +02:00
|
|
|
|
|
|
|
blocks = [
|
2021-05-04 01:27:46 +02:00
|
|
|
{
|
|
|
|
block = "pomodoro";
|
|
|
|
length = 60;
|
|
|
|
break_length = 10;
|
|
|
|
use_nag = true;
|
|
|
|
}
|
2021-04-19 22:54:20 +02:00
|
|
|
{
|
|
|
|
block = "disk_space";
|
|
|
|
path = "/";
|
|
|
|
alias = "/";
|
|
|
|
info_type = "available";
|
|
|
|
unit = "GB";
|
|
|
|
interval = 60;
|
|
|
|
warning = 20.0;
|
|
|
|
alert = 10.0;
|
|
|
|
}
|
2021-04-21 01:47:11 +02:00
|
|
|
{
|
|
|
|
block = "memory";
|
|
|
|
display_type = "memory";
|
2021-05-18 15:39:49 +02:00
|
|
|
format_mem = "{mem_used;G}/{mem_total;G}";
|
2021-04-21 01:47:11 +02:00
|
|
|
warning_mem = 70.0;
|
|
|
|
critical_mem = 90.0;
|
|
|
|
# don't show swap
|
|
|
|
clickable = false;
|
|
|
|
}
|
2021-04-19 22:54:20 +02:00
|
|
|
{
|
|
|
|
block = "cpu";
|
|
|
|
interval = 1;
|
2021-04-20 01:50:10 +02:00
|
|
|
format = "{barchart}";
|
2021-04-19 22:54:20 +02:00
|
|
|
}
|
|
|
|
{
|
|
|
|
block = "temperature";
|
|
|
|
collapsed = false;
|
|
|
|
interval = 10;
|
2021-05-25 22:27:13 +02:00
|
|
|
format = "{max}";
|
2021-07-23 19:18:07 +02:00
|
|
|
chip = cfg.temperature.chip;
|
|
|
|
inputs = cfg.temperature.inputs;
|
2021-04-19 22:54:20 +02:00
|
|
|
}
|
|
|
|
{
|
|
|
|
block = "networkmanager";
|
|
|
|
primary_only = true;
|
|
|
|
}
|
2021-04-21 02:11:48 +02:00
|
|
|
{
|
|
|
|
block = "bluetooth";
|
|
|
|
mac = config.my.secrets.bluetooth-mouse-mac-address;
|
|
|
|
hide_disconnected = true;
|
2021-05-18 15:39:49 +02:00
|
|
|
format = "{percentage}";
|
2021-04-21 02:11:48 +02:00
|
|
|
}
|
2021-05-04 01:27:35 +02:00
|
|
|
{
|
|
|
|
block = "music";
|
|
|
|
player = "spotify";
|
|
|
|
buttons = ["prev" "play" "next"];
|
|
|
|
hide_when_empty = true;
|
|
|
|
}
|
2021-04-19 22:54:20 +02:00
|
|
|
{
|
|
|
|
block = "sound";
|
|
|
|
driver = "pulseaudio";
|
|
|
|
}
|
|
|
|
# {
|
|
|
|
# block = "notify";
|
|
|
|
# }
|
|
|
|
{
|
|
|
|
block = "time";
|
|
|
|
interval = 5;
|
|
|
|
format = "%a %d/%m %T";
|
|
|
|
locale = "fr_FR";
|
|
|
|
timezone = "Europe/Paris";
|
|
|
|
}
|
|
|
|
];
|
2021-04-19 14:58:52 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|