aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJopStro <[email protected]>2020-07-02 12:24:46 +0100
committerGitHub <[email protected]>2020-07-02 12:24:46 +0100
commita87520eef703ef46c7f5feb36c2583329422e13d (patch)
treeeecee4ac7f354f3dd8222807ecb82dd6a494d71b
parent7bdcc2815d8d08f6f9a3ceab9b900783748e27ec (diff)
Update bspswallow
-rwxr-xr-xalternative/bspswallow12
1 files 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