Created
May 9, 2017 09:44
-
-
Save Airblader/d4fe0088b05f720fb4a3291cd9ec5e9a to your computer and use it in GitHub Desktop.
Turn any window into a dock for i3 (caution, dock windows do not take focus ever)
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 bash | |
# call like this: | |
# /path/to/this/script.sh <window_id> <dock height> | |
win="${1:-}" | |
height="${2:-}" | |
width=$(xrandr -q | head -n1 | awk '{print $8}') | |
xdotool windowunmap --sync ${win} | |
xdotool windowsize --sync ${win} ${width} ${height} | |
xprop -id "${win}" -format _NET_WM_WINDOW_TYPE 32a -set _NET_WM_WINDOW_TYPE "_NET_WM_WINDOW_TYPE_DOCK" | |
xprop -id "${win}" -format _NET_WM_STRUT_PARTIAL 32cccccccccccc -set _NET_WM_STRUT_PARTIAL "0,0,${height},0,0,0,0,0,0,${width},0,0" | |
xdotool windowmap ${win} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment