Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- out_loc=$(echo "/media/ramdisk/archivarius")
- if [ -d "$out_loc" ]; then # check for directory existence
- rm -rf "$out_loc" # delete folder tree
- fi
- ./7zz x "Archivarius 3000 4.79 x32 Portable.7z" -o/media/ramdisk # unpack 7z archive
- mv "/media/ramdisk/Archivarius 3000 4.79 x32 Portable" "$out_loc" # rename the out_loc
- cd "$out_loc"
- nohup $(wine ArchivariusPort.exe) &>/dev/null & # run archivarius
- # wait for window
- window_title="Create new index"
- time_sec=900
- while [ 0 -ne $time_sec ]; do
- echo "$time_sec, waiting... to appear"
- sleep 1
- time_sec=$[$time_sec-1]
- xdotool search --onlyvisible --name "$window_title" windowactivate
- if [ $? == 0 ]; then
- echo "window found"
- break
- fi
- done
- # setup window position and size
- xdotool key Escape # close current wizard window
- sleep 0.5
- window_title="Search system for home and office"
- window_handle=$(xdotool search --sync --onlyvisible --name "$window_title")
- echo window_id = $window_handle
- wmctrl -ir $window_handle -b remove,maximized_vert,maximized_horz # unmaximize window
- xdotool windowmove --sync "$window_handle" 0 60
- xdotool windowsize --sync "$window_handle" 1816 1016
- # rerun index wizard
- xdotool windowactivate $window_handle
- # get current mouse coords
- eval $(xdotool getmouselocation --shell)
- mouse_coord_x=$X
- mouse_coord_y=$Y
- xdotool mousemove 60 120 click 1 # click on wizard button
- xdotool mousemove $mouse_coord_x $mouse_coord_y # move the mouse to the origianl position
- # focus wizard window
- window_title="Create new index"
- xdotool search --sync --onlyvisible --name "$window_title" windowactivate
- # setup default index location
- sleep 0.5
- xdotool key Return
- sleep 0.5
- xdotool mousemove 735 427 click 1
- sleep 0.5
- xdotool mousemove 753 700 click 1
- sleep 0.5
- xdotool mousemove 771 704 click 1
- sleep 0.5
- xdotool mousemove 790 801 click 1
- sleep 0.5
- xdotool mousemove 827 885 click 1
- sleep 0.5
- for (( i=1; i <= 7; i++ ))
- do
- xdotool key Return
- sleep 0.5
- done
- window_title="Rebuild index"
- xdotool search --sync --onlyvisible --name "$window_title" windowactivate
- sleep 0.5
- xdotool key Return
- window_title="Index results"
- time_sec=900
- while [ 0 -ne $time_sec ]; do
- echo "$time_sec, waiting... to appear"
- sleep 1
- time_sec=$[$time_sec-1]
- xdotool search --onlyvisible --name "$window_title" windowactivate
- if [ $? == 0 ]; then
- echo "window found"
- break
- fi
- done
- sleep 0.5
- xdotool key Return
- sleep 0.5
- xdotool mousemove 63 77 click 1
- # sleep 5
- # eval $(xdotool getmouselocation --shell)
- # echo $X $Y
- # dependecies:
- # 1. Archivarius 3000 4.79 x32 Portable.7z, copy into 2. folder
- # 2. 7z2200-linux-x86.tar.xz, unpack
- # 3. sudo apt install xdotool wmctrl wine
- # tested on wine-7.0 and GNU bash, version 4.4.20(1)-release (x86_64-pc-linux-gnu)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement