LoginSignup
2
1

More than 3 years have passed since last update.

ubuntu18.04でapp window透過

Last updated at Posted at 2019-08-28

やりたいこと

アニメ見ながらプログラミングするために透過ウィンドウを実装する方法
僕もアニメが見たかった。

成果物

alias opacity50="sh -c 'xprop -f _NET_WM_WINDOW_OPACITY 32c -set _NET_WM_WINDOW_OPACITY $(printf 0x%x $((0xffffffff * 50 / 100)))'"
alias opacity50all="xprop -root | grep ^_NET_CLIENT_LIST | grep -o '\0x[0-9a-f]\+' | xargs -I {} sh -c 'xprop -f -id {} _NET_WM_WINDOW_OPACITY 32c -set _NET_WM_WINDOW_OPACITY $(printf 0x%x $((0xffffffff * 50 / 100)))'"
alias opacity100="sh -c 'xprop -f _NET_WM_WINDOW_OPACITY 32c -set _NET_WM_WINDOW_OPACITY $(printf 0x%x $((0xffffffff * 100 / 100)))'"
alias opacity100all="xprop -root | grep ^_NET_CLIENT_LIST | grep -o '\0x[0-9a-f]\+' | xargs -I {} sh -c 'xprop -f -id {} _NET_WM_WINDOW_OPACITY 32c -set _NET_WM_WINDOW_OPACITY $(printf 0x%x $((0xffffffff * 100 / 100)))'"

.bashrcに上記のaliasを書いて終わり。
opacity50allを使えば開いてる全てが50で透過される。
opacity100を使えばクリックで選択し、透過度100にできる。
終わり。

一応結果画面
image.png

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1