##PICOM CONFIG###

#========================= Corners =========================#

corner-radius = 10;
rounded-corners-exclude = [
#   "window_type = 'normal'",
#   "class_g ?= 'rofi'",
    "class_g ?= 'polybar'",
    "class_g ?= 'polybar'",
    "class_g ?= 'eww-bar'",
    "class_g ?= 'Dunst'",
    "class_g = 'dwmsystray'",
    "class_g ?= 'firefox'",
    "class_g ?= 'Vivaldi-stable'",
    "class_g ?= 'LibreWolf'",
    "class_g ?= 'qutebrowser'",
    "class_g ?= 'ncmpcpp'",
    "class_g = 'dwm'",
    "class_g ?= 'tint2'"
];

round-borders = 10;
round-borders-exclude = [
    "class_g = 'TelegramDesktop'"
    "class_g = 'slock'",
    "class_g = 'Dunst'"
];

# Specify a list of border width rules, in the format `PIXELS:PATTERN`, 
# Note we don't make any guarantee about possible conflicts with the
# border_width set by the window manager.
#
# example:
#    round-borders-rule = [ "2:class_g = 'URxvt'" ];
#
round-borders-rule = [
    "2:class_g ?= 'URxvt'",
    "2:class_g ?= 'Alacritty'",
    "2:class_g ?= 'St'",
    "0:class_g ?= 'Subl'",
    "0:class_g ?= 'firefox'"
];

#========================= Shadows =========================#

# Enabled client-side shadows on windows. Note desktop windows
# (windows with '_NET_WM_WINDOW_TYPE_DESKTOP') never get shadow,
# unless explicitly requested using the wintypes option.
#
shadow = true;

# The blur radius for shadows, in pixels. (defaults to 12)
shadow-radius = 16;
#14
# The opacity of shadows. (0.0 - 1.0, defaults to 0.75)
shadow-opacity = 1.0;

# The left offset for shadows, in pixels. (defaults to -15)
shadow-offset-x = -16;
#-12
# The top offset for shadows, in pixels. (defaults to -15)
shadow-offset-y = -16;
#-12
# Red color value of shadow (0.0 - 1.0, defaults to 0).
# shadow-red = 0

# Green color value of shadow (0.0 - 1.0, defaults to 0).
# shadow-green = 0

# Blue color value of shadow (0.0 - 1.0, defaults to 0).
# shadow-blue = 0

# Hex string color value of shadow (#000000 - #FFFFFF, defaults to #000000). This option will override options set shadow-(red/green/blue)
#shadow-color = "#363636"

# Specify a list of conditions of windows that should have no shadow.
#
# examples:
#   shadow-exclude = "n:e:Notification";
#
# shadow-exclude = []
shadow-exclude = [
    "! name~=''",
    "_GTK_FRAME_EXTENTS@:c",
    "_NET_WM_STATE@:32a *= '_NET_WM_STATE_MAXIMIZED'",
    "_NET_WM_STATE@:32a *= '_NET_WM_STATE_FULLSCREEN'",
    "class_g = 'Conky'",
    "class_g *?= 'firefox'",
    "class_g *?= 'firefox-nightly'",
    "class_g ?= 'LibreWolf'",
    "class_g = 'dwmsystray'",
    "class_g = 'Vivaldi-stable'",
    "class_g = 'slock'",
    "class_g = 'slock'",
    "class_g = 'dwm'",
    "_NET_WM_WINDOW_TYPE@:32a *= '_NET_WM_WINDOW_TYPE_DOCK'",
];

# Specify a X geometry that describes the region in which shadow should not
# be painted in, such as a dock window region. Use
#    shadow-exclude-reg = "x10+0+0"
# for example, if the 10 pixels on the bottom of the screen should not have shadows painted on.
#
# shadow-exclude-reg = ""

# Crop shadow of a window fully on a particular Xinerama screen to the screen.
# xinerama-shadow-crop = false

animations=true
animation-for-open-window = "zoom"

#========================= Fading =========================#

# fading = false
fading = true;

## Opacity change between steps while fading in.

# fade-in-step = 0.028
fade-in-step = 0.03;

## Opacity change between steps while fading out.

# fade-out-step = 0.03
fade-out-step = 0.03;

#========================= Opacity =========================#

# Opacity of inactive windows. (0.1 - 1.0, defaults to 1.0)
# inactive-opacity = 1
inactive-opacity = 1;

# Opacity of window titlebars and borders. (0.1 - 1.0, disabled by default)
# frame-opacity = 1.0
frame-opacity = 1.0;

# Let inactive opacity set by -i override the '_NET_WM_OPACITY' values of windows.
# inactive-opacity-override = true
inactive-opacity-override = false;

# Default opacity for active windows. (0.0 - 1.0, defaults to 1.0)
active-opacity = 1;

# Dim inactive windows. (0.0 - 1.0, defaults to 0.0)
#inactive-dim = 0.1

# Specify a list of conditions of windows that should always be considered focused.
# focus-exclude = []
focus-exclude = [
  "class_g = 'Cairo-clock'",
  "class_g = 'dwmsystray'",
  "class_g = 'slock'",
  "class_g = 'Slock'",
  "class_g = 'Polybar'",
  "class_g = 'dwm'",
  "class_g = 'Bar'",                    # lemonbar
  "class_g = 'slop'"                    # maim
];

# Use fixed inactive dim value, instead of adjusting according to window opacity.
# inactive-dim-fixed = 1.0

# Specify a list of opacity rules, in the format `PERCENT:PATTERN`,
# like `50:name *= "firefox"`. picom-trans is recommended over this.
# Note we don't make any guarantee about possible conflicts with other
# programs that set '_NET_WM_WINDOW_OPACITY' on frame or client windows.
# example:
#    opacity-rule = [ "80:class_g = 'URxvt'" ];
#
# opacity-rule = []
opacity-rule = [
  "100:class_g    = 'Bar'",            # lemonbar
  "100:class_g    = 'slop'",           # maim
  "100:class_g    = 'XTerm'",
  "100:class_g    = 'ncmpcpp'",
  "100:class_g    = 'URxvt'",
  "100:class_g    = 'slock'",

  "90:class_g     = 'kitty' && focused",
  "80:class_g     = 'kitty' && !focused",
  "90:class_g     = 'Alacritty'",
  "95:class_g     = 'St'",
  "90:class_g	  = 'Dunst'",
  "100:class_g    = 'Polybar'",
  "100:class_g    = 'firefox'",
  "100:class_g    = 'LibreWolf'",
  "100:class_g	  = 'Vivaldi-stable'",
  "100:class_g    = 'dwmsystray'",
  "100:class_g    = 'dwm'",
  "100:class_g    = 'Thunderbird'",
  "100:class_g    = 'Thunar'"
];

#========================= Blurring =========================#

blur: {
  method = "dual_kawase";
  strength = 10;
  background = false;
  background-frame = false;
  background-fixed = false;
  kern = "3x3box";
}

# Exclude conditions for background blur.
blur-background-exclude = [
    #"window_type = 'dock'",
    "window_type = 'desktop'",
    "class_g = 'Plank'",
    "class_g = 'firefox'",
    "class_g = 'LibreWolf'",
    "class_g = 'dwmsystray'",
    "class_g = 'Polybar'",
    "class_g = 'dwm'",
    "class_g = 'slock'",
    "class_g = 'Slock'",
    "class_g = 'slop'",
    "_GTK_FRAME_EXTENTS@:c"
];

#========================= General Settings =========================#

# Daemonize process. Fork to background after initialization. Causes issues with certain (badly-written) drivers.
# daemon = false

# Specify the backend to use: `xrender`, `glx`, or `xr_glx_hybrid`.
# `xrender` is the default one.
#
experimental-backends = true;
backend = "glx";

# Enable/disable VSync.
# vsync = false
vsync = false;

# Enable remote control via D-Bus. See the *D-BUS API* section below for more details.
# dbus = false

# Try to detect WM windows (a non-override-redirect window with no
# child that has 'WM_STATE') and mark them as active.
#
# mark-wmwin-focused = false
mark-wmwin-focused = true;

# Mark override-redirect windows that doesn't have a child window with 'WM_STATE' focused.
# mark-ovredir-focused = false
mark-ovredir-focused = true;

# Try to detect windows with rounded corners and don't consider them
# shaped windows. The accuracy is not very high, unfortunately.
#
# detect-rounded-corners = false
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.
#
# detect-client-opacity = false
detect-client-opacity = true;

# Specify refresh rate of the screen. If not specified or 0, picom will
# try detecting this with X RandR extension.
#
#refresh-rate = 60
#refresh-rate = 0;

# Use EWMH '_NET_ACTIVE_WINDOW' to determine currently focused window,
# rather than listening to 'FocusIn'/'FocusOut' event. Might have more accuracy,
# provided that the WM supports it.
#
# use-ewmh-active-win = false

# Unredirect all windows if a full-screen opaque window is detected,
# to maximize performance for full-screen windows. Known to cause flickering
# when redirecting/unredirecting windows.
#
unredir-if-possible = true

# Delay before unredirecting the window, in milliseconds. Defaults to 0.
# unredir-if-possible-delay = 0

# Conditions of windows that shouldn't be considered full-screen for unredirecting screen.
# unredir-if-possible-exclude = []

# Use 'WM_TRANSIENT_FOR' to group windows, and consider windows
# in the same group focused at the same time.
#
# detect-transient = false
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 = false
detect-client-leader = true;

# GLX backend: Avoid using stencil buffer, useful if you don't have a stencil buffer.
# Might cause incorrect opacity when rendering transparent content (but never
# practically happened) and may not work with blur-background.
# My tests show a 15% performance boost. Recommended.
#
glx-no-stencil = true;

# Disable the use of damage information.
# This cause the whole screen to be redrawn everytime, instead of the part of the screen
# has actually changed. Potentially degrades the performance, but might fix some artifacts.
# The opposing option is use-damage
#
# no-use-damage = false
#use-damage = true;
use-damage = false;

log-level = "info";

wintypes:
{
  tooltip = { fade=true; shadow=true; opacity=0.95; focus=true; full-shadow=false; };
  popup_menu = { opacity=1.0; }
  dropdown_menu = { opacity=1.0; }
  utility = { shadow=false; opacity=1.0; }
};
