Skip to content

Commit

Permalink
xev -1 is no longer needed #17.
Browse files Browse the repository at this point in the history
  • Loading branch information
Liupold committed Aug 7, 2020
1 parent def0119 commit 9a92f0a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pidswallow
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ vomit() {
if [ "$glue" -eq 1 ] && [ "${glue_blacklist#* $cname}" = "$glue_blacklist" ];
then
[ -f "/tmp/swallowed-by-$cwid-structure" ] && \
sed -unEe 's/ConfigureNotify.*\((-?[0-9]+),(-?[0-9]+)\),/\1 \2/'\
sed -unEe 's/.*\((-?[0-9]+),(-?[0-9]+)\),/\1 \2/'\
-e 's/width ([0-9]+), height ([0-9]+).*/\1 \2/p' \
"/tmp/swallowed-by-$cwid-structure" |
{
Expand Down Expand Up @@ -121,14 +121,14 @@ swallow() {

xdo move -x "$x" -y "$y" "$cwid"
xdo resize -w "$w" -h "$h" "$cwid"
echo "ConfigureNotify ($x,$y), width $w, height $h" \
echo "event ($x,$y), width $w, height $h" \
> "/tmp/swallowed-by-$cwid-structure"
xprop -notype -id "$cwid" _NET_WM_DESKTOP > "/tmp/swallowed-by-$cwid-desk"
# subscribe to window
{
xev -id "$cwid" -1 -event structure -event property | while read -r event ; do
xev -id "$cwid" -event structure -event property | while read -r event ; do
[ "${event#*DestroyNotify}" != "$event" ] && pkill -s 0 -f "xev.*$cwid"
[ "${event#*ConfigureNotify}" != "$event" ] \
[ "${event#* width }" != "$event" ] \
&& echo "$event" > "/tmp/swallowed-by-$cwid-structure"
[ "${event#*_NET_WM_DESKTOP}" != "$event" ] \
&& xprop -notype -id "$cwid" _NET_WM_DESKTOP \
Expand Down

0 comments on commit 9a92f0a

Please sign in to comment.