Skip to content

Commit

Permalink
feat: Add picom rules configuration for window effects and animations
Browse files Browse the repository at this point in the history
  • Loading branch information
ulises-jeremias committed Dec 2, 2024
1 parent f3d3252 commit 92b1432
Show file tree
Hide file tree
Showing 7 changed files with 219 additions and 107 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Most were written from scratch. Some details:
- **Desktop Notification** 🌿 [Dunst](https://github.com/dunst-project/dunst) which is minimalist!
- **Terminal Emulator** 🌿 [Alacritty](https://alacritty.org/) which is GPU accelerated!
- **Shell** 🐚 [Zsh](https://zsh.org) with several post-installation tweaks!
- **Compositor** 🍧 [Picom fork by FT-Labs](https://github.com/FT-Labs/picom) for that perfection topping with Animations!
- **Compositor** 🍧 [Picom](https://github.com/yshui/picom) for that perfection topping with Animations!
- **File Manager** 🃏 [Thunar](https://docs.xfce.org/xfce/thunar/start) with a customized side pane!
- **Widgets** 🎨 [Eww](https://github.com/elkowar/eww) with 2 different pre-backed widgets!
- and many more!
Expand Down
2 changes: 1 addition & 1 deletion docs/Home.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Most were written from scratch. Some details:
- **Desktop Notification** 🌿 [Dunst](https://github.com/dunst-project/dunst) which is minimalist!
- **Terminal Emulator** 🌿 [Alacritty](https://alacritty.org/) which is GPU accelerated!
- **Shell** 🐚 [Zsh](https://zsh.org) with several post-installation tweaks!
- **Compositor** 🍧 [Picom fork by FT-Labs](https://github.com/FT-Labs/picom) for that perfection topping with Animations!
- **Compositor** 🍧 [Picom](https://github.com/yshui/picom) for that perfection topping with Animations!
- **File Manager** 🃏 [Thunar](https://docs.xfce.org/xfce/thunar/start) with a customized side pane!
- **Widgets** 🎨 [Eww](https://github.com/elkowar/eww) with 2 different pre-backed widgets!
- and many more!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{{ if eq .osid "linux-arch" -}}
#!/usr/bin/env bash

yay -S --noconfirm --needed picom-ftlabs-git
sudo pacman -S --noconfirm --needed picom
{{ end -}}

{{ end -}}
5 changes: 5 additions & 0 deletions home/dot_config/alacritty/alacritty.toml
Original file line number Diff line number Diff line change
Expand Up @@ -180,3 +180,8 @@ lines = 24
[window.padding]
x = 25
y = 20

[bell]
animation = "Linear"
duration = 0
command = { program = "paplay", args = ["/usr/share/sounds/freedesktop/stereo/dialog-error.oga"] }
2 changes: 1 addition & 1 deletion home/dot_config/i3/config.d/autostart.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ exec --no-startup-id xdg-autostart &
exec_always --no-startup-id ~/.config/polybar/launch.sh &

# Fix wm gaps
exec ~/.config/i3/setup-gaps.sh
exec_always --no-startup-id ~/.config/i3/setup-gaps.sh

# Run i3-layouts
exec i3-layouts
Expand Down
203 changes: 203 additions & 0 deletions home/dot_config/picom/picom-rules.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,203 @@
rules: (
# Per window type rules
{
match = "window_type = 'dropdown_menu'";
shadow = false;
corner-radius = 0;
},

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

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

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

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

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

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

{
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 = 'slop' || "
"class_g = 'scratch' || "
"class_g = 'firefox'";
fade = false;
},

# Transparency for terminals depending on rice you are
{
match = "class_g = 'Alacritty' || "
"class_g = 'kitty' || "
"class_g = 'FloaTerm'";
opacity = 1;
},

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

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

# Corner radius rules
{
match = "class_g = 'Polybar' || "
"class_g = 'eww-bar' || "
"class_g = 'Viewnior' || "
"class_g = 'Rofi' || "
"class_g = 'mpv' || "
"class_g = 'firefox' || "
"class_g = 'scratch' || "
"class_g = 'retroarch'";
corner-radius = 0;
},
# Animations for normal windows
{
match = "window_type = 'normal'";
animations = (
{
triggers = ["open", "show"];
opacity = {
curve = "cubic-bezier(0,1,1,1)";
duration = 0.4;
start = 0;
end = "window-raw-opacity";
};
scale-x = {
curve = "cubic-bezier(0,1.3,1,1)";
duration = 0.4;
start = 0.8;
end = 1;
};
scale-y = "scale-x";
},
{
triggers = ["close", "hide"];
opacity = {
curve = "linear";
duration = 0.3;
start = "window-raw-opacity-before";
end = 0;
};
scale-x = {
curve = "cubic-bezier(0.3,0,0.7,1)";
duration = 0.3;
start = 1;
end = 0.8;
};
scale-y = "scale-x";
}
)
},

# Animations for Rofi
{
match = "class_g = 'Rofi'";
animations = (
{
triggers = ["open", "show"];
preset = "slide-in";
direction = "up";
duration = 0.3;
},
{
triggers = ["close", "hide"];
preset = "slide-out";
direction = "down";
duration = 0.2;
}
)
},

# Animations for Dunst
{
match = "class_g = 'Dunst'";
animations = (
{
triggers = ["open", "show"];
preset = "fly-in";
direction = "right";
duration = 0.2;
},
{
triggers = ["close", "hide"];
preset = "fly-out";
direction = "left";
duration = 0.2;
}
)
},

# Animations for Scratchpad
{
match = "class_g = 'scratch'";
animations = (
{
triggers = ["open", "show"];
preset = "slide-in";
direction = "up";
duration = 0.3;
},
{
triggers = ["close", "hide"];
preset = "slide-out";
direction = "down";
duration = 0.3;
}
)
}
)
110 changes: 7 additions & 103 deletions home/dot_config/picom/picom.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,71 +2,6 @@
# Currently patched: "awesome", "dwm", "herb"
wm-support = "none";

#################################
# Animations #

# !These animations WILL NOT work correctly for any other wm other than phyOS-dwm fork!

# fly-in: Windows fly in from random directions to the screen
# maximize: Windows pop from center of the screen to their respective positions
# minimize: Windows minimize from their position to the center of the screen
# slide-in-center: Windows move from upper-center of the screen to their respective positions
# slide-out-center: Windows move to the upper-center of the screen
# slide-left: Windows are created from the right-most window position and slide leftwards
# slide right: Windows are created from the left-most window position and slide rightwards
# slide-down: Windows are moved from the top of the screen and slide downward
# slide-up: Windows are moved from their position to top of the screen
# squeeze: Windows are either closed or created to/from their center y-position (the animation is similar to a blinking eye)
# squeeze-bottom: Similar to squeeze, but the animation starts from bottom-most y-position
# zoom: Windows are either created or destroyed from/to their center (not the screen center)

#################################

# enable or disable animations
animations = true;

# change animation speed of windows in current tag e.g open window in current tag
animation-stiffness-in-tag = 125;

# change animation speed of windows when tag changes
animation-stiffness-tag-change = 90.0;

# change the mass of windows
# modifying the mass of windows makes them virtually heavier and therefore slower to animate.
animation-window-mass = 0.4;

# change dampening applied during the animation
# this setting basically does what it says. It dampens the animation of windows.
animation-dampening = 12;

# toggles clamping
# if you are using a animation setting that would make the window extend larger than it would be after,
# the animation has played then it will cut the animation off once the window reaches its physical geometry.
animation-clamping = true;

# open windows
# available options: slide-up, slide-down, slide-left, slide-right, squeeze, squeeze-bottom, zoom
animation-for-open-window = "zoom";

# minimize or close windows
# available options: slide-up, slide-down, slide-left, slide-right, squeeze, squeeze-bottom, zoom
animation-for-unmap-window = "none";

# popup windows
animation-for-transient-window = "zoom";

# set animation for windows being transitioned out while changings tags
animation-for-prev-tag = "minimize";

# enables fading for windows being transitioned out while changings tags
enable-fading-prev-tag = true;

# set animation for windows being transitioned in while changings tags
animation-for-next-tag = "slide-in-center";

# enables fading for windows being transitioned in while changings tags
enable-fading-next-tag = true;

#################################
# Corners #
#################################
Expand All @@ -93,44 +28,7 @@ rounded-corners-exclude = [

# 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.
glx-copy-from-front = true;

# 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 = false;

# 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";
backend = "xrender";

#################################
#
Expand Down Expand Up @@ -365,3 +263,9 @@ wintypes:

# Use X Sync fence to sync clients' draw calls. Needed on nvidia-drivers with GLX backend for some users.
xrender-sync-fence = false;


######################
# Picom Rules
######################
@include "picom-rules.conf"

0 comments on commit 92b1432

Please sign in to comment.