#!/bin/zsh
workspaces=(
	16:D
	15:S
	14:A
	13:E
	12:W
	11:Q
	10
	9
	8
	7
	6
	5
	4
	3
	2
	1
)

for ws in $workspaces; do
	layout=$HOME/.cache/i3/layout.$(tr -d '\n' <<<$ws | xxd -p).json
	if [[ -e $layout ]] ; then
		i3-msg "workspace \"$ws\" ; append_layout \"$layout\"" || exit $?
	fi
done

svdir=$HOME/.local/share/xservice/${DISPLAY//:/@}
tmux-autoattach
sv once $svdir/xpra && sv check $svdir/xpra
sv once $svdir/i3restore