Skip to content

Commit

Permalink
Add autoclick for linux
Browse files Browse the repository at this point in the history
ignore log files
  • Loading branch information
0x9900 committed Sep 19, 2024
1 parent 9cbf77b commit 577c133
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ coverage.xml

# Django stuff:
*.log
*.log.?
local_settings.py
db.sqlite3
db.sqlite3-journal
Expand Down
40 changes: 40 additions & 0 deletions autoclick.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/bash
#
# autoclick.sh
# Copyright (C) 2024 fred <[email protected]>
#
# Distributed under terms of the BSD 3-Clause license.
#
# Don't forget to install xdotool

# On ubuntu based os run the following commands:
# apt update && apt upgrade -y
# apt install xdotool
#


declare -a wids

windowid=0
while [[ $windowid == 0 ]]; do
wids=$(xdotool search --name "WSJT-X" )
for id in $wids; do
# echo "${id} = $(xdotool getwindowname ${id})"
xdotool getwindowname ${id} | grep "^WSJT-X.*QSO$"
if [[ $? == 0 ]]; then
windowid=${id}
break
fi
done
[[ ${windowid} == 0 ]] && sleep 5
done
echo "Logging window ID: ${windowid}"

while true; do
while xdotool windowactivate ${windowid} 2>&1 | grep -q "failed"; do
sleep 5
done
sleep .5
xdotool key Return
sleep 10
done

0 comments on commit 577c133

Please sign in to comment.