2020-07-29 22:29:51 +02:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
2021-09-26 11:08:45 +02:00
|
|
|
{
|
2020-07-29 22:29:51 +02:00
|
|
|
config = {
|
2021-11-18 23:59:20 +01:00
|
|
|
home.stateVersion = "21.11";
|
|
|
|
|
2020-07-29 22:29:51 +02:00
|
|
|
programs.waybar = {
|
2021-09-26 11:08:45 +02:00
|
|
|
package = config.lib.test.mkStubPackage { outPath = "@waybar@"; };
|
2020-07-29 22:29:51 +02:00
|
|
|
enable = true;
|
2021-12-19 06:21:15 +01:00
|
|
|
settings = [
|
|
|
|
{
|
|
|
|
layer = "top";
|
|
|
|
position = "top";
|
|
|
|
height = 30;
|
|
|
|
output = [ "DP-1" ];
|
|
|
|
modules-left = [ "sway/workspaces" "sway/mode" "custom/my-module" ];
|
|
|
|
modules-center = [ "sway/window" ];
|
|
|
|
modules-right = [
|
|
|
|
"idle_inhibitor"
|
|
|
|
"pulseaudio"
|
|
|
|
"network"
|
|
|
|
"cpu"
|
|
|
|
"memory"
|
|
|
|
"backlight"
|
|
|
|
"tray"
|
|
|
|
"battery#bat1"
|
|
|
|
"battery#bat2"
|
|
|
|
"clock"
|
|
|
|
];
|
2020-07-29 22:29:51 +02:00
|
|
|
|
2021-12-19 06:21:15 +01:00
|
|
|
modules = {
|
|
|
|
"sway/workspaces" = {
|
|
|
|
disable-scroll = true;
|
|
|
|
all-outputs = true;
|
|
|
|
};
|
|
|
|
"sway/mode" = { tooltip = false; };
|
|
|
|
"sway/window" = { max-length = 120; };
|
|
|
|
"idle_inhibitor" = { format = "{icon}"; };
|
|
|
|
"custom/my-module" = {
|
|
|
|
format = "hello from {}";
|
|
|
|
exec = let
|
|
|
|
dummyScript =
|
|
|
|
config.lib.test.mkStubPackage { outPath = "@dummy@"; };
|
|
|
|
in "${dummyScript}/bin/dummy";
|
|
|
|
};
|
2020-07-29 22:29:51 +02:00
|
|
|
};
|
2021-12-19 06:21:15 +01:00
|
|
|
}
|
|
|
|
{
|
|
|
|
position = "bottom";
|
|
|
|
output = [ "!DP-1" ];
|
|
|
|
modules-left = [ "sway/mode" ];
|
|
|
|
modules-center = [ "clock" ];
|
|
|
|
modules = { "sway/mode" = { tooltip = true; }; };
|
|
|
|
}
|
|
|
|
];
|
2020-07-29 22:29:51 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
nmt.script = ''
|
|
|
|
assertPathNotExists home-files/.config/waybar/style.css
|
|
|
|
assertFileContent \
|
|
|
|
home-files/.config/waybar/config \
|
|
|
|
${./settings-complex-expected.json}
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|