dotfiles/home/fhauser/applications/kanshi.nix

57 lines
1.5 KiB
Nix

{
pkgs,
lib,
config,
...
}:
{
# systemd.user.services.kanshi.Install.WantedBy = "home-manager-fhauser.service"; # TODO: Upstream array type of systemdTarget
services.kanshi = {
enable = true;
settings =
let
mkScreen = display: position: {
inherit (display.output) criteria;
inherit position;
};
mkProfile = name: outputs: {
profile = {
inherit name outputs;
exec = backgroundCommand;
};
};
# Can be applied by profile.exec
backgroundPicturePath = "~/shares/cloud.qo.is/pictures/backgrounds";
backgroundCommand = ''
swaymsg "output * bg `find ${backgroundPicturePath} -type f | shuf -n 1` fill"
'';
screens = {
x1-screen.output = {
criteria = "California Institute of Technology 0x1404 Unknown";
scale = null;
};
chur-4k.output = {
criteria = "HP Inc. HP Z27 CN482201RP";
scale = 1.2;
};
chur-dell.output = {
criteria = "Dell Inc. DELL P2720DC 22JPK53";
scale = null;
};
chur-small.output = {
criteria = "Eizo Nanao Corporation EV2450 92395086";
scale = null;
};
};
in
with lib;
(attrValues screens)
++ (with screens; [
(mkProfile "home-dock" [
(mkScreen x1-screen "0,120")
(mkScreen chur-4k "1920,0")
])
]);
};
}