From f2122ddb41a166479c78dd4ca9913da0753b61f0 Mon Sep 17 00:00:00 2001 From: coolneng Date: Mon, 31 May 2021 13:26:58 +0200 Subject: [PATCH] Refactor videocall script --- scripts/.local/share/scripts/videocall | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/scripts/.local/share/scripts/videocall b/scripts/.local/share/scripts/videocall index 4fa9f01..7ffb0d5 100755 --- a/scripts/.local/share/scripts/videocall +++ b/scripts/.local/share/scripts/videocall @@ -5,13 +5,17 @@ usage() { exit 1 } -move_workspaces() { +move_workspace() { + swaymsg workspace "$1", move workspace to "$2" +} + +main() { if [ "$1" = "start" ]; then - swaymsg workspace "3: ", move workspace to HDMI-A-2 - swaymsg workspace "2: ", move workspace to eDP-1 + move_workspace "3: " "HDMI-A-2" + move_workspace "2: " "eDP-1" elif [ "$1" = "stop" ]; then - swaymsg workspace "3: ", move workspace to eDP-1 - swaymsg workspace "2: ", move workspace to HDMI-A-2 + move_workspace "3: " "eDP-1" + move_workspace "2: " "HDMI-A-2" else usage fi @@ -23,4 +27,4 @@ fi action=$1 -move_workspaces "$action" +main "$action"