Last active
December 13, 2022 13:59
-
-
Save jstaursky/29ae4f1f24cb9976839dd99721e54165 to your computer and use it in GitHub Desktop.
bash/zsh scripts to resize and move window apps.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env zsh | |
# get size and position of window - terminal command: xwininfo | |
screen_width=3440 | |
screen_height=1411 | |
widthOneThird=$((screen_width/3)) | |
# ### window position ### | |
# ______+x | |
# | | |
# | | |
# y+ | |
top_window_edge=24 | |
left_window_edge=$((0 * ${widthOneThird})) | |
# window position = Absolute upper-left X, Absolute upper-left Y | |
xdotool windowmove $(xdotool getwindowfocus) ${left_window_edge} ${top_window_edge} | |
# ### window size ### | |
# Need to take into account system menu bar | |
height=$((${screen_height} - ${top_window_edge})) | |
xdotool windowsize $(xdotool getwindowfocus) ${widthOneThird} ${height} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env zsh | |
# get size and position of window - terminal command: xwininfo | |
screen_width=3440 | |
screen_height=1411 | |
widthOneThird=$((screen_width/3)) | |
# ### window position ### | |
# ______+x | |
# | | |
# | | |
# y+ | |
top_window_edge=24 | |
left_window_edge=$((1 * ${widthOneThird})) | |
# window position = Absolute upper-left X, Absolute upper-left Y | |
xdotool windowmove $(xdotool getwindowfocus) ${left_window_edge} ${top_window_edge} | |
# ### window size ### | |
# Need to take into account system menu bar | |
height=$((${screen_height} - ${top_window_edge})) | |
xdotool windowsize $(xdotool getwindowfocus) ${widthOneThird} ${height} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env zsh | |
# get size and position of window - terminal command: xwininfo | |
screen_width=3440 | |
screen_height=1411 | |
widthOneThird=$((screen_width/3)) | |
# ### window position ### | |
# ______+x | |
# | | |
# | | |
# y+ | |
top_window_edge=24 | |
left_window_edge=$((2 * ${widthOneThird})) | |
# window position = Absolute upper-left X, Absolute upper-left Y | |
xdotool windowmove $(xdotool getwindowfocus) ${left_window_edge} ${top_window_edge} | |
# ### window size ### | |
# Need to take into account system menu bar | |
height=$((${screen_height} - ${top_window_edge})) | |
xdotool windowsize $(xdotool getwindowfocus) ${widthOneThird} ${height} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env zsh | |
#!/usr/bin/env zsh | |
# get size and position of window - terminal command: xwininfo | |
screen_width=3440 | |
screen_height=1411 | |
windowWidth=$((screen_width/2)) | |
# ### window position ### | |
# ______+x | |
# | | |
# | | |
# y+ | |
top_window_edge=24 | |
left_window_edge=$((screen_width/4)) | |
# window position = Absolute upper-left X, Absolute upper-left Y | |
xdotool windowmove $(xdotool getwindowfocus) ${left_window_edge} ${top_window_edge} | |
# ### window size ### | |
# Need to take into account system menu bar | |
height=$((${screen_height} - ${top_window_edge})) | |
xdotool windowsize $(xdotool getwindowfocus) ${windowWidth} ${height} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment