-
-
Save Anr-C/10cafaf36e42ecb7991a5eaa0c32f619 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 windowminimize "$1" | |
} | |
} | |
fun3(){ | |
fun1|\ | |
while read line;do | |
fun2 "$line" | |
done | |
} | |
while (( $(date +%s) < $EXIT_TIME )) && (( $(fun1|wc -l) < 3 )); do | |
sleep 1 | |
done | |
fun3 | |
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