3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/nixos/tests/xmonad.nix

40 lines
1.3 KiB
Nix
Raw Normal View History

2017-09-04 19:03:20 +01:00
import ./make-test.nix ({ pkgs, ...} : {
name = "xmonad";
meta = with pkgs.stdenv.lib.maintainers; {
maintainers = [ nequissimus ];
};
machine = { lib, pkgs, ... }: {
imports = [ ./common/x11.nix ./common/user-account.nix ];
services.xserver.displayManager.auto.user = "alice";
services.xserver.windowManager.default = lib.mkForce "xmonad";
services.xserver.windowManager.xmonad = {
enable = true;
enableContribAndExtras = true;
extraPackages = with pkgs.haskellPackages; haskellPackages: [ xmobar ];
2018-11-28 22:08:20 +00:00
config = ''
import XMonad
import XMonad.Util.EZConfig
main = launch $ def `additionalKeysP` myKeys
myKeys = [ ("M-C-x", spawn "xterm") ]
'';
2017-09-04 19:03:20 +01:00
};
};
testScript = { ... }: ''
2017-09-04 19:03:20 +01:00
$machine->waitForX;
$machine->waitForFile("/home/alice/.Xauthority");
$machine->succeed("xauth merge ~alice/.Xauthority");
2018-11-28 22:08:20 +00:00
$machine->sendKeys("alt-ctrl-x");
2019-09-13 20:16:41 +01:00
$machine->waitForWindow(qr/alice.*machine/);
2018-11-28 22:08:20 +00:00
$machine->sleep(1);
$machine->screenshot("terminal");
$machine->waitUntilSucceeds("xmonad --restart");
2017-09-04 19:03:20 +01:00
$machine->sleep(3);
$machine->sendKeys("alt-shift-ret");
$machine->waitForWindow(qr/alice.*machine/);
2017-09-04 19:03:20 +01:00
$machine->sleep(1);
$machine->screenshot("terminal");
'';
})