Created
May 5, 2019 03:57
-
-
Save ncwhale/24e177f2b6bc7e3d42df3038fb16aa3e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
又拿Shell脚本砍了个奇怪的东西喵……