Skip to content

Commit

Permalink
Updated flakes
Browse files Browse the repository at this point in the history
Updated picom config to support animations
  • Loading branch information
jwyuen committed Oct 8, 2024
1 parent 9dbd9eb commit 694a60f
Show file tree
Hide file tree
Showing 4 changed files with 240 additions and 73 deletions.
75 changes: 75 additions & 0 deletions dots/config/bspwm/picom-animations.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# The animations only works for NORMAL windows.
# Dropdowns, popups, tooltips, docks, etc., do not have animations.

{
match = "window_type = 'normal'";
animations = (
{
triggers = ["close", "hide"];
opacity = {
curve = "linear";
duration = 0.1;
start = "window-raw-opacity-before";
end = 0;
};
# blur-opacity = "opacity";
shadow-opacity = "opacity";
},
{
triggers = ["open", "show"];
opacity = {
curve = "cubic-bezier(0,1,1,1)";
duration = 0.5;
start = 0;
end = "window-raw-opacity";
};
# blur-opacity = "opacity";
shadow-opacity = "opacity";
offset-x = "(1 - scale-x) / 2 * window-width";
offset-y = "(1 - scale-y) / 2 * window-height";
scale-x = {
curve = "cubic-bezier(0,1.3,1,1)";
duration = 0.5;
start = 0.6;
end = 1;
};
scale-y = "scale-x";
shadow-scale-x = "scale-x";
shadow-scale-y = "scale-y";
shadow-offset-x = "offset-x";
shadow-offset-y = "offset-y";
},
{
triggers = ["geometry"]
scale-x = {
curve = "cubic-bezier(0,0,0,1.28)";
duration = 0.5;
start = "window-width-before / window-width";
end = 1;
}
scale-y = {
curve = "cubic-bezier(0,0,0,1.28)";
duration = 0.5;
start = "window-height-before / window-height";
end = 1;
}
offset-x = {
curve = "cubic-bezier(0,0,0,1.28)";
duration = 0.5;
start = "window-x-before - window-x";
end = 0;
}
offset-y = {
curve = "cubic-bezier(0,0,0,1.28)";
duration = 0.5;
start = "window-y-before - window-y";
end = 0;
}

shadow-scale-x = "scale-x";
shadow-scale-y = "scale-y";
shadow-offset-x = "offset-x";
shadow-offset-y = "offset-y";
}
)
}
120 changes: 120 additions & 0 deletions dots/config/bspwm/picom-rules.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@

rules: (

# Per window type rules
{
match = "window_type = 'dropdown_menu'";
shadow = false;
corner-radius = 0;
fade = false;
},

{
match = "window_type = 'popup_menu'";
shadow = false;
corner-radius = 0;
fade = false;
},

{
match = "window_type = 'popup'";
shadow = false;
corner-radius = 0;
fade = false;
},

{
match = "window_type = 'dock'";
shadow = false;
corner-radius = 0;
fade = true;
},

{
match = "window_type = 'tooltip'";
shadow = false;
corner-radius = 0;
fade = false;
opacity = 0.80;
full-shadow = false;
},

{
match = "window_type = 'splash'";
shadow = false;
},

{
match = "window_type = 'dialog'";
shadow = false;
corner-radius = 0;
},

{
match = "window_type = 'menu'";
shadow = false;
corner-radius = 0;
},

# Shadows rules
{
match = "name = 'Notification' || "
"class_g ?= 'Notify-osd' || "
"class_g = 'Dunst' || "
"class_g = 'Polybar' || "
"class_g = 'jgmenu' || "
"class_g = 'scratch' || "
"class_g = 'Spotify' || "
"class_g = 'retroarch' || "
"class_g = 'firefox' || "
"class_g = 'Rofi' || "
"class_g = 'Screenkey' || "
"class_g = 'mpv' || "
"class_g = 'Viewnior' || "
"_GTK_FRAME_EXTENTS@";
shadow = false;
},

# Fading animation rules
{
match = "class_g = 'Polybar' || "
"class_g = 'slop' || "
"class_g = 'scratch' || "
"class_g = 'firefox' || "
"class_g = 'Eww - bar'";
fade = false;
},

# Terminal transparency depending on if focused
{
match = "class_g = 'Alacritty' && focused"
opacity = 0.99;
},

{
match = "class_g = 'Alacritty' && !focused"
opacity = 0.80;
},

{
match = "class_g = 'Updating'"; opacity = 0.95;
},

{
match = "class_g = 'scratch'"; opacity = 0.90;
},

# Corner radius rules
{
match = "class_g = 'Polybar' || "
"class_g = 'eww-bar' || "
"class_g = 'Viewnior' || "
"class_g = 'Rofi' || "
"class_g = 'mpv' || "
"class_g = 'retroarch'";
corner-radius = 0;
},

@include "picom-animations.conf"

)
40 changes: 6 additions & 34 deletions dots/config/bspwm/picom.conf
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ fading = false;

fade-in-step = 0.03;
fade-out-step = 0.03;
fade-delta = 6

fade-delta = 5
no-fading-openclose = true
no-fading-destroyed-argb = true

fade-exclude = [
Expand All @@ -67,37 +67,6 @@ rounded-corners-exclude = [
"class_g = 'retroarch'"
];

#################################
# Transparency / Opacity #
#################################

active-opacity = 0.99;
inactive-opacity = 0.8;
inactive-opacity-override = false;

focus-exclude = [
"class_g = 'Cairo-clock'",
"class_g = 'slop'", # maim
];

opacity-rule = [
"100:class_g *= 'firefox'",
"100:class_g *= 'Rofi'",
"100:fullscreen",
#"100:class_g = 'Alacritty'",
"100:class_g = 'FloaTerm'",
"95:class_g = 'Updating'",
"90:class_g = 'scratch'"
];

popup_menu: {
opacity = 1.0;
}

dropdown_menu: {
opacity = 1.0;
}

#################################
# General Settings #
#################################
Expand All @@ -113,7 +82,7 @@ mark-ovredir-focused = false;
detect-rounded-corners = true;
detect-client-opacity = true;
detect-transient = true;
glx-no-stencil = true;
#glx-no-stencil = true;
use-damage = true;

log-level = "error";
Expand All @@ -129,3 +98,6 @@ wintypes:
dock = { shadow = false; clip-shadow-above = false; }
dnd = { shadow = false; }
};


@include "picom-rules.conf"
Loading

0 comments on commit 694a60f

Please sign in to comment.