Advertisement
Guest User

index and search engine

a guest
Feb 24th, 2023
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 3.00 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 type "my"
  49. sleep 0.5
  50. xdotool key Right
  51. sleep 0.5
  52. xdotool type "z"
  53. sleep 0.5
  54. xdotool key Right
  55. sleep 0.5
  56. xdotool type "media"
  57. sleep 0.5
  58. xdotool key Right
  59. sleep 0.5
  60. xdotool type "ramdisk"
  61. sleep 0.5
  62. xdotool key Right
  63. sleep 0.5
  64. xdotool type "recordings"
  65. sleep 0.5
  66. xdotool key space
  67. sleep 0.5
  68. for (( i=1; i <= 7; i++ ))
  69. do
  70.     xdotool key Return
  71.     sleep 0.5
  72. done
  73. window_title="Rebuild index"
  74. xdotool search --sync --onlyvisible --name "$window_title" windowactivate
  75. sleep 0.5
  76. xdotool key Return
  77. window_title="Index results"
  78. time_sec=900
  79. while [ 0 -ne $time_sec ]; do
  80.     echo "$time_sec, waiting... to appear"
  81.     sleep 1
  82.     time_sec=$[$time_sec-1]
  83.     xdotool search --onlyvisible --name "$window_title" windowactivate
  84.     if [ $? == 0 ]; then
  85.       echo "window found"
  86.       break
  87.     fi
  88. done
  89. sleep 0.5
  90. xdotool key Return
  91. sleep 0.5
  92. xdotool mousemove 63 77 click 1
  93.  
  94. # sleep 5
  95. # eval $(xdotool getmouselocation --shell)
  96. # echo $X $Y
  97.  
  98. # dependecies:
  99.     # 1. Archivarius 3000 4.79 x32 Portable.7z, copy into 2. folder
  100.     # 2. 7z2200-linux-x86.tar.xz, unpack
  101.     # 3. sudo apt install xdotool wmctrl wine
  102.     # 4. /media/ramdisk/recordings - default index folder location
  103.     # 5. after copying files to default index folder location, indexing will be done automatically
  104.     # tested on wine-8.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