parent
866d7d5152
commit
ecc1f2310c
8 changed files with 362 additions and 0 deletions
4
tests/modules/programs/i3status/default.nix
Normal file
4
tests/modules/programs/i3status/default.nix
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
i3status-with-custom = ./with-custom.nix;
|
||||
i3status-with-default = ./with-default.nix;
|
||||
}
|
||||
67
tests/modules/programs/i3status/with-custom.nix
Normal file
67
tests/modules/programs/i3status/with-custom.nix
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
config = {
|
||||
programs.i3status = {
|
||||
enable = true;
|
||||
enableDefault = false;
|
||||
|
||||
general = {
|
||||
colors = true;
|
||||
color_good = "#e0e0e0";
|
||||
color_degraded = "#d7ae00";
|
||||
color_bad = "#f69d6a";
|
||||
interval = 1;
|
||||
};
|
||||
|
||||
modules = {
|
||||
"volume master" = {
|
||||
position = 1;
|
||||
settings = {
|
||||
format = "♪ %volume";
|
||||
format_muted = "♪ muted (%volume)";
|
||||
device = "pulse:1";
|
||||
};
|
||||
};
|
||||
"disk /" = {
|
||||
position = 2;
|
||||
settings = { format = "/ %avail"; };
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
nixpkgs.overlays = [
|
||||
(self: super: { i3status = pkgs.writeScriptBin "dummy-i3status" ""; })
|
||||
];
|
||||
|
||||
nmt.script = ''
|
||||
assertFileContent \
|
||||
home-files/.config/i3status/config \
|
||||
${
|
||||
pkgs.writeText "i3status-expected-config" ''
|
||||
general {
|
||||
color_bad = "#f69d6a"
|
||||
color_degraded = "#d7ae00"
|
||||
color_good = "#e0e0e0"
|
||||
colors = true
|
||||
interval = 1
|
||||
}
|
||||
|
||||
order += "volume master"
|
||||
order += "disk /"
|
||||
disk / {
|
||||
format = "/ %avail"
|
||||
}
|
||||
|
||||
volume master {
|
||||
device = "pulse:1"
|
||||
format = "♪ %volume"
|
||||
format_muted = "♪ muted (%volume)"
|
||||
}
|
||||
''
|
||||
}
|
||||
'';
|
||||
};
|
||||
}
|
||||
73
tests/modules/programs/i3status/with-default.nix
Normal file
73
tests/modules/programs/i3status/with-default.nix
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
config = {
|
||||
programs.i3status = {
|
||||
enable = true;
|
||||
enableDefault = true;
|
||||
};
|
||||
|
||||
nixpkgs.overlays = [
|
||||
(self: super: { i3status = pkgs.writeScriptBin "dummy-i3status" ""; })
|
||||
];
|
||||
|
||||
nmt.script = ''
|
||||
assertFileContent \
|
||||
home-files/.config/i3status/config \
|
||||
${
|
||||
pkgs.writeText "i3status-expected-config" ''
|
||||
general {
|
||||
colors = true
|
||||
interval = 5
|
||||
}
|
||||
|
||||
order += "ipv6"
|
||||
order += "wireless _first_"
|
||||
order += "ethernet _first_"
|
||||
order += "battery all"
|
||||
order += "disk /"
|
||||
order += "load"
|
||||
order += "memory"
|
||||
order += "tztime local"
|
||||
battery all {
|
||||
format = "%status %percentage %remaining"
|
||||
}
|
||||
|
||||
disk / {
|
||||
format = "%avail"
|
||||
}
|
||||
|
||||
ethernet _first_ {
|
||||
format_down = "E: down"
|
||||
format_up = "E: %ip (%speed)"
|
||||
}
|
||||
|
||||
ipv6 {
|
||||
|
||||
}
|
||||
|
||||
load {
|
||||
format = "%1min"
|
||||
}
|
||||
|
||||
memory {
|
||||
format = "%used | %available"
|
||||
format_degraded = "MEMORY < %available"
|
||||
threshold_degraded = "1G"
|
||||
}
|
||||
|
||||
tztime local {
|
||||
format = "%Y-%m-%d %H:%M:%S"
|
||||
}
|
||||
|
||||
wireless _first_ {
|
||||
format_down = "W: down"
|
||||
format_up = "W: (%quality at %essid) %ip"
|
||||
}
|
||||
''
|
||||
}
|
||||
'';
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue