Linux Compton 快捷键设置指南
核心原则
i3 与 Sway 的设置方法
# 切换为 50% 不透明度(示例键位:Alt+Shift+T)
bindsym $mod+Shift+t exec --no-startup-id compton --config ~/.config/compton.conf --backend glx --alpha-threshold 1 --opacity 0.5
# 停止/启动 Compton(示例键位:Alt+Shift+K / Alt+Shift+C)
bindsym $mod+Shift+k exec --no-startup-id killall compton
bindsym $mod+Shift+c exec --no-startup-id compton --config ~/.config/compton.conf
说明:将 $mod 替换为你的修饰键(如 Mod1=Alt、Mod4=Super),必要时显式指定 –config 路径;保存后执行 i3-msg reload(i3)或重载 Sway 配置使其生效。Awesome WM 的设置方法
-- 启动/切换 Compton(示例键位:Alt+T)
awful.key({ "Mod1" }, "t", function ()
awful.spawn("compton --config ~/.config/compton.conf")
end, {description = "toggle compton", group = "launcher"}),
说明:可按需扩展为停止、重启或传参切换特效,然后重启 Awesome(如 mod+ctrl+r)使配置生效。通用桌面环境与工具
实用建议与排错
systemctl --user restart compton 重启;若用 i3/Sway,热键触发的 exec 会临时覆盖服务状态,注意按键逻辑的一致性。