better container moving management, handle xrandr at login

This commit is contained in:
2020-09-24 15:33:14 +02:00
parent 069aadd788
commit 3a784764c6
4 changed files with 55 additions and 12 deletions

22
bin/move_to_workspace Executable file
View File

@@ -0,0 +1,22 @@
#! /bin/bash
. ~/.config/i3/env
usage() {
echo "usage: move_to_workspace [1-9]"
}
if [ $# -ne 1 ]; then
usage; exit 1
fi
CURRENT_OUTPUT=$(i3-msg -t get_workspaces | jq -r ".[] | select(.focused==true).output")
if [ $1 -gt 0 ] && [ $1 -lt 43 ]; then
NEXT_WORKSPACE=$1
[ ${CURRENT_OUTPUT} == "${SECONDARY_OUTPUT}" ] && NEXT_WORKSPACE=$((10 + $1))
else
usage; exit 1
fi
i3-msg -q "move container to workspace ${NEXT_WORKSPACE}"