Created
January 5, 2015 12:41
-
-
Save benkaiser/0da0a966b3d40cea5d09 to your computer and use it in GitHub Desktop.
shift a window to the side when focused. Good for keeping floating chat windows to the side of the screen in i3 (tiling window manager)
This file contains hidden or 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
| #!/bin/bash | |
| name="Emily Brinsmead" | |
| windowname=$(xdotool getactivewindow getwindowname) | |
| width=$(xdotool search --name "Emily Brinsmead" getwindowgeometry --shell | grep "WIDTH=" | tr -cd "[:digit:]")-40; | |
| #echo $windowname; | |
| if [ "$windowname" == "$name" ] | |
| then | |
| echo "focus" | |
| xdotool search --name "$name" windowmove --relative -- $((36-$width)) 'y' | |
| else | |
| echo "unfocus" | |
| xdotool search --name "$name" windowmove --relative +$width 'y' | |
| fi |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I use it with this command:
The window I am targeting has the text "Emily Brinsmead", change yours accordingly.