Skip to content

Instantly share code, notes, and snippets.

@adonig
Created December 14, 2017 23:46
Show Gist options
  • Save adonig/815013b1ba49c8eb60c723d81a588b7d to your computer and use it in GitHub Desktop.
Save adonig/815013b1ba49c8eb60c723d81a588b7d to your computer and use it in GitHub Desktop.
Start Microsoft Visual Studio Code maximised on Linux. Workaround for https://github.com/Microsoft/vscode/issues/422.
#!/bin/bash
code
while true; do
WINDOW_ID=$(xprop -root _NET_ACTIVE_WINDOW | cut -d ' ' -f 5 | cut -c 1-9)
WINDOW_CLASS=$(xprop -id $WINDOW_ID WM_CLASS | sed 's/.*= "\([^"]*\)".*/\1/')
if [ "${WINDOW_CLASS,,}" = "code" ]; then
break
fi
done
wmctrl -r :ACTIVE: -b toggle,maximized_vert,maximized_horz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment