each monitor default to workspace one

This commit is contained in:
xunuwu 2025-12-21 13:47:44 +01:00
parent c4dd9977e3
commit da449373e3
Signed by: xun
SSH key fingerprint: SHA256:Uot/1WoAjWAeqLOHA5vYy4phhVydsH7jCPmBjaPZfgI

View file

@ -150,6 +150,14 @@
}; };
extraConfig = '' extraConfig = ''
bindcode 202 exec ${lib.getExe pkgs.obs-cmd} replay save # F24/numpad 1 on my ID75 bindcode 202 exec ${lib.getExe pkgs.obs-cmd} replay save # F24/numpad 1 on my ID75
exec ${pkgs.writers.writeBash "default-workspaces" ''
swaymsg -t get_outputs \
| ${lib.getExe pkgs.jq} -re '.[].name' \
| xargs -I {} ${pkgs.writers.writeBash "workspace-set-default" ''
ID=$(echo $1 | ${lib.getExe pkgs.perl} -ne '$s=0;for(split//){$s+=ord}print"$s"')
swaymsg workspace ''${ID}1:1 output "$1" && swaymsg workspace number ''${ID}1:1
''} {}
''}
''; '';
}; };
} }