wm-logs/home/local/bin/fuck_wine_shadow

28 lines
576 B
Plaintext
Raw Permalink Normal View History

2023-10-11 11:37:36 +08:00
#!/bin/bash
win_id=$(wmctrl -l -G -p -x | grep wechat.exe | awk '{print $1}')
2023-11-20 09:41:22 +08:00
shadow_id=${win_id: -4}
shadow_id=$(printf "%d" "0x$shadow_id") # 转十进制
shadow_id=$((shadow_id + 4))
shadow_id=$(printf "%x" $shadow_id) # 转回十六进制
shadow_id=$(printf "%04d" "$shadow_id") # 不够4位补0
win_id="${win_id:0:-4}${shadow_id}"
#echo $shadow_id, $win_id
2023-10-11 11:37:36 +08:00
2023-11-20 09:41:22 +08:00
if [ "$(pidof fuck_wine_shadow)"]; then
killall fuck_wine_shadow
fi
2023-10-11 11:37:36 +08:00
if [ "$win_id" != "0014" ]; then
while true; do
xdotool windowunmap $win_id
sleep 5
done
2023-11-20 09:41:22 +08:00
else
sleep 5
fuck_wine_shadow
2023-10-11 11:37:36 +08:00
fi