Compton是一个轻量级的窗口合成器,主要用于提高图形性能、降低CPU占用率和改善系统界面效果。以下是一些Compton的使用技巧和配置方法:
安装Compton:
sudo apt-get install compton
sudo pacman -S compton
检查Compton状态:
ps -e | grep compton
启动Compton:
compton &
停止Compton:
killall compton
配置文件位置:
~/.config/compton.conf
或/etc/xdg/compton.conf
。常见配置选项:
xrender
和glx
。true
(开启)或false
(关闭)。true
(开启)或false
(关闭)。true
以忽略根窗口的透明度。以下是一个高级配置示例,展示了如何启用阴影、模糊效果以及设置透明度规则:
shadow {
true;
no-dnd-shadow true;
no-dock-shadow true;
clear-shadow true;
detect-rounded-corners true;
shadow-radius 5;
shadow-offset-x 1;
shadow-offset-y 1;
shadow-opacity 0.3;
shadow-ignore-shaped false;
}
exclude {
"name 'Notification'",
"class_g ? 'Dmenu'",
"class_g ? 'Dunst'",
"_NET_WM_STATE@:32a * '_NET_WM_STATE_HIDDEN'",
"_GTK_FRAME_EXTENTS@:c",
"_NET_WM_STATE@:32a * '_NET_WM_STATE_STICKY'",
"class_g ? 'i3-frame'"
}
blur {
method "gaussian";
size 10;
deviation 5.0;
}
opacity-rule {
95:name *? 'Code'",
90:class_g 'Code - Insiders'",
66:name *? 'I3bar"',
95:name *? 'Chrome"',
99:name *? 'Call"',
99:class_g 'Chromium"',
99:name *? 'Conky"',
99:class_g 'Darktable"',
50:class_g 'Dmenu"',
99:name *? 'Event"',
99:class_g 'Firefox"',
99:class_g 'GIMP"',
99:name *? 'Image"',
99:class_g 'Lazpaint"',
99:class_g 'Midori"',
99:name *? 'Minitube"',
99:name *? 'Mousepad"',
99:class_g 'MuseScore"',
90:name *? 'Page Info"',
99:name *? 'Pale Moon"',
90:name *? 'Panel"',
99:class_g 'Pinta"',
90:name *? 'Restart"',
99:name *? 'sudo"',
99:name *? 'Screenshot"',
99:class_g 'Viewnior"',
99:class_g 'VirtualBox"',
99:name *? 'VLC"',
99:name *? 'Write"',
93:class_g 'URxvt' && !_NET_WM_STATE@:32a',
0:_NET_WM_STATE@:32a * '_NET_WM_STATE_HIDDEN"',
96:_NET_WM_STATE@:32a * '_NET_WM_STATE_STICKY'"
}
通过以上配置和技巧,你可以根据个人需求优化Compton的使用体验。