View previous topic :: View next topic |
Author |
Message |
toralf Developer
Joined: 01 Feb 2004 Posts: 3922 Location: Hamburg
|
Posted: Tue Apr 20, 2010 11:51 am Post subject: HOWTO automate KDE Sweeper to keep digital privacy |
|
|
Hi, this is my first attempt to automate that tool by using the script below as a "mouse driver".
BTW you need the nifty xdotool for this scriptlet : Code: | #!/bin/sh
#
# automate KDE sweeper with xdotool
#
# set -x
sweeper &
# get the window id, but break after MAX seconds
#
WINID=""
N=0
MAX=${2:-10}
while [[ -z "$WINID" && $N -le $MAX ]]
do
for i in $(xdotool search --title "$Sweeper" 2>/dev/null)
do
xwininfo -id $i | grep "^xwininfo: Window id: " | grep -q "\"Sweeper\""
if [[ $? -eq 0 ]]; then
WINID=$i
break
fi
done
((N=N+1))
sleep 1
done
if [[ -z "$WINID" ]]; then
echo "did not found a window id"
exit 2
fi
xdotool windowactivate $WINID
# click at "Select All"
#
xdotool key alt+a
# click at "Clean Up"
#
xdotool key alt+c
sleep 1
# get the popup window id with the warning message
#
TMPID=$(xdotool search --onlyvisible --title "^Warning ? Sweeper$" 2>/dev/null)
if [[ -z "$TMPID" ]]; then
echo "did not found the popup window id"
exit 3
fi
xdotool windowactivate $TMPID
# click at "Continue"
#
xdotool key alt+o
sleep 2
# activate the sweeper window and close the app
#
xdotool windowactivate $WINID && xdotool key ctrl+q
exit 0
|
|
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|