Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ncwhale/24e177f2b6bc7e3d42df3038fb16aa3e to your computer and use it in GitHub Desktop.
Save ncwhale/24e177f2b6bc7e3d42df3038fb16aa3e to your computer and use it in GitHub Desktop.
# This function will automate grep CMD($1) windows and set OPACITY($2).
transparent_windows() {
for i in $(pgrep -f $1); do
for j in $(/usr/bin/xdotool search --pid $i); do
xprop -id $j -f _NET_WM_WINDOW_OPACITY 32c -set _NET_WM_WINDOW_OPACITY $(printf 0x%x $((0xffffffff * $2 / 100)));
done
done
}
# Give vscode an alias.
alias code='f() { /usr/bin/code $*; sleep 1; transparent_windows /usr/share/code/code 92 }; f'
@ncwhale
Copy link
Author

ncwhale commented May 5, 2019

又拿Shell脚本砍了个奇怪的东西喵……

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment