Created
March 29, 2016 05:21
-
-
Save sainathadapa/abe2be60c4e12fedfa05 to your computer and use it in GitHub Desktop.
Workaround to have an empty workspace in I3 Window manager
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"border": "pixel", | |
"floating": "auto_off", | |
"layout": "stacked", | |
"percent": 1, | |
"type": "con", | |
"nodes": [ | |
{ | |
"border": "pixel", | |
"current_border_width": 3, | |
"floating": "auto_off", | |
"geometry": { | |
"height": 523, | |
"width": 802, | |
"x": 0, | |
"y": 0 | |
}, | |
"name": "", | |
"percent": null, | |
"swallows": [ | |
{ | |
"class": ".*" | |
} | |
], | |
"type": "con" | |
} | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WKNAME=$1 | |
echo workspace name given is $WKNAME | |
if i3-msg -t get_workspaces | jq ".[] | .name" | grep -q -w $WKNAME; then | |
i3-msg "workspace $WKNAME" | |
else | |
i3-msg "workspace $WKNAME; append_layout ~/.i3/empty_workspace.json" | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
currentDesk=$(xdotool get_desktop) | |
awkArgs="'\$2 == \"$currentDesk\" {print \$3}'" | |
getNumWindows="wmctrl -l | awk ${awkArgs} | wc -l" | |
numWindows=`eval $getNumWindows` | |
echo $numWindows | |
if ((numWindows > 1)); then | |
i3-msg "kill" | |
else | |
i3-msg "kill; append_layout ~/.i3/empty_workspace.json" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment