Guest User

Untitled

a guest
Feb 18th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz && wmctrl -r :ACTIVE: -e 0,0,0,800,1040
  2.  
  3. #!/bin/bash
  4. # resizes the window to full height and 50% width and moves into upper right corner
  5.  
  6. #define the height in px of the top system-bar:
  7. TOPMARGIN=27
  8.  
  9. #sum in px of all horizontal borders:
  10. RIGHTMARGIN=10
  11.  
  12. # get width of screen and height of screen
  13. SCREEN_WIDTH=$(xwininfo -root | awk '$1=="Width:" {print $2}')
  14. SCREEN_HEIGHT=$(xwininfo -root | awk '$1=="Height:" {print $2}')
  15.  
  16. # new width and height
  17. W=$(( $SCREEN_WIDTH / 2 - $RIGHTMARGIN ))
  18. H=$(( $SCREEN_HEIGHT - 2 * $TOPMARGIN ))
  19.  
  20. # X, change to move left or right:
  21.  
  22. # moving to the right half of the screen:
  23. X=$(( $SCREEN_WIDTH / 2 ))
  24. # moving to the left:
  25. #X=0;
  26.  
  27. Y=$TOPMARGIN
  28.  
  29. wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz && wmctrl -r :ACTIVE: -e 0,$X,$Y,$W,$H
Add Comment
Please, Sign In to add comment