Skip to content

Instantly share code, notes, and snippets.

@nanpuyue
Last active November 2, 2025 09:19
Show Gist options
  • Save nanpuyue/334ad4e854f4e8d89cce294904bf7e7d to your computer and use it in GitHub Desktop.
Save nanpuyue/334ad4e854f4e8d89cce294904bf7e7d to your computer and use it in GitHub Desktop.
CrossOver 迅雷极速版启动脚本,用于修复残留窗口遮挡屏幕
#!/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