24 lines
421 B
Plaintext
Executable File
24 lines
421 B
Plaintext
Executable File
function move {
|
|
CURR_WORKSPACE=$(swaymsg -t get_workspaces | jq -r '. | map(select(.focused == true)) | .[0].name')
|
|
|
|
echo $CURR_WORKSPACE
|
|
|
|
case $1 in
|
|
"next")
|
|
NEW_WORKSPACE=$(expr ${CURR_WORKSPACE} + 1)
|
|
;;
|
|
"prev")
|
|
NEW_WORKSPACE=$(expr ${CURR_WORKSPACE} - 1)
|
|
;;
|
|
esac
|
|
|
|
swaymsg "move container to workspace ${NEW_WORKSPACE}"
|
|
swaymsg "workspace ${NEW_WORKSPACE}"
|
|
}
|
|
|
|
case $1 in
|
|
"move")
|
|
move $2
|
|
;;
|
|
esac
|