Last active
September 14, 2017 03:33
-
-
Save nanpuyue/334ad4e854f4e8d89cce294904bf7e7d to your computer and use it in GitHub Desktop.
CrossOver 迅雷极速版启动脚本,用于修复残留窗口遮挡屏幕
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# filename: start_thunder.sh | |
# date: 2017-03-11 | |
# author: nanpuyue <[email protected]> https://blog.nanpuyue.com | |
EXIT_TIME=$(( $(date +%s) + 15 )) | |
exec "/opt/cxoffice/bin/wine" --bottle "迅雷极速版" --check --wait-children --start "C:/users/Public/Start Menu/Programs/迅雷软件/迅雷极速版/启动迅雷极速版.lnk" "$@" & | |
fun1(){ | |
xdotool search --onlyvisible --classname "Thunder.exe" | |
} | |
fun2(){ | |
local xprop_output=$(xprop -id "$1") | |
[[ "$xprop_output" =~ "program specified location: 0, 0" ]] && { | |
[[ "$xprop_output" =~ "迅雷极速版" ]] || xdotool windowclose "$1" | |
} | |
} | |
fun3(){ | |
fun1|\ | |
while read line;do | |
fun2 "$line" | |
done | |
} | |
while (( $(date +%s) < $EXIT_TIME )) && (( $(fun1|wc -l) < 4 )); do | |
sleep 1 | |
done | |
fun3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
在迅雷上没效果 极速没试,因为极速没破解的
2017.9.14
很久了,再来试了下你的脚本,可能是以前没看懂吧,现在发现是可以的,但是由于版本不一样,wine迅雷始终有缺陷
我是迅雷9 脚本启动后,过段时间就自己关闭了,然后弹窗又出来了,接着就是下载引擎已停止,wine终究是wine。。