Skip to content

Instantly share code, notes, and snippets.

@emanuele6
Last active February 26, 2022 13:04
Show Gist options
  • Save emanuele6/81c5d72a7341f322818335a8b976f42b to your computer and use it in GitHub Desktop.
Save emanuele6/81c5d72a7341f322818335a8b976f42b to your computer and use it in GitHub Desktop.
#!/bin/bash -
get_rect() {
local target
target=$(bspc query -N -n "$1.floating") || return
bspc subscribe node_geometry | while IFS=' ' read -r _ _ _ wid rect; do
if (( wid == target )); then
printf '%s\n' "$rect"
break
fi
done &
bspc node "$target" -z top 0 0
wait %- 2> /dev/null
}
get_rect focused
#!/bin/sh -
get_rect() {
target=$(bspc query -N -n "$1.floating") || return
bspc subscribe node_geometry | while IFS=' ' read -r a b c wid rect; do
if [ "$wid" = "$target" ]; then
printf '%s\n' "$rect"
break
fi
done &
bspc node "$target" -z top 0 0
wait %- 2> /dev/null
}
get_rect focused
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment