Advertisement
Guest User

Untitled

a guest
Aug 9th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.98 KB | None | 0 0
  1. function autoresize_cherrytree_codebox() {
  2.   cherry_tree_id=$(xdotool search --onlyvisible --name "CherryTree 0.38")
  3.   xdotool windowactivate $cherry_tree_id
  4.   sleep 0.1
  5.   xdotool key ctrl+a
  6.   xdotool key ctrl+c
  7.   xdotool key Right
  8.   r_clip=$(xsel -b)
  9.   line_num=$(echo "$r_clip" | wc -l)
  10.   # echo $line_num
  11.   (( line_num_mod=($line_num-5)*8/5 ))
  12.   # echo $line_num_mod
  13.   if [[ $line_num_mod -ge 1 ]]; then
  14.     for (( i=1; i <= $line_num_mod; i++ ))
  15.     do
  16.      xdotool key ctrl+0x2c
  17.     done
  18.   fi
  19.   xdotool key F11
  20.   sleep 0.1
  21.   eval $(xdotool getwindowgeometry --shell $cherry_tree_id)
  22.   cherry_x_dekstop=$X
  23.   cherry_y_desktop=$Y
  24.   cherry_width_desktop=$WIDTH
  25.   cherry_height_desktop=$HEIGHT
  26.   (( cherry_x_mod=$cherry_x_dekstop+$cherry_width_desktop/4 ))
  27.   (( cherry_y_mod=$cherry_height_desktop*7/8 ))
  28.   xdotool mousemove $cherry_x_mod $cherry_y_mod
  29.   xdotool key ctrl+0x2c
  30.   xdotool click --repeat 10 5
  31.   xdotool key F11
  32.   xdotool key ctrl+space
  33.   xdotool key ctrl+End
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement