我在 Ubuntu 18.04 的 i3wm 中使用 compton 与此配置进行合成:
# _
# ___ ___ _ __ ___ _ __ | |_ ___ _ __
# / __/ _ \| '_ ` _ \| '_ \| __/ _ \| '_ \
# | (__ (_) | | | | | | |_) | |_ (_) | | | |
# \___\___/|_| |_| |_| .__/ \__\___/|_| |_|
# |_|
#################################
#
# Backend
#
#################################
# Backend to use: "xrender" or "glx".
# GLX backend is typically much faster but depends on a sane driver.
backend = "glx";
#################################
#
# GLX backend
#
#################################
glx-no-stencil = true;
# GLX backend: Copy unmodified regions from front buffer instead of redrawing them all.
# My tests with nvidia-drivers show a 10% decrease in performance when the whole screen is modified,
# but a 20% increase when only 1/4 is.
# My tests on nouveau show terrible slowdown.
# Useful with --glx-swap-method, as well.
glx-copy-from-front = false;
# GLX backend: Use MESA_copy_sub_buffer to do partial screen update.
# My tests on nouveau shows a 200% performance boost when only 1/4 of the screen is updated.
# May break VSync and is not available on some drivers.
# Overrides --glx-copy-from-front.
# glx-use-copysubbuffermesa = true;
# GLX backend: Avoid rebinding pixmap on window damage.
# Probably could improve performance on rapid window content changes, but is known to break things on some drivers (LLVMpipe).
# Recommended if it works.
# glx-no-rebind-pixmap = true;
# GLX backend: GLX buffer swap method we assume.
# Could be undefined (0), copy (1), exchange (2), 3-6, or buffer-age (-1).
# undefined is the slowest and the safest, and the default value.
# copy is fastest, but may fail on some drivers,
# 2-6 are gradually slower but safer (6 is still faster than 0).
# Usually, double buffer means 2, triple buffer means 3.
# buffer-age means auto-detect using GLX_EXT_buffer_age, supported by some drivers.
# Useless with --glx-use-copysubbuffermesa.
# Partially breaks --resize-damage.
# Defaults to undefined.
glx-swap-method = "undefined";
#################################
#
# Shadows
#
#################################
# Enabled client-side shadows on windows.
shadow = true;
# Don't draw shadows on DND windows.
no-dnd-shadow = true;
# Avoid drawing shadows on dock/panel windows.
no-dock-shadow = true;
# Zero the part of the shadow's mask behind the window. Fix some weirdness with ARGB windows.
clear-shadow = true;
# The blur radius for shadows. (default 12)
shadow-radius = 5;
# The left offset for shadows. (default -15)
shadow-offset-x = -5;
# The top offset for shadows. (default -15)
shadow-offset-y = -5;
# The translucency for shadows. (default .75)
shadow-opacity = 0.5;
# Set if you want different colour shadows
# shadow-red = 0.0;
# shadow-green = 0.0;
# shadow-blue = 0.0;
# The shadow exclude options are helpful if you have shadows enabled. Due to the way compton draws its shadows, certain applications will have visual glitches
# (most applications are fine, only apps that do weird things with xshapes or argb are affected).
# This list includes all the affected apps I found in my testing. The "! name~=''" part excludes shadows on any "Unknown" windows, this prevents a visual glitch with the XFWM alt tab switcher.
shadow-exclude = [
"! name~=''",
"name = 'Notification'",
"name = 'Plank'",
"name = 'Docky'",
"name = 'Kupfer'",
"name = 'xfce4-notifyd'",
"name *= 'VLC'",
"name *= 'compton'",
"name *= 'Chromium'",
"name *= 'Chrome'",
"name *= 'Firefox'",
"class_g = 'Conky'",
"class_g = 'Kupfer'",
"class_g = 'Synapse'",
"class_g ?= 'Notify-osd'",
"class_g ?= 'Cairo-dock'",
"class_g ?= 'Xfce4-notifyd'",
"class_g ?= 'Xfce4-power-manager'"
];
# Avoid drawing shadow on all shaped windows (see also: --detect-rounded-corners)
shadow-ignore-shaped = false;
#################################
#
# Opacity
#
#################################
menu-opacity = 1;
inactive-opacity = 1;
active-opacity = 1;
frame-opacity = 1;
inactive-opacity-override = false;
alpha-step = 0.06;
# Dim inactive windows. (0.0 - 1.0)
# inactive-dim = 0.2;
# Do not let dimness adjust based on window opacity.
# inactive-dim-fixed = true;
# Blur background of transparent windows. Bad performance with X Render backend. GLX backend is preferred.
# blur-background = true;
# Blur background of opaque windows with transparent frames as well.
# blur-background-frame = true;
# Do not let blur radius adjust based on window opacity.
blur-background-fixed = false;
blur-background-exclude = [
"window_type = 'dock'",
"window_type = 'desktop'"
];
#################################
#
# Fading
#
#################################
# Fade windows during opacity changes.
fading = true;
# The time between steps in a fade in milliseconds. (default 10).
fade-delta = 4;
# Opacity change between steps while fading in. (default 0.028).
fade-in-step = 0.03;
# Opacity change between steps while fading out. (default 0.03).
fade-out-step = 0.03;
# Fade windows in/out when opening/closing
# no-fading-openclose = true;
# Specify a list of conditions of windows that should not be faded.
fade-exclude = [ ];
#################################
#
# Other
#
#################################
# Try to detect WM windows and mark them as active.
mark-wmwin-focused = true;
# Mark all non-WM but override-redirect windows active (e.g. menus).
mark-ovredir-focused = true;
# Use EWMH _NET_WM_ACTIVE_WINDOW to determine which window is focused instead of using FocusIn/Out events.
# Usually more reliable but depends on a EWMH-compliant WM.
use-ewmh-active-win = true;
# Detect rounded corners and treat them as rectangular when --shadow-ignore-shaped is on.
detect-rounded-corners = true;
# Detect _NET_WM_OPACITY on client windows, useful for window managers not passing _NET_WM_OPACITY of client windows to frame windows.
# This prevents opacity being ignored for some apps.
# For example without this enabled my xfce4-notifyd is 100% opacity no matter what.
detect-client-opacity = true;
# Specify refresh rate of the screen.
# If not specified or 0, compton will try detecting this with X RandR extension.
refresh-rate = 0;
# Set VSync method. VSync methods currently available:
# none: No VSync
# drm: VSync with DRM_IOCTL_WAIT_VBLANK. May only work on some drivers.
# opengl: Try to VSync with SGI_video_sync OpenGL extension. Only work on some drivers.
# opengl-oml: Try to VSync with OML_sync_control OpenGL extension. Only work on some drivers.
# opengl-swc: Try to VSync with SGI_swap_control OpenGL extension. Only work on some drivers. Works only with GLX backend. Known to be most effective on many drivers. Does not actually control paint timing, only buffer swap is affected, so it doesn’t have the effect of --sw-opti unlike other methods. Experimental.
# opengl-mswc: Try to VSync with MESA_swap_control OpenGL extension. Basically the same as opengl-swc above, except the extension we use.
# (Note some VSync methods may not be enabled at compile time.)
vsync = "opengl-swc";
# Enable DBE painting mode, intended to use with VSync to (hopefully) eliminate tearing.
# Reported to have no effect, though.
dbe = false;
# Painting on X Composite overlay window. Recommended.
paint-on-overlay = true;
# Limit compton to repaint at most once every 1 / refresh_rate second to boost performance.
# This should not be used with --vsync drm/opengl/opengl-oml as they essentially does --sw-opti's job already,
# unless you wish to specify a lower refresh rate than the actual value.
sw-opti = false;
# Unredirect all windows if a full-screen opaque window is detected, to maximize performance for full-screen windows, like games.
# Known to cause flickering when redirecting/unredirecting windows.
# paint-on-overlay may make the flickering less obvious.
unredir-if-possible = true;
# Specify a list of conditions of windows that should always be considered focused.
focus-exclude = [ ];
# Use WM_TRANSIENT_FOR to group windows, and consider windows in the same group focused at the same time.
detect-transient = true;
# Use WM_CLIENT_LEADER to group windows, and consider windows in the same group focused at the same time.
# WM_TRANSIENT_FOR has higher priority if --detect-transient is enabled, too.
detect-client-leader = true;
#################################
#
# Window type settings
#
#################################
wintypes:
{
tooltip =
{
# fade: Fade the particular type of windows.
fade = true;
# shadow: Give those windows shadow
shadow = false;
# opacity: Default opacity for the type of windows.
opacity = 0.85;
# focus: Whether to always consider windows of this type focused.
focus = true;
};
};
我的 i3 配置确实没有什么特别的,只有一些键绑定:
# _ _____ __ _
# (_)___ / ___ ___ _ __ / _(_) __ _
# | | |_ \ / __/ _ \| '_ \| |_| |/ _` |
# | |___) | (__ (_) | | | | _| | (_| |
# |_|____/ \___\___/|_| |_|_| |_|\__, |
# |___/
# set color variables
set $indicator #a4a8ad
set $bg-color #2f343f
set $active-bg-color #545c6d
set $urgent-bg-color #E53935
set $focused-ws-color #b8babc
set $inactive-ws-color #2f343f
set $text-color #b8babc
# -- general settings ----------------------------------------------------------
set $mod Mod4
floating_modifier $mod
font pango:Hack 9
focus_follows_mouse no
#gaps outer 10
#gaps inner 8
# -- key bindings --------------------------------------------------------------
# frequently used
bindsym $mod+Return exec --no-startup-id xfce4-terminal
bindsym $mod+d exec --no-startup-id dmenu_run -b
bindsym $mod+q kill
bindsym $mod+p exec --no-startup-id sh ~/projects/dotFiles/lock.sh
# system commands
bindsym $mod+Shift+c reload
bindsym $mod+Shift+r restart
bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'"
# splitting
bindsym $mod+v split h
bindsym $mod+b split v
# layouts
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split
bindsym $mod+f fullscreen toggle
bindsym $mod+Shift+space floating toggle
bindsym $mod+space focus mode_toggle
# focus
bindsym $mod+a focus parent
bindsym $mod+h focus left
bindsym $mod+j focus down
bindsym $mod+k focus up
bindsym $mod+l focus right
# moving windows
bindsym $mod+Shift+h move left
bindsym $mod+Shift+j move down
bindsym $mod+Shift+k move up
bindsym $mod+Shift+l move right
# set workspace variables
set $workspace1 "1"
set $workspace2 "2"
set $workspace3 "3"
set $workspace4 "4"
set $workspace5 "5"
set $workspace6 "6"
set $workspace7 "7"
set $workspace8 "8"
set $workspace9 "9"
set $workspace10 ""
# switch to workspace
bindsym $mod+1 workspace $workspace1
bindsym $mod+2 workspace $workspace2
bindsym $mod+3 workspace $workspace3
bindsym $mod+4 workspace $workspace4
bindsym $mod+5 workspace $workspace5
bindsym $mod+6 workspace $workspace6
bindsym $mod+7 workspace $workspace7
bindsym $mod+8 workspace $workspace8
bindsym $mod+9 workspace $workspace9
bindsym $mod+0 workspace $workspace10
# move focused container to workspace
bindsym $mod+Shift+1 move container to workspace $workspace1
bindsym $mod+Shift+2 move container to workspace $workspace2
bindsym $mod+Shift+3 move container to workspace $workspace3
bindsym $mod+Shift+4 move container to workspace $workspace4
bindsym $mod+Shift+5 move container to workspace $workspace5
bindsym $mod+Shift+6 move container to workspace $workspace6
bindsym $mod+Shift+7 move container to workspace $workspace7
bindsym $mod+Shift+8 move container to workspace $workspace8
bindsym $mod+Shift+9 move container to workspace $workspace9
bindsym $mod+Shift+0 move container to workspace $workspace10
# resize window (you can also use the mouse for that)
bindsym $mod+r mode "resize"
mode "resize" {
# These bindings trigger as soon as you enter the resize mode
bindsym h resize shrink width 10 px or 10 ppt
bindsym j resize grow height 10 px or 10 ppt
bindsym k resize shrink height 10 px or 10 ppt
bindsym l resize grow width 10 px or 10 ppt
# back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
}
# -- window colors -------------------------------------------------------------
# border background text indicator
client.focused $active-bg-color $active-bg-color $text-color $indicator
client.unfocused $bg-color $bg-color $text-color $indicator
client.focused_inactive $bg-color $bg-color $text-color $indicator
client.urgent $urgent-bg-color $urgent-bg-color $text-color $indicator
bar {
Position top
font pango:Hack 9
status_command i3blocks -c $HOME/.config/i3/i3blocks.conf
colors {
background $bg-color
separator #757575
# border background text
focused_workspace $bg-color $focused-ws-color $bg-color
inactive_workspace $bg-color $inactive-ws-color $text-color
urgent_workspace $bg-color $urgent-bg-color $text-color
}
}
# -- startup programs ----------------------------------------------------------
exec_always --no-startup-id feh --bg-scale $HOME/.local/share/backgrounds/batman_bat.png
exec --no-startup-id compton --config $HOME/.config/compton.conf
exec --no-startup-id nm-applet
exec --no-startup-id xinput set-prop 'DELL0767:00 06CB:7E92 Touchpad' 'libinput Tapping Enabled' 1
exec --no-startup-id xinput set-prop 'DELL0767:00 06CB:7E92 Touchpad' 'libinput Natural Scrolling Enabled' 1
new_window pixel 1
#default_border pixel 1
#default_floating_border normal
# Pulse Audio controls
# For pulseaudio
#bindsym XF86AudioRaiseVolume exec --no-startup-id pactl -- set-sink-volume 0 +5% #increase sound volume
#bindsym XF86AudioLowerVolume exec --no-startup-id pactl -- set-sink-volume 0 -5% #decrease sound volume
#bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute 0 toggle # mute sound
# For ALSA
bindsym XF86AudioRaiseVolume exec --no-startup-id "amixer -q sset Master,0 1+ unmute"
bindsym XF86AudioLowerVolume exec --no-startup-id "amixer -q sset Master,0 1- unmute"
bindsym XF86AudioMute exec --no-startup-id "amixer -q sset Headphone,0 toggle"
# Sreen brightness controls
bindsym XF86MonBrightnessUp exec xbacklight -inc 5 # increase screen brightness
bindsym XF86MonBrightnessDown exec xbacklight -dec 5 # decrease screen brightness
# Media player controls
bindsym XF86AudioPlay exec --no-startup-id playerctl play
bindsym XF86AudioPause exec --no-startup-id playerctl pause
bindsym XF86AudioNext exec --no-startup-id playerctl next
bindsym XF86AudioPrev exec --no-startup-id playerctl previous
由于某种原因,一定是由上述配置中的某些内容引起的,当窗口全屏显示时,屏幕会随机冻结,但计算机工作正常:声音仍然有效,键绑定有效,我可以使用键绑定注销等。这种情况是随机发生的,即并非每次窗口全屏时都会发生,但它主要发生在 chromium 浏览器和 mpv 上,主要是在播放视频时(不是 YouTube)。
我怎样才能摆脱这个问题?
答案1
这似乎是一个康普顿问题,据我所知没有解决方案。我建议您阅读并参与在这个 Github 线程中(它似乎是最活跃的)。这个错误很难重现,我们需要尽可能多的信息(配置文件、日志、设置等)。
更新:2018-09-21
嗯,看来水 已修复这个问题,至少对于大多数人来说。注意yshui不是最初的开发者,chjj的compton似乎被放弃了,但是他/她保留了一个仅修复错误的分支。
分支是yshui/康普顿#damated,请安装它(需要编译)并报告它是否为您解决了问题以及上述线程中任何可能的缺点。