polybar: add test case

This commit is contained in:
Robert Helgesson 2020-03-02 22:31:15 +01:00
parent a6657d6b21
commit f3fbb50b68
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89
4 changed files with 71 additions and 0 deletions

View file

@ -50,6 +50,7 @@ import nmt {
./modules/programs/firefox
./modules/programs/getmail
./modules/programs/rofi
./modules/services/polybar
./modules/services/sxhkd
./modules/services/window-managers/i3
./modules/systemd

View file

@ -0,0 +1,21 @@
[bar/top]
height=3%
modules-center=date
monitor=${env:MONITOR:eDP1}
radius=0
width=100%
[module/date]
date=%d.%m.%y
internal=5
label=%time% %date%
time=%H:%M
type=internal/date
[module/date]
type = internal/date
interval = 5
date = "%d.%m.%y"
time = %H:%M
format-prefix-foreground = ${colors.foreground-alt}
label = %time% %date%

View file

@ -0,0 +1,48 @@
{ config, pkgs, ... }:
{
config = {
services.polybar = {
enable = true;
package = pkgs.writeScriptBin "dummy-polybar" "";
script = "polybar bar &";
config = {
"bar/top" = {
monitor = "\${env:MONITOR:eDP1}";
width = "100%";
height = "3%";
radius = 0;
modules-center = "date";
};
"module/date" = {
type = "internal/date";
internal = 5;
date = "%d.%m.%y";
time = "%H:%M";
label = "%time% %date%";
};
};
extraConfig = ''
[module/date]
type = internal/date
interval = 5
date = "%d.%m.%y"
time = %H:%M
format-prefix-foreground = ''${colors.foreground-alt}
label = %time% %date%
'';
};
nmt.script = ''
local serviceFile=home-files/.config/systemd/user/polybar.service
assertFileExists $serviceFile
assertFileRegex $serviceFile 'X-Restart-Triggers=.*polybar\.conf'
assertFileRegex $serviceFile 'ExecStart=.*/bin/polybar-start'
assertFileExists home-files/.config/polybar/config
assertFileContent home-files/.config/polybar/config \
${./basic-configuration.conf}
'';
};
}

View file

@ -0,0 +1 @@
{ polybar-basic-configuration = ./basic-configuration.nix; }