From a87520eef703ef46c7f5feb36c2583329422e13d Mon Sep 17 00:00:00 2001 From: JopStro <33031853+JopStro@users.noreply.github.com> Date: Thu, 2 Jul 2020 12:24:46 +0100 Subject: Update bspswallow --- alternative/bspswallow | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/alternative/bspswallow b/alternative/bspswallow index 832f191..129e10a 100755 --- a/alternative/bspswallow +++ b/alternative/bspswallow @@ -1,14 +1,6 @@ #!/bin/sh # Get class of a wid -get_class() { - id=$1 - if [ -z "$id" ]; then - echo "" - else - xprop -id "$id" | sed -n '/WM_CLASS\|WM_COMMAND/s/.*"\(.*\)".*/\1/p' - fi -} swallow() { addedtodesktop=$2 @@ -18,8 +10,8 @@ swallow() { swallowingid=$(bspc query -N -n last) if [ "$addedtodesktop" = "$lasttermdesktop" ]; then - grep "^$(get_class "$swallowerid")$" ~/.config/bspwm/swallow || return - grep "^$(get_class "$swallowingid")$" ~/.config/bspwm/terminals || return + grep "^$(xwinfo -c "$swallowerid")$" ~/.config/bspwm/swallow || return + grep "^$(xwinfo -c "$swallowingid")$" ~/.config/bspwm/terminals || return echo "$swallowerid $swallowingid" >> /tmp/swallowids bspc node "$swallowingid" --flag hidden=on fi -- cgit v1.2.3