在Ubuntu下实现Compton透明度效果,可按以下步骤操作:
sudo apt update
和sudo apt install compton
。mkdir -p ~/.config
和touch ~/.config/compton.conf
创建配置文件,然后用文本编辑器打开,添加以下内容: backend = "glx";
:设置后端为glx,性能通常更好。alpha = 0.5;
:设置整体透明度,范围0到1,0为完全不透明,1为完全透明。opacity-rule
:可设置不同窗口的透明度规则,如opacity-rule = ["CLASS = 'Firefox', opacity = 0.8;", "CLASS = 'GIMP', opacity = 0.7;"];
,分别将Firefox和GIMP窗口透明度设为80%和70%。shadow-exclude
、frame-rate
等可根据需要调整。compton --config ~/.config/compton.conf
手动启动,或将其添加到启动应用程序中实现开机自启。