Advertisement
Guest User

archivarius linux

a guest
Aug 20th, 2022
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.83 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. # focous wizard window
  42. window_title="Create new index"
  43. xdotool search --sync --onlyvisible --name "$window_title" windowactivate
  44.  
  45. # dependecies:
  46.     # 1. Archivarius 3000 4.79 x32 Portable.7z, copy into 2. folder
  47.     # 2. 7z2200-linux-x86.tar.xz, unpack
  48.     # 3. sudo apt install xdotool wmctrl wine
  49.     # 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