Advertisement
Guest User

archivarius auto index folder

a guest
Sep 16th, 2022
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.76 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. out_loc=$(echo "/media/ramdisk/archivarius")
  4. if [ -d "$out_loc" ]; then  # check for directory existence
  5.     rm -rf "$out_loc"   # delete folder tree
  6. fi
  7. ./7zz x "Archivarius 3000 4.79 x32 Portable.7z" -o/media/ramdisk    # unpack 7z archive
  8. mv "/media/ramdisk/Archivarius 3000 4.79 x32 Portable" "$out_loc"   # rename the out_loc
  9. cd "$out_loc"
  10. nohup $(wine ArchivariusPort.exe) &>/dev/null & # run archivarius
  11. # wait for window
  12. window_title="Create new index"
  13. time_sec=900
  14. while [ 0 -ne $time_sec ]; do
  15.     echo "$time_sec, waiting... to appear"
  16.     sleep 1
  17.     time_sec=$[$time_sec-1]
  18.     xdotool search --onlyvisible --name "$window_title" windowactivate
  19.     if [ $? == 0 ]; then
  20.       echo "window found"
  21.       break
  22.     fi
  23. done
  24. # setup window position and size
  25. xdotool key Escape # close current wizard window
  26. sleep 0.5
  27. window_title="Search system for home and office"
  28. window_handle=$(xdotool search --sync --onlyvisible --name "$window_title")
  29. echo window_id = $window_handle
  30. wmctrl -ir $window_handle -b remove,maximized_vert,maximized_horz # unmaximize window
  31. xdotool windowmove --sync "$window_handle" 0 60
  32. xdotool windowsize --sync "$window_handle" 1816 1016
  33. # rerun index wizard
  34. xdotool windowactivate $window_handle
  35. # get current mouse coords
  36. eval $(xdotool getmouselocation --shell)
  37. mouse_coord_x=$X
  38. mouse_coord_y=$Y
  39. xdotool mousemove 60 120 click 1 # click on wizard button
  40. xdotool mousemove $mouse_coord_x $mouse_coord_y # move the mouse to the origianl position
  41. # focus wizard window
  42. window_title="Create new index"
  43. xdotool search --sync --onlyvisible --name "$window_title" windowactivate
  44. # setup default index location
  45. sleep 0.5
  46. xdotool key Return
  47. sleep 0.5
  48. xdotool mousemove 735 427 click 1
  49. sleep 0.5
  50. xdotool mousemove 753 700 click 1
  51. sleep 0.5
  52. xdotool mousemove 771 704 click 1
  53. sleep 0.5
  54. xdotool mousemove 790 801 click 1
  55. sleep 0.5
  56. xdotool mousemove 827 885 click 1
  57. sleep 0.5
  58. for (( i=1; i <= 7; i++ ))
  59. do
  60.     xdotool key Return
  61.     sleep 0.5
  62. done
  63. window_title="Rebuild index"
  64. xdotool search --sync --onlyvisible --name "$window_title" windowactivate
  65. sleep 0.5
  66. xdotool key Return
  67. window_title="Index results"
  68. time_sec=900
  69. while [ 0 -ne $time_sec ]; do
  70.     echo "$time_sec, waiting... to appear"
  71.     sleep 1
  72.     time_sec=$[$time_sec-1]
  73.     xdotool search --onlyvisible --name "$window_title" windowactivate
  74.     if [ $? == 0 ]; then
  75.       echo "window found"
  76.       break
  77.     fi
  78. done
  79. sleep 0.5
  80. xdotool key Return
  81. sleep 0.5
  82. xdotool mousemove 63 77 click 1
  83.  
  84. # sleep 5
  85. # eval $(xdotool getmouselocation --shell)
  86. # echo $X $Y
  87.  
  88. # dependecies:
  89.     # 1. Archivarius 3000 4.79 x32 Portable.7z, copy into 2. folder
  90.     # 2. 7z2200-linux-x86.tar.xz, unpack
  91.     # 3. sudo apt install xdotool wmctrl wine
  92.     # 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