home/wm: simplify xmonad project settings
This commit is contained in:
parent
b02bcdd82d
commit
6f7991184d
2 changed files with 28 additions and 5 deletions
|
@ -9,18 +9,41 @@ let
|
||||||
name = mkOption {
|
name = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
};
|
};
|
||||||
startHook = mkOption {
|
workdir = mkOption {
|
||||||
type = types.lines;
|
type = types.str;
|
||||||
|
};
|
||||||
|
windowCount = mkOption {
|
||||||
|
type = types.ints.positive;
|
||||||
|
default = 1;
|
||||||
|
};
|
||||||
|
terminalCommands = mkOption {
|
||||||
|
type = types.listOf types.str;
|
||||||
|
default = [ ];
|
||||||
|
};
|
||||||
|
spawnPrograms = mkOption {
|
||||||
|
type = types.listOf types.str;
|
||||||
|
default = [ ];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
mkXmonadProjectSpawnProgram = program:
|
||||||
|
"spawn \"${program}\"";
|
||||||
|
|
||||||
mkXmonadProject = { name, startHook }:
|
mkXmonadProjectTerminalCommand = command:
|
||||||
|
"spawn $ terminal' workdir $ Just \"${command}\"";
|
||||||
|
|
||||||
|
|
||||||
|
mkXmonadProject = { name, workdir, windowCount, spawnPrograms, terminalCommands }:
|
||||||
''
|
''
|
||||||
Project {
|
Project {
|
||||||
projectName = "${name}",
|
projectName = "${name}",
|
||||||
projectStartHook = ${startHook}
|
projectStartHook =
|
||||||
|
do
|
||||||
|
let workdir = "${workdir}"
|
||||||
|
${lib.concatStringsSep "\n" (map mkXmonadProjectSpawnProgram spawnPrograms)}
|
||||||
|
${lib.concatStringsSep "\n" (map mkXmonadProjectTerminalCommand terminalCommands)}
|
||||||
|
replicateM_ ${toString windowCount} $ spawn $ terminal workdir
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
|
Binary file not shown.
Loading…
Reference in a new issue