|
@@ -0,0 +1,29 @@
|
|
|
+#!/bin/zsh -f
|
|
|
+
|
|
|
+if [[ $# -eq 0 ]] ; then
|
|
|
+ echo "i3-layout [ name workspace | list | define workspace name ]"
|
|
|
+ exit
|
|
|
+fi
|
|
|
+
|
|
|
+LAYOUT=$1
|
|
|
+WORKSPACE=$2
|
|
|
+
|
|
|
+case ${LAYOUT} in
|
|
|
+ define)
|
|
|
+ NAME=$3
|
|
|
+ i3-save-layout --workspace ${WORKSPACE} > ~/.config/i3/${NAME}.json
|
|
|
+ emacsclient --alternate-editor="" -n ${NAME}.json
|
|
|
+ ;;
|
|
|
+ list)
|
|
|
+ for layout in ~/.config/i3/*.json ;
|
|
|
+ do
|
|
|
+ echo " - $(basename -- ${layout} .json)"
|
|
|
+ done
|
|
|
+ ;;
|
|
|
+ *)
|
|
|
+ if [[ -e ~/.config/i3/${LAYOUT}.json ]] ; then
|
|
|
+ i3-msg "workspace ${WORKSPACE}; append_layout ~/.config/i3/${LAYOUT}.json"
|
|
|
+ else
|
|
|
+ echo "${LAYOUT} not available"
|
|
|
+ fi
|
|
|
+esac
|