Skip to content

Instantly share code, notes, and snippets.

@Airblader
Created May 9, 2017 09:44
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Airblader/d4fe0088b05f720fb4a3291cd9ec5e9a to your computer and use it in GitHub Desktop.
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)
#!/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