Fix i3status-rust not working everywhere

This commit is contained in:
2022-06-29 03:12:25 +01:00
parent 46b6904d1e
commit da84546561

View File

@@ -1,50 +1,66 @@
{ {
config, config,
pkgs, pkgs,
lib,
hostname,
... ...
}: { }: let
filterBacklight = list:
builtins.filter (item:
!(builtins.elem item.block (
if hostname == "dingbox"
then ["backlight" "battery"]
else []
)))
list;
in {
programs.i3status-rust = { programs.i3status-rust = {
enable = true; enable = true;
bars = { bars = {
main = { main = {
theme = "dracula"; theme = "dracula";
icons = "awesome"; icons = "awesome";
blocks = [ blocks =
{ [
block = "time"; {
} block = "time";
{ }
block = "battery"; ]
allow_missing = true; ++ lib.optionals (hostname == "pingbox") [
hide_missing = true; {
} block = "battery";
{ allow_missing = true;
block = "backlight"; hide_missing = true;
device = "intel_backlight"; }
step_width = 10; {
invert_icons = true; block = "backlight";
} device = "intel_backlight";
{ step_width = 10;
block = "networkmanager"; invert_icons = true;
primary_only = true; }
ap_format = "{ssid}"; ]
device_format = "{icon}{ap}"; ++ [
} {
{ block = "networkmanager";
block = "keyboard_layout"; primary_only = true;
} ap_format = "{ssid}";
{ device_format = "{icon}{ap}";
block = "notify"; }
} {
{ block = "keyboard_layout";
block = "music"; }
player = "spotifyd"; {
buttons = ["prev" "play" "next"]; block = "notify";
} }
{ {
block = "sound"; block = "music";
} player = "spotifyd";
]; buttons = ["prev" "play" "next"];
}
{
block = "sound";
}
];
}; };
}; };
}; };