Skip to content

Instantly share code, notes, and snippets.

@marcel-dempers
Created September 22, 2019 09:49
Show Gist options
  • Save marcel-dempers/5b5f687b66032f1a20c9c249fb3bdae3 to your computer and use it in GitHub Desktop.
Save marcel-dempers/5b5f687b66032f1a20c9c249fb3bdae3 to your computer and use it in GitHub Desktop.
How to make VSCode transparent in Linux
#!/bin/bash
sudo apt-get install -y devilspie
mkdir -p ~/.devilspie
echo '
(if (contains (window_class) "Code")
(begin
(spawn_async (str "xprop -id " (window_xid) " -f _KDE_NET_WM_BLUR_BEHIND_REGION 32c -set _KDE_NET_WM_BLUR_BEHIND_REGION 0 "))
(spawn_async (str "xprop -id " (window_xid) " -f _NET_WM_WINDOW_OPACITY 32c -set _NET_WM_WINDOW_OPACITY 0xD8000000"))
)
)
' > ~/.devilspie/vscode_transparent.ds
#https://www.binaryhexconverter.com/decimal-to-hex-converter
# percentage * 255 / 100 , then take number and put in url above
# take 2 chars and add then after 0x
@hrithikwins
Copy link

hrithikwins commented Apr 30, 2021

Thanks a lot @marcel-dempers
I tried this thing and it really worked out..
I will be always thankful to you for this script

@khudadat
Copy link

thanks

@websorz
Copy link

websorz commented Nov 6, 2021

Hello Marcel, thank you for the script! I am new to Linux and have a problem using devilspie, when I save your script in .devilspie/ and try to enter devilspie in the terminal, the terminal halts and doesn't output anything. Nor does vscode become transparent when i start it up.

Any idea what the problem might be?

@rammmpr
Copy link

rammmpr commented Nov 13, 2022

thanks broo it's work

@satanicllamaplaza
Copy link

Hello Marcel, thank you for the script! I am new to Linux and have a problem using devilspie, when I save your script in .devilspie/ and try to enter devilspie in the terminal, the terminal halts and doesn't output anything. Nor does vscode become transparent when i start it up.

Any idea what the problem might be?

my guess is its running as a daemon. just means it will run until told by you or other software to stop.

you can hit ( ctr + c ) and get your command line back and the effects of the script will be functional. I will read more on devilspie to understand its functionality more and i suggest doing the same.

@Manvithmrithvi
Copy link

it showing Not an X11 Display
what to do??

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