2021-04-04 21:28:34 +02:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
let
|
2021-04-05 23:27:20 +02:00
|
|
|
cfg = config.my.home.wm.i3bar;
|
2021-04-04 21:28:34 +02:00
|
|
|
in
|
|
|
|
{
|
2021-04-05 23:27:20 +02:00
|
|
|
config = lib.mkIf cfg.enable {
|
2021-04-04 21:28:34 +02:00
|
|
|
home.packages = with pkgs; [
|
2022-09-29 21:58:48 +02:00
|
|
|
alsa-utils # Used by `sound` block
|
2021-04-04 21:28:34 +02:00
|
|
|
lm_sensors # Used by `temperature` block
|
2021-05-04 19:16:18 +02:00
|
|
|
font-awesome # Icon font
|
2021-04-04 21:28:34 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
programs.i3status-rust = {
|
|
|
|
enable = true;
|
|
|
|
|
|
|
|
bars = {
|
|
|
|
top = {
|
2021-05-04 19:16:18 +02:00
|
|
|
icons = "awesome5";
|
|
|
|
|
2021-04-05 17:58:15 +02:00
|
|
|
blocks = builtins.filter (attr: attr != { }) [
|
2021-04-04 21:28:34 +02:00
|
|
|
{
|
|
|
|
block = "music";
|
2023-03-19 22:14:59 +01:00
|
|
|
# This format seems to remove the block when not playing, somehow
|
|
|
|
format = "{ $icon $combo.str(max_w:50,rot_interval:0.5) $prev $play $next |}";
|
|
|
|
click = [
|
|
|
|
{
|
|
|
|
button = "play";
|
|
|
|
action = "music_play";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
button = "prev";
|
|
|
|
action = "music_prev";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
button = "next";
|
|
|
|
action = "music_next";
|
|
|
|
}
|
|
|
|
];
|
2021-04-04 21:28:34 +02:00
|
|
|
}
|
2021-10-16 17:55:59 +02:00
|
|
|
(lib.optionalAttrs config.my.home.bluetooth.enable {
|
|
|
|
block = "bluetooth";
|
|
|
|
mac = "4C:87:5D:06:40:D9";
|
2023-03-19 22:14:59 +01:00
|
|
|
format = " $icon Boson{ $percentage|} ";
|
|
|
|
disconnected_format = "";
|
2021-10-16 17:55:59 +02:00
|
|
|
})
|
|
|
|
(lib.optionalAttrs config.my.home.bluetooth.enable {
|
|
|
|
block = "bluetooth";
|
|
|
|
mac = "94:DB:56:00:EE:93";
|
2023-03-19 22:14:59 +01:00
|
|
|
format = " $icon Protons{ $percentage|} ";
|
|
|
|
disconnected_format = "";
|
2021-10-16 17:55:59 +02:00
|
|
|
})
|
|
|
|
(lib.optionalAttrs config.my.home.bluetooth.enable {
|
|
|
|
block = "bluetooth";
|
|
|
|
mac = "F7:78:BA:76:52:F7";
|
2023-03-19 22:14:59 +01:00
|
|
|
format = " $icon MX Ergo{ $percentage|} ";
|
|
|
|
disconnected_format = "";
|
2021-10-16 17:55:59 +02:00
|
|
|
})
|
2021-04-04 21:28:34 +02:00
|
|
|
{
|
|
|
|
block = "cpu";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
block = "disk_space";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
block = "net";
|
2023-03-19 22:14:59 +01:00
|
|
|
format = " $icon $ssid $ip $signal_strength ";
|
2021-04-04 21:28:34 +02:00
|
|
|
}
|
2021-05-09 17:45:24 +02:00
|
|
|
{
|
|
|
|
block = "backlight";
|
2021-05-22 16:23:39 +02:00
|
|
|
invert_icons = true;
|
2021-05-09 17:45:24 +02:00
|
|
|
}
|
2021-04-04 21:28:34 +02:00
|
|
|
{
|
|
|
|
block = "battery";
|
2023-03-19 22:14:59 +01:00
|
|
|
format = " $percentage ($time) ";
|
|
|
|
full_format = " $icon $percentage ";
|
2021-04-04 21:28:34 +02:00
|
|
|
}
|
|
|
|
{
|
|
|
|
block = "temperature";
|
2023-03-19 22:14:59 +01:00
|
|
|
format_alt = " $icon ";
|
2021-04-04 21:28:34 +02:00
|
|
|
}
|
2022-03-09 12:09:43 +01:00
|
|
|
{
|
|
|
|
block = "sound";
|
|
|
|
device_kind = "source"; # Microphone status
|
2023-03-19 22:14:59 +01:00
|
|
|
format = " $icon ";
|
2022-03-09 12:09:43 +01:00
|
|
|
}
|
2021-04-04 21:28:34 +02:00
|
|
|
{
|
|
|
|
block = "sound";
|
2022-02-03 11:40:24 +01:00
|
|
|
show_volume_when_muted = true;
|
2021-04-04 21:28:34 +02:00
|
|
|
}
|
|
|
|
{
|
|
|
|
block = "time";
|
2023-03-19 22:14:59 +01:00
|
|
|
format = " $icon $timestamp.datetime(f:'%F %T') ";
|
|
|
|
interval = 5;
|
2021-04-04 21:28:34 +02:00
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|