nix-config/home/wm/i3bar/default.nix

108 lines
3.1 KiB
Nix
Raw Normal View History

2021-04-04 21:28:34 +02:00
{ config, lib, pkgs, ... }:
let
cfg = config.my.home.wm.i3bar;
2021-04-04 21:28:34 +02:00
in
{
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
font-awesome # Icon font
2021-04-04 21:28:34 +02:00
];
programs.i3status-rust = {
enable = true;
bars = {
top = {
icons = "awesome5";
blocks = builtins.filter (attr: attr != { }) [
2021-04-04 21:28:34 +02:00
{
block = "music";
# 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
}
(lib.optionalAttrs config.my.home.bluetooth.enable {
block = "bluetooth";
mac = "4C:87:5D:06:40:D9";
format = " $icon Boson{ $percentage|} ";
disconnected_format = "";
})
(lib.optionalAttrs config.my.home.bluetooth.enable {
block = "bluetooth";
mac = "38:18:4C:BE:8E:97";
format = " $icon Muon{ $percentage|} ";
disconnected_format = "";
})
(lib.optionalAttrs config.my.home.bluetooth.enable {
block = "bluetooth";
mac = "94:DB:56:00:EE:93";
format = " $icon Protons{ $percentage|} ";
disconnected_format = "";
})
(lib.optionalAttrs config.my.home.bluetooth.enable {
block = "bluetooth";
mac = "F7:78:BA:76:52:F7";
format = " $icon MX Ergo{ $percentage|} ";
disconnected_format = "";
})
2021-04-04 21:28:34 +02:00
{
block = "cpu";
}
{
block = "disk_space";
}
{
block = "net";
format = " $icon $ssid $ip $signal_strength ";
2021-04-04 21:28:34 +02:00
}
2021-05-09 17:45:24 +02:00
{
block = "backlight";
invert_icons = true;
2021-05-09 17:45:24 +02:00
}
2021-04-04 21:28:34 +02:00
{
block = "battery";
format = " $icon $percentage{ ($time)|} ";
not_charging_format = " $icon $percentage ";
full_format = " $icon $percentage ";
2021-04-04 21:28:34 +02:00
}
{
block = "temperature";
format_alt = " $icon ";
2021-04-04 21:28:34 +02:00
}
{
block = "sound";
device_kind = "source"; # Microphone status
format = " $icon ";
}
2021-04-04 21:28:34 +02:00
{
block = "sound";
show_volume_when_muted = true;
2021-04-04 21:28:34 +02:00
}
{
block = "time";
format = " $icon $timestamp.datetime(f:'%F %T') ";
interval = 5;
2021-04-04 21:28:34 +02:00
}
];
};
};
};
};
}