diff options
| author | 2026-02-21 14:54:14 -0500 | |
|---|---|---|
| committer | 2026-02-21 14:54:14 -0500 | |
| commit | d9be77d6429d598f3ec7eead1620c33556b7c865 (patch) | |
| tree | e5537c045d868e7a65147a69746ec173a217d327 /picom | |
initial commit
Diffstat (limited to '')
| -rw-r--r-- | picom.conf | 149 | ||||
| -rw-r--r-- | picom/gradient-border.glsl | 58 |
2 files changed, 207 insertions, 0 deletions
diff --git a/picom.conf b/picom.conf new file mode 100644 index 0000000..6d003b9 --- /dev/null +++ b/picom.conf @@ -0,0 +1,149 @@ +# ╔══════════════════════════════════════════════════════════╗ +# ║ picom.conf ║ +# ╚══════════════════════════════════════════════════════════╝ + +# ── Backend ────────────────────────────────────────────────────────────────── + +backend = "glx"; + +# ── Vsync ──────────────────────────────────────────────────────────────────── + +vsync = true; + +# ── Custom shader (gradient window borders) ─────────────────────────────────── +# Place gradient-border.glsl in ~/.config/picom/ then uncomment: +window-shader-fg-rule = [ + "/home/lanceb/.config/picom/gradient-border.glsl:focused" +]; +glx-copy-from-front = false; +use-damage = true; + +# ── Corner Rounding ─────────────────────────────────────────────────────────── + +corner-radius = 5; + +# Exclude corners on certain window types (optional – comment out if unwanted) +rounded-corners-exclude = [ + "window_type = 'dock'", + "window_type = 'desktop'", + "class_g = 'Polybar'", + "class_g = 'Rofi'" +]; + +# ── Opacity ─────────────────────────────────────────────────────────────────── + +# Unfocused windows get 0.8 opacity +inactive-opacity = 0.8; + +# Focused / active windows are fully opaque +active-opacity = 1.0; + +# Don't let applications override opacity via EWMH hints (set true to respect them) +inactive-opacity-override = false; + +# Exclude certain windows from opacity rules +opacity-rule = [ + "100:window_type = 'dock'", + "100:window_type = 'desktop'", + "100:class_g = 'Rofi'", + "100:_NET_WM_STATE@:32a *= '_NET_WM_STATE_FULLSCREEN'" +]; + +# ── Background Blur ─────────────────────────────────────────────────────────── + +blur-background = true; +blur-method = "dual_kawase"; +blur-strength = 5; + +# Don't blur behind the desktop itself +blur-background-exclude = [ + "window_type = 'dock'", + "window_type = 'desktop'", + "_GTK_FRAME_EXTENTS@:c" +]; + +# ── Shadows ─────────────────────────────────────────────────────────────────── + +shadow = true; +shadow-radius = 12; +shadow-offset-x = -6; +shadow-offset-y = -6; +shadow-opacity = 0.6; + +shadow-exclude = [ + "window_type = 'dock'", + "window_type = 'desktop'", + "_GTK_FRAME_EXTENTS@:c" +]; + +# ── Fading ──────────────────────────────────────────────────────────────────── + +fading = true; +fade-in-step = 0.03; +fade-out-step = 0.03; +fade-delta = 5; + +# ── Window Type Tweaks ──────────────────────────────────────────────────────── + +wintypes: +{ + normal = { fade = true; shadow = true; }; + tooltip = { fade = true; shadow = false; opacity = 0.9; focus = true; }; + dock = { shadow = false; clip-shadow-above = true; }; + dnd = { shadow = false; }; + popup_menu = { opacity = 0.95; }; + dropdown_menu = { opacity = 0.95; }; +}; + +# ── Animations ─────────────────────────────────────────────────────────────── + +animations = ({ + triggers = ["open", "show"]; + + scale-x = { + curve = "cubic-bezier(0.22, 1, 0.36, 1)"; + duration = 0.18; + start = 0.85; + end = 1; + }; + + scale-y = "scale-x"; + + offset-x = "(1 - scale-x) / 2 * window-width"; + offset-y = "(1 - scale-y) / 2 * window-height"; + + shadow-scale-x = "scale-x"; + shadow-scale-y = "scale-y"; + shadow-offset-x = "offset-x"; + shadow-offset-y = "offset-y"; + +}, { + triggers = ["close", "hide"]; + + scale-x = { + curve = "cubic-bezier(0.4, 0, 1, 1)"; + duration = 0.15; + start = 1; + end = 1.1; + }; + + scale-y = "scale-x"; + + offset-x = "(1 - scale-x) / 2 * window-width"; + offset-y = "(1 - scale-y) / 2 * window-height"; + + shadow-scale-x = "scale-x"; + shadow-scale-y = "scale-y"; + shadow-offset-x = "offset-x"; + shadow-offset-y = "offset-y"; + + opacity = { + curve = "linear"; + duration = 0.15; + start = "window-raw-opacity-before"; + end = 0; + }; + + shadow-opacity = "opacity"; +}); + diff --git a/picom/gradient-border.glsl b/picom/gradient-border.glsl new file mode 100644 index 0000000..0c2c25c --- /dev/null +++ b/picom/gradient-border.glsl @@ -0,0 +1,58 @@ +#version 330 + +// ── Gradient border shader for picom ───────────────────────────────────────── +// Blends a diagonal gradient (top-left → bottom-right) over the window border. +// +// COLOR_A : top-left colour — #7B2FBE (purple) +// COLOR_B : bottom-right — #2FB8BE (teal) +// +// To change colours: convert hex → float by dividing each channel by 255. + +// ── Tuneable constants ──────────────────────────────────────────────────────── + +const float BORDER_WIDTH = 4.0; // Border band thickness in pixels +const float BORDER_OPACITY = 0.95; // How strongly the gradient is applied + +// COLOR_A: #7B2FBE (vibrant purple) +const vec3 COLOR_A = vec3(0.106, 0.992, 0.612); + +// COLOR_B: #2FB8BE (cyan-teal) +const vec3 COLOR_B = vec3(0.651, 1.0, 0.788); + +// ── Picom-provided ──────────────────────────────────────────────────────────── + +in vec2 texcoord; // Fragment texture coordinate (in pixels) +uniform sampler2D tex; // Window texture + +// Picom's built-in post-processing (opacity, rounded corners, etc.) +vec4 default_post_processing(vec4 c); + +// ── Entry point ─────────────────────────────────────────────────────────────── + +vec4 window_shader() { + // Sample the original window pixel + vec4 c = texelFetch(tex, ivec2(texcoord), 0); + + // Derive texture size from the sampler + vec2 size = vec2(textureSize(tex, 0)); + + // Normalised UV (0,0) top-left → (1,1) bottom-right + vec2 uv = texcoord / size; + + // Diagonal gradient factor + float t = (uv.x + uv.y) * 0.5; + vec3 gradient = mix(COLOR_A, COLOR_B, t); + + // Border mask: 1.0 on the edge band, 0.0 in the interior + float left = smoothstep(0.0, BORDER_WIDTH, texcoord.x); + float right = smoothstep(0.0, BORDER_WIDTH, size.x - texcoord.x); + float top = smoothstep(0.0, BORDER_WIDTH, texcoord.y); + float bottom = smoothstep(0.0, BORDER_WIDTH, size.y - texcoord.y); + float mask = 1.0 - (left * right * top * bottom); + + // Blend gradient onto border region only + c.rgb = mix(c.rgb, gradient, mask * BORDER_OPACITY); + + // Let picom handle opacity, rounded corners, etc. + return default_post_processing(c); +} |
