Last active
February 26, 2022 13:04
-
-
Save emanuele6/81c5d72a7341f322818335a8b976f42b to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/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 |
This file contains hidden or 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
#!/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