add background for each output

This commit is contained in:
2025-08-21 14:08:58 +02:00
parent 9b973e3ed4
commit d1c3ec9b75
2 changed files with 101 additions and 221 deletions

View File

@@ -12,7 +12,40 @@ in {
};
config = lib.mkIf cfg.enable {
services.kanshi = {
services.kanshi = let
bgdir = ../../../assets;
bg1080 = bgdir + "/bg1080.png";
bg1080vert = bgdir + "/bg1080vert.png";
bg4k = bgdir + "/bg4k.png";
luhbots_workstation = settings: {
profile.outputs = [
{
criteria = "eDP-1";
position = if settings.vertical.left then "1080,1080" else "0,1080";
}
{
criteria = settings.horizontal.name;
position = if settings.vertical.left then "1080,0" else "0,0";
}
{
criteria = settings.vertical.name;
transform = settings.vertical.orientation;
position = if settings.vertical.left then "0,0" else "1920,0";
}
];
profile.exec = [
"${pkgs.sway}/bin/swaymsg 'workspace \"main\" output \"${settings.horizontal.name}\", workspace --no-auto-back-and-forth main, move workspace to \"${settings.horizontal.name}\", workspace back_and_forth'"
"${pkgs.sway}/bin/swaymsg 'workspace \"term\" output \"${settings.vertical.name}\", workspace --no-auto-back-and-forth term, move workspace to \"${settings.vertical.name}\", workspace back_and_forth'"
"${pkgs.sway}/bin/swaymsg 'workspace \"msg\" output eDP-1, workspace --no-auto-back-and-forth msg, move workspace to eDP-1, workspace back_and_forth'"
"${pkgs.sway}/bin/swaymsg 'workspace \"msg\" output eDP-1, workspace --no-auto-back-and-forth music, move workspace to eDP-1, workspace back_and_forth'"
"${pkgs.sway}/bin/swaymsg 'workspace \"5\" output \"${settings.horizontal.name}\", workspace --no-auto-back-and-forth 5, move workspace to \"${settings.horizontal.name}\", workspace back_and_forth'"
"${pkgs.sway}/bin/swaymsg 'output \"eDP-1\" bg ${bg1080} fit'"
"${pkgs.sway}/bin/swaymsg 'output \"${settings.horizontal.name}\" bg ${bg4k} fit'"
"${pkgs.sway}/bin/swaymsg 'output \"${settings.vertical.name}\" bg ${bg1080vert} fit'"
"${pkgs.sway}/bin/swaymsg 'workspace --no-auto-back-and-forth msg, workspace --no-auto-back-and-forth term, workspace --no-auto-back-and-forth main'"
];
};
in {
enable = true;
settings = lib.mkIf cfg.laptop [
{
@@ -24,223 +57,70 @@ in {
}
];
}
{
profile.outputs = [
{
criteria = "eDP-1";
position = "0,1080";
}
{
criteria = "Dell Inc. DELL U2422HE GRCPH83";
position = "0,0";
}
{
criteria = "NEC Corporation E243WMi 7X313185NB";
transform = "90";
position = "1920,0";
}
];
profile.exec = [
"${pkgs.sway}/bin/swaymsg workspace main; move workspace to DP-4; workspace back_and_forth"
"${pkgs.sway}/bin/swaymsg workspace term; move workspace to DP-5; workspace back_and_forth"
"${pkgs.sway}/bin/swaymsg workspace msg; move workspace to eDP-1; workspace back_and_forth"
"${pkgs.sway}/bin/swaymsg workspace music; move workspace to eDP-1; workspace back_and_forth"
"${pkgs.sway}/bin/swaymsg workspace 5; move workspace to DP-4; workspace back_and_forth"
];
}
{
profile.outputs = [
{
criteria = "eDP-1";
position = "0,1080";
}
{
criteria = "Dell Inc. DELL U2422HE 8YCPH83";
transform = "normal";
position = "0,0";
}
{
criteria = "Dell Inc. DELL P2422HE 28XL9M3";
transform = "normal";
position = "1920,0";
}
];
profile.exec = [
"${pkgs.sway}/bin/swaymsg workspace main; move workspace to '\"Dell Inc. DELL U2422HE 8YCPH83\"'; workspace back_and_forth"
"${pkgs.sway}/bin/swaymsg workspace term; move workspace to '\"Dell Inc. DELL P2422HE 28XL9M3\"'; workspace back_and_forth"
"${pkgs.sway}/bin/swaymsg workspace msg; move workspace to eDP-1; workspace back_and_forth"
"${pkgs.sway}/bin/swaymsg workspace music; move workspace to eDP-1; workspace back_and_forth"
"${pkgs.sway}/bin/swaymsg workspace 5; move workspace to '\"Dell Inc. DELL U2422HE 8YCPH83\"'; workspace back_and_forth"
];
}
{
profile.outputs = [
{
criteria = "eDP-1";
position = "0,1080";
}
{
criteria = "Dell Inc. DELL U2422HE 53DCH83";
position = "0,0";
}
{
criteria = "Dell Inc. DELL U2412M 0FFXD46I4U5S";
transform = "90";
position = "1920,0";
}
];
profile.exec = [
"${pkgs.sway}/bin/swaymsg workspace main; move workspace to DP-6; workspace back_and_forth"
"${pkgs.sway}/bin/swaymsg workspace term; move workspace to DP-7; workspace back_and_forth"
"${pkgs.sway}/bin/swaymsg workspace msg; move workspace to eDP-1; workspace back_and_forth"
"${pkgs.sway}/bin/swaymsg workspace music; move workspace to eDP-1; workspace back_and_forth"
"${pkgs.sway}/bin/swaymsg workspace 5; move workspace to DP-6; workspace back_and_forth"
];
}
{
profile.outputs = [
{
criteria = "eDP-1";
position = "1080,1080";
}
{
criteria = "Dell Inc. DELL P2422HE 4BXL9M3";
position = "1080,0";
}
{
criteria = "NEC Corporation E243WMi 75309334NB";
transform = "90";
position = "0,0";
}
];
profile.exec = [
"${pkgs.sway}/bin/swaymsg workspace main; move workspace to DP-3; workspace back_and_forth"
"${pkgs.sway}/bin/swaymsg workspace term; move workspace to DP-4; workspace back_and_forth"
"${pkgs.sway}/bin/swaymsg workspace msg; move workspace to eDP-1; workspace back_and_forth"
"${pkgs.sway}/bin/swaymsg workspace music; move workspace to eDP-1; workspace back_and_forth"
"${pkgs.sway}/bin/swaymsg workspace 5; move workspace to DP-3; workspace back_and_forth"
];
}
{
profile.outputs = [
{
criteria = "eDP-1";
position = "1080,1080";
}
{
criteria = "Dell Inc. DELL P2422HE JLXL9M3";
position = "1080,0";
}
{
criteria = "NEC Corporation E243WMi 59118576NB";
transform = "90";
position = "0,0";
}
];
profile.exec = [
"${pkgs.sway}/bin/swaymsg workspace main; move workspace to DP-3; workspace back_and_forth"
"${pkgs.sway}/bin/swaymsg workspace term; move workspace to DP-4; workspace back_and_forth"
"${pkgs.sway}/bin/swaymsg workspace msg; move workspace to eDP-1; workspace back_and_forth"
"${pkgs.sway}/bin/swaymsg workspace music; move workspace to eDP-1; workspace back_and_forth"
"${pkgs.sway}/bin/swaymsg workspace 5; move workspace to DP-3; workspace back_and_forth"
];
}
{
profile.outputs = [
{
criteria = "eDP-1";
position = "0,1080";
}
{
criteria = "Dell Inc. DELL P2422HE 7VWL9M3";
position = "0,0";
}
{
criteria = "ViewSonic Corporation VG2448 V5E201960167";
transform = "90";
position = "1920,0";
}
];
profile.exec = [
"${pkgs.sway}/bin/swaymsg workspace main; move workspace to '\"Dell Inc. DELL P2422HE 7VWL9M3\"'; workspace back_and_forth"
"${pkgs.sway}/bin/swaymsg workspace term; move workspace to '\"ViewSonic Corporation VG2448 V5E201960167\"'; workspace back_and_forth"
"${pkgs.sway}/bin/swaymsg workspace msg; move workspace to eDP-1; workspace back_and_forth"
"${pkgs.sway}/bin/swaymsg workspace music; move workspace to eDP-1; workspace back_and_forth"
"${pkgs.sway}/bin/swaymsg workspace 5; move workspace to '\"Dell Inc. DELL P2422HE 7VWL9M3\"'; workspace back_and_forth"
];
}
{
profile.outputs = [
{
criteria = "eDP-1";
position = "1080,1080";
}
{
criteria = "Dell Inc. DELL U2422HE 7HCPH83";
position = "1080,0";
}
{
criteria = "Dell Inc. DELL U2422HE 1XFFH83";
transform = "90";
position = "0,0";
}
];
profile.exec = [
"${pkgs.sway}/bin/swaymsg workspace main; move workspace to '\"Dell Inc. DELL U2422HE 7HCPH83\"'; workspace back_and_forth"
"${pkgs.sway}/bin/swaymsg workspace term; move workspace to '\"Dell Inc. DELL U2422HE 1XFFH83\"'; workspace back_and_forth"
"${pkgs.sway}/bin/swaymsg workspace msg; move workspace to eDP-1; workspace back_and_forth"
"${pkgs.sway}/bin/swaymsg workspace music; move workspace to eDP-1; workspace back_and_forth"
"${pkgs.sway}/bin/swaymsg workspace 5; move workspace to '\"Dell Inc. DELL U2422HE 7HCPH83\"'; workspace back_and_forth"
];
}
{
profile.outputs = [
{
criteria = "eDP-1";
position = "1080,1080";
}
{
criteria = "Dell Inc. DELL U2422HE 5XY5H83";
position = "1080,0";
}
{
criteria = "Dell Inc. DELL U2419H 11B7Y13";
transform = "270";
position = "0,0";
}
];
profile.exec = [
"${pkgs.sway}/bin/swaymsg workspace main; move workspace to '\"Dell Inc. DELL U2422HE 5XY5H83\"'; workspace back_and_forth"
"${pkgs.sway}/bin/swaymsg workspace term; move workspace to '\"Dell Inc. DELL U2419H 11B7Y13\"'; workspace back_and_forth"
"${pkgs.sway}/bin/swaymsg workspace msg; move workspace to eDP-1; workspace back_and_forth"
"${pkgs.sway}/bin/swaymsg workspace music; move workspace to eDP-1; workspace back_and_forth"
"${pkgs.sway}/bin/swaymsg workspace 5; move workspace to '\"Dell Inc. DELL U2422HE 5XY5H83\"'; workspace back_and_forth"
];
}
{
profile.outputs = [
{
criteria = "eDP-1";
position = "1080,1080";
}
{
criteria = "DP-3";
position = "1080,0";
}
{
criteria = "DP-1";
transform = "90";
position = "0,0";
}
];
profile.exec = [
"${pkgs.sway}/bin/swaymsg workspace main; move workspace to DP-3; workspace back_and_forth"
"${pkgs.sway}/bin/swaymsg workspace term; move workspace to DP-1; workspace back_and_forth"
"${pkgs.sway}/bin/swaymsg workspace msg; move workspace to eDP-1; workspace back_and_forth"
"${pkgs.sway}/bin/swaymsg workspace music; move workspace to eDP-1; workspace back_and_forth"
"${pkgs.sway}/bin/swaymsg workspace 5; move workspace to DP-3; workspace back_and_forth"
];
}
(luhbots_workstation {
horizontal.name = "Dell Inc. DELL U2422HE GRCPH83";
vertical = {
name = "NEC Corporation E243WMi 7X313185NB";
left = false;
orientation = "90";
};
})
(luhbots_workstation {
horizontal.name = "Dell Inc. DELL U2422HE 8YCPH83";
vertical = {
name = "Dell Inc. DELL P2422HE 28XL9M3";
left = false;
orientation = "normal";
};
})
(luhbots_workstation {
horizontal.name = "Dell Inc. DELL U2422HE 53DCH83";
vertical = {
name = "Dell Inc. DELL U2412M 0FFXD46I4U5S";
left = false;
orientation = "90";
};
})
(luhbots_workstation {
horizontal.name = "Dell Inc. DELL P2422HE 4BXL9M";
vertical = {
name = "NEC Corporation E243WMi 75309334NB";
left = true;
orientation = "90";
};
})
(luhbots_workstation {
horizontal.name = "Dell Inc. DELL P2422HE JLXL9M3";
vertical = {
name = "NEC Corporation E243WMi 59118576NB";
left = true;
orientation = "90";
};
})
(luhbots_workstation {
horizontal.name = "Dell Inc. DELL P2422HE 7VWL9M3";
vertical = {
name = "ViewSonic Corporation VG2448 V5E201960167";
left = false;
orientation = "90";
};
})
(luhbots_workstation {
horizontal.name = "Dell Inc. DELL U2422HE 7HCPH83";
vertical = {
name = "Dell Inc. DELL U2422HE 1XFFH83";
left = true;
orientation = "90";
};
})
(luhbots_workstation {
horizontal.name = "Dell Inc. DELL U2422HE 5XY5H83";
vertical = {
name = "Dell Inc. DELL U2419H 11B7Y13";
left = true;
orientation = "270";
};
})
{
profile.name = "docked-4k";
profile.outputs = [