#!/bin/bash

# Draw a floating URxvt
# Inspired by u/f0x52

# Draw a rectangle using slop then read the geometry value
read -r X Y W H < <(slop -f "%x %y %w %h" -b 4 -t 0 -q)

# Depends on font width & height
(( W /= 7 ))
(( H /= 15 ))

# Create a variable to be used for URxvt flag option
g=${W}x${H}+${X}+${Y}

# Remove current URxvt rules
# bspc rule -r URxvt

# Draw with floating rule
# bspc rule -a URxvt -o state=floating follow=on focus=on
urxvtc -name Float -g $g &

# Restore the rule
# bspc rule -a URxvt:Draw state=floating follow=on focus=on
