.dotfiles/configs/sway/create_floating.sh

19 lines
394 B
Bash
Raw Normal View History

2022-04-08 15:47:38 +02:00
#!/usr/bin/env bash
$@ &
pid=$!
swaymsg -t subscribe -m '[ "window" ]' \
| jq --unbuffered --argjson pid "$pid" '.container | select(.pid == $pid) | .id' \
2022-04-08 15:51:10 +02:00
| xargs -I '@' -- swaymsg '[ con_id=@ ] floating enable, resize set 600 450' &
2022-04-08 15:47:38 +02:00
subscription=$!
echo Going into wait state
# Wait for our process to close
tail --pid=$pid -f /dev/null
echo Killing subscription
kill $subscription