Files
nixcfg/scripts/swayutils
2024-05-31 00:03:10 +01:00

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