Skip to content

Instantly share code, notes, and snippets.

@Happy-Ferret
Forked from Airblader/make_dock.sh
Created June 25, 2018 08:27
Show Gist options
  • Save Happy-Ferret/55677f209614cb6fd8ec96701488110e to your computer and use it in GitHub Desktop.
Save Happy-Ferret/55677f209614cb6fd8ec96701488110e 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