Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # code dependency section
- function activate_window() {
- # first parameter - window title or part of the window title
- window_title="$1"
- xdotool search --sync --onlyvisible --name "$window_title" windowactivate
- }
- function position_window() {
- # first parameter - window title or part of the window title
- # second parameter - window postion x
- # third parameter - window postion y
- # fourth parameter - window width
- # fifth parameter - window height
- # use xwininfo or xprop to get window infos
- window_title="$1"
- win_pos_x="$2"
- win_pos_y="$3"
- win_width="$4"
- win_height="$5"
- window_handle=$(xdotool search --sync --onlyvisible --name "$window_title")
- xdotool windowactivate --sync "$window_handle"
- xdotool windowmove --sync "$window_handle" $win_pos_x $win_pos_y
- xdotool windowsize --sync "$window_handle" $win_width $win_height
- }
- # starting VM
- vboxmanage startvm tmp3
- # resize and position window
- sleep_time=0.5
- sleep $sleep_time
- activate_window "\[Running\] - Oracle VM VirtualBox"
- sleep $sleep_time
- xdotool key Control_R+p
- sleep $sleep_time
- position_window "\[Paused\] - Oracle VM VirtualBox" 1 60 1816 1016
- sleep $sleep_time
- xdotool key Control_R+p
- sleep $sleep_time
- activate_window "\[Running\] - Oracle VM VirtualBox"
- sleep $sleep_time
- xdotool key Control_R+v
- sleep $sleep_time
- sleep $sleep_time
- xdotool key Control_R+v
- # VBoxManage setextradata global GUI/MaxGuestResolution any
- # VBoxManage setextradata "tmp3" "CustomVideoMode1" "1816x944x32"
- # VBoxManage controlvm "tmp3" setvideomodehint 1816 944 32
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement