baskerville/bspwm — pull request #39 by Stebalien (2013-07-13 22:46:47+00:00)
Title: Presel modifier

Allows selecting windows based on whether or not they are preseled. This is useful for duplicating the old shift-can-be-transplant behaviour (among other things like sending the focused window to the last focused preseled window).

```sh
# Usage: squish DIR
# - If there is a preseled window in the given direction, transplant
# into its node.
# - If the focused window is preseled, transplant the window in the
# given direction into it.
# - Otherwise, swap.

squish() {
{
dir=$1
if bspc query -W -w ${dir}.presel; then
bspc window -w ${dir}
elif bspc query -W -w focused.presel; then
bspc window ${dir} -w focused
else
bspc window -s ${dir}
fi
} >/dev/null
}
```
Should fix: https://bbs.archlinux.org/viewtopic.php?pid=1299828#p1299828