resize_window.sh 690 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #!/bin/sh
  2. #----------------------------------------------------
  3. # Script to resize browser window to 1280x1024 to
  4. # be able to make size fixed screenshots using
  5. # ALT+Print screen.
  6. #----------------------------------------------------
  7. # Syntax
  8. if [ "x$1" = "x" ]
  9. then
  10. echo "resize_windows.sh (list|0x99999999) [1280 1024]"
  11. fi
  12. # To list all windows
  13. if [ "x$1" = "xlist" ]
  14. then
  15. wmctrl -l
  16. fi
  17. # To resize a specific window
  18. if [ "x$1" != "xlist" -a "x$1" != "x" ]
  19. then
  20. if [ "x$2" = "x" ]
  21. then
  22. width=1280
  23. else
  24. width=$2
  25. fi
  26. if [ "x$3" = "x" ]
  27. then
  28. height=1024
  29. else
  30. height=$3
  31. fi
  32. wmctrl -i -r $1 -e 0,0,0,$width,$height
  33. echo Size of windows $1 modified to $width x $height
  34. fi