Refactor videocall script

This commit is contained in:
coolneng 2021-05-31 13:26:58 +02:00
parent 9504037034
commit f2122ddb41
Signed by: coolneng
GPG Key ID: 9893DA236405AF57
1 changed files with 10 additions and 6 deletions

View File

@ -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"