i3-sway: multiple outputs (#4223)

multiple outputs can be assigned to a workspace
This commit is contained in:
Sven Friedrich 2023-07-14 21:25:55 +02:00 committed by GitHub
parent d2e47de536
commit f63b39a67d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 17 additions and 3 deletions

View File

@ -150,7 +150,8 @@ rec {
windowCommandsStr = { command, criteria, ... }:
"for_window ${criteriaStr criteria} ${command}";
workspaceOutputStr = item:
''workspace "${item.workspace}" output "${item.output}"'';
let outputs = concatMapStringsSep " " strings.escapeNixString item.output;
in ''workspace "${item.workspace}" output ${outputs}'';
indent = list:
{ includesWrapper ? true, level ? 1 }:

View File

@ -912,11 +912,12 @@ in {
};
output = mkOption {
type = str;
type = with types; either str (listOf str);
default = "";
apply = lists.toList;
example = "eDP";
description = ''
Name of the output from <command>
Name(s) of the output(s) from <command>
${if isSway then "swaymsg" else "i3-msg"} -t get_outputs
</command>.
'';

View File

@ -98,3 +98,4 @@ workspace "1" output "eDP"
workspace "ABC" output "DP"
workspace "3: Test" output "HDMI"
workspace "!"§$%&/(){}[]=?\*#<>-_.:,;²³" output "DVI"
workspace "Multiple" output "DVI" "HDMI" "DP"

View File

@ -6,6 +6,7 @@ let
ws2 = "ABC";
ws3 = "3: Test";
ws4 = ''!"§$%&/(){}[]=?\*#<>-_.:,;²³'';
ws5 = "Multiple";
};
in {
@ -31,6 +32,10 @@ in {
workspace = "${i3.ws4}";
output = "DVI";
}
{
workspace = "${i3.ws5}";
output = [ "DVI" "HDMI" "DP" ];
}
];
};

View File

@ -107,4 +107,5 @@ workspace "1" output "eDP"
workspace "ABC" output "DP"
workspace "3: Test" output "HDMI"
workspace "!"§$%&/(){}[]=?\*#<>-_.:,;²³" output "DVI"
workspace "Multiple" output "DVI" "HDMI" "DP"
exec "/nix/store/00000000000000000000000000000000-dbus/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL; systemctl --user start sway-session.target"

View File

@ -6,6 +6,7 @@ let
ws2 = "ABC";
ws3 = "3: Test";
ws4 = ''!"§$%&/(){}[]=?\*#<>-_.:,;²³'';
ws5 = "Multiple";
};
in {
@ -34,6 +35,10 @@ in {
workspace = "${i3.ws4}";
output = "DVI";
}
{
workspace = "${i3.ws5}";
output = [ "DVI" "HDMI" "DP" ];
}
];
};