Skip to content

Instantly share code, notes, and snippets.

View localhost's full-sized avatar
👾
Where's the mystery ship?

::1 localhost

👾
Where's the mystery ship?
View GitHub Profile
@localhost
localhost / cw.sh
Created October 17, 2021 11:19
Center and optionally resize a window (X11)
#!/usr/bin/env bash
# uses wmctrl and xdotool
#
# improved upon the solutions listed in
# https://askubuntu.com/questions/104155/center-a-window-via-command-line
if [[ "$1" == "-h" || "$1" == "--help" ]]; then
echo "Usage: $0 \"window name\" [ WxH ]"
exit 0