From 39cd140c7a7c447d70f4d6c3233b78f07e1e0504 Mon Sep 17 00:00:00 2001 From: Aly Raffauf Date: Sat, 27 Apr 2024 17:33:46 -0400 Subject: [PATCH] sway: add bindings to mvoe workspaces across outputs --- homeManagerModules/desktop/sway/default.nix | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/homeManagerModules/desktop/sway/default.nix b/homeManagerModules/desktop/sway/default.nix index aaee940c..92131e17 100644 --- a/homeManagerModules/desktop/sway/default.nix +++ b/homeManagerModules/desktop/sway/default.nix @@ -136,8 +136,8 @@ gdk_scale = "1.5"; cycleSwayDisplayModes = pkgs.writeShellScriptBin "cycleSwayDisplayModes" '' - # Only works on petalburg. - current_mode=$(${config.wayland.windowManager.sway.package}/bin/swaymsg -t get_outputs -p | grep "Current mode" | grep -Eo '[0-9]+x[0-9]+ @ [0-9.]+ Hz' | tr -d " ") + # TODO: remove petalburg hardcodes + current_mode=$(${config.wayland.windowManager.sway.package}/bin/swaymsg -t get_outputs -p | grep "Current mode" | grep -Eo '[0-9]+x[0-9]+ @ [0-9.]+ Hz' | tr -d " " | grep 2880) if [ $current_mode = "2880x1800@90.001Hz" ]; then ${config.wayland.windowManager.sway.package}/bin/swaymsg output "eDP-1" mode "2880x1800@60.001Hz"; @@ -260,6 +260,12 @@ "${modifier}+Shift+9" = "move container to workspace number 9"; "${modifier}+Shift+0" = "move container to workspace number 10"; + # Move workspace to another output. + "${modifier}+Control+Shift+Left" = "move workspace to output left"; + "${modifier}+Control+Shift+Down" = "move workspace to output down"; + "${modifier}+Control+Shift+Up" = "move workspace to output up"; + "${modifier}+Control+Shift+Right" = "move workspace to output right"; + # Scratchpad show and move "${modifier}+S" = "scratchpad show"; "${modifier}+Shift+S" = "move scratchpad";