@@ -102,16 +102,7 @@ blur-method = "{}"; |
| 102 | 102 | blur-strength = {}; |
| 103 | 103 | blur-background = true; |
| 104 | 104 | blur-background-frame = false; |
| 105 | | -blur-kern = "3x3box"; |
| 106 | | - |
| 107 | | -blur-background-exclude = [ |
| 108 | | - "window_type = 'dock'", |
| 109 | | - "window_type = 'desktop'", |
| 110 | | - "window_type = 'menu'", |
| 111 | | - "window_type = 'dropdown_menu'", |
| 112 | | - "window_type = 'popup_menu'", |
| 113 | | - "_NET_WM_BYPASS_COMPOSITOR = 1" |
| 114 | | -];"#, |
| 105 | +blur-kern = "3x3box";"#, |
| 115 | 106 | blur_method, blur_strength |
| 116 | 107 | ) |
| 117 | 108 | } else { |
@@ -125,18 +116,7 @@ shadow = true; |
| 125 | 116 | shadow-radius = {}; |
| 126 | 117 | shadow-opacity = {:.2}; |
| 127 | 118 | shadow-offset-x = {}; |
| 128 | | -shadow-offset-y = {}; |
| 129 | | - |
| 130 | | -shadow-exclude = [ |
| 131 | | - "window_type = 'dock'", |
| 132 | | - "window_type = 'desktop'", |
| 133 | | - "window_type = 'menu'", |
| 134 | | - "window_type = 'dropdown_menu'", |
| 135 | | - "window_type = 'popup_menu'", |
| 136 | | - "window_type = 'tooltip'", |
| 137 | | - "_NET_WM_STATE *= '_NET_WM_STATE_FULLSCREEN'", |
| 138 | | - "_NET_WM_BYPASS_COMPOSITOR = 1" |
| 139 | | -];"#, |
| 119 | +shadow-offset-y = {};"#, |
| 140 | 120 | self.shadow_radius, |
| 141 | 121 | self.shadow_opacity, |
| 142 | 122 | self.shadow_offset_x, |
@@ -154,13 +134,7 @@ fade-in-step = 0.028; |
| 154 | 134 | fade-out-step = 0.03; |
| 155 | 135 | fade-delta = {}; |
| 156 | 136 | |
| 157 | | -no-fading-destroyed-argb = true; |
| 158 | | - |
| 159 | | -fade-exclude = [ |
| 160 | | - "window_type = 'menu'", |
| 161 | | - "window_type = 'dropdown_menu'", |
| 162 | | - "window_type = 'popup_menu'" |
| 163 | | -];"#, |
| 137 | +no-fading-destroyed-argb = true;"#, |
| 164 | 138 | self.fade_delta |
| 165 | 139 | ) |
| 166 | 140 | } else { |
@@ -230,42 +204,105 @@ animations = ({{ |
| 230 | 204 | "# No custom shader".to_string() |
| 231 | 205 | }; |
| 232 | 206 | |
| 233 | | - // Per-window rules section |
| 234 | | - let rules_section = if !self.picom_rules.is_empty() { |
| 235 | | - let mut rules = String::from("# Per-window Rules\nrules = (\n"); |
| 236 | | - for rule in &self.picom_rules { |
| 237 | | - rules.push_str(&format!(" {{\n match = \"{}\";\n", rule.match_expr)); |
| 238 | | - if let Some(cr) = rule.corner_radius { |
| 239 | | - rules.push_str(&format!(" corner-radius = {};\n", cr)); |
| 240 | | - } |
| 241 | | - if let Some(opacity) = rule.opacity { |
| 242 | | - rules.push_str(&format!(" opacity = {:.2};\n", opacity)); |
| 243 | | - } |
| 244 | | - if let Some(shadow) = rule.shadow { |
| 245 | | - rules.push_str(&format!(" shadow = {};\n", shadow)); |
| 246 | | - } |
| 247 | | - if let Some(blur) = rule.blur_background { |
| 248 | | - rules.push_str(&format!(" blur-background = {};\n", blur)); |
| 249 | | - } |
| 250 | | - if let Some(ref shader) = rule.shader { |
| 251 | | - let expanded = if shader.starts_with("~/") { |
| 252 | | - if let Some(home) = dirs::home_dir() { |
| 253 | | - home.join(&shader[2..]).to_string_lossy().to_string() |
| 254 | | - } else { |
| 255 | | - shader.clone() |
| 256 | | - } |
| 207 | + // Unified rules section (picom v13 format) |
| 208 | + // Replaces deprecated: shadow-exclude, fade-exclude, blur-background-exclude, |
| 209 | + // rounded-corners-exclude, and wintypes blocks |
| 210 | + let mut rules = String::from("# Rules (picom v13 format)\nrules = (\n"); |
| 211 | + |
| 212 | + // Built-in window type rules |
| 213 | + rules.push_str(r#" { |
| 214 | + match = "window_type = 'dock'"; |
| 215 | + shadow = false; |
| 216 | + corner-radius = 0; |
| 217 | + blur-background = false; |
| 218 | + clip-shadow-above = true; |
| 219 | + }, |
| 220 | + { |
| 221 | + match = "window_type = 'desktop'"; |
| 222 | + shadow = false; |
| 223 | + corner-radius = 0; |
| 224 | + blur-background = false; |
| 225 | + }, |
| 226 | + { |
| 227 | + match = "window_type = 'tooltip'"; |
| 228 | + shadow = false; |
| 229 | + corner-radius = 0; |
| 230 | + blur-background = false; |
| 231 | + fade = true; |
| 232 | + opacity = 0.95; |
| 233 | + focus = true; |
| 234 | + }, |
| 235 | + { |
| 236 | + match = "window_type = 'menu'"; |
| 237 | + shadow = false; |
| 238 | + corner-radius = 0; |
| 239 | + blur-background = false; |
| 240 | + fade = false; |
| 241 | + }, |
| 242 | + { |
| 243 | + match = "window_type = 'dropdown_menu'"; |
| 244 | + shadow = false; |
| 245 | + corner-radius = 0; |
| 246 | + blur-background = false; |
| 247 | + fade = false; |
| 248 | + opacity = 0.95; |
| 249 | + }, |
| 250 | + { |
| 251 | + match = "window_type = 'popup_menu'"; |
| 252 | + shadow = false; |
| 253 | + corner-radius = 0; |
| 254 | + blur-background = false; |
| 255 | + fade = false; |
| 256 | + opacity = 0.95; |
| 257 | + }, |
| 258 | + { |
| 259 | + match = "window_type = 'dnd'"; |
| 260 | + shadow = false; |
| 261 | + }, |
| 262 | + { |
| 263 | + match = "_NET_WM_STATE *= '_NET_WM_STATE_FULLSCREEN'"; |
| 264 | + corner-radius = 0; |
| 265 | + shadow = false; |
| 266 | + }, |
| 267 | + { |
| 268 | + match = "_NET_WM_BYPASS_COMPOSITOR = 1"; |
| 269 | + shadow = false; |
| 270 | + blur-background = false; |
| 271 | + }, |
| 272 | +"#); |
| 273 | + |
| 274 | + // User custom picom rules |
| 275 | + for rule in &self.picom_rules { |
| 276 | + rules.push_str(&format!(" {{\n match = \"{}\";\n", rule.match_expr)); |
| 277 | + if let Some(cr) = rule.corner_radius { |
| 278 | + rules.push_str(&format!(" corner-radius = {};\n", cr)); |
| 279 | + } |
| 280 | + if let Some(opacity) = rule.opacity { |
| 281 | + rules.push_str(&format!(" opacity = {:.2};\n", opacity)); |
| 282 | + } |
| 283 | + if let Some(shadow) = rule.shadow { |
| 284 | + rules.push_str(&format!(" shadow = {};\n", shadow)); |
| 285 | + } |
| 286 | + if let Some(blur) = rule.blur_background { |
| 287 | + rules.push_str(&format!(" blur-background = {};\n", blur)); |
| 288 | + } |
| 289 | + if let Some(ref shader) = rule.shader { |
| 290 | + let expanded = if shader.starts_with("~/") { |
| 291 | + if let Some(home) = dirs::home_dir() { |
| 292 | + home.join(&shader[2..]).to_string_lossy().to_string() |
| 257 | 293 | } else { |
| 258 | 294 | shader.clone() |
| 259 | | - }; |
| 260 | | - rules.push_str(&format!(" shader = \"{}\";\n", expanded)); |
| 261 | | - } |
| 262 | | - rules.push_str(" },\n"); |
| 295 | + } |
| 296 | + } else { |
| 297 | + shader.clone() |
| 298 | + }; |
| 299 | + rules.push_str(&format!(" shader = \"{}\";\n", expanded)); |
| 263 | 300 | } |
| 264 | | - rules.push_str(");"); |
| 265 | | - rules |
| 266 | | - } else { |
| 267 | | - "# No per-window rules".to_string() |
| 268 | | - }; |
| 301 | + rules.push_str(" },\n"); |
| 302 | + } |
| 303 | + |
| 304 | + rules.push_str(");"); |
| 305 | + let rules_section = rules; |
| 269 | 306 | |
| 270 | 307 | format!( |
| 271 | 308 | r#"# picom.conf - Auto-generated by gar window manager |
@@ -280,16 +317,6 @@ use-ewmh-active-win = true; |
| 280 | 317 | # Rounded Corners |
| 281 | 318 | corner-radius = {}; |
| 282 | 319 | |
| 283 | | -rounded-corners-exclude = [ |
| 284 | | - "window_type = 'dock'", |
| 285 | | - "window_type = 'desktop'", |
| 286 | | - "window_type = 'tooltip'", |
| 287 | | - "window_type = 'menu'", |
| 288 | | - "window_type = 'dropdown_menu'", |
| 289 | | - "window_type = 'popup_menu'", |
| 290 | | - "_NET_WM_STATE *= '_NET_WM_STATE_FULLSCREEN'" |
| 291 | | -]; |
| 292 | | - |
| 293 | 320 | {} |
| 294 | 321 | |
| 295 | 322 | {} |
@@ -303,33 +330,6 @@ rounded-corners-exclude = [ |
| 303 | 330 | {} |
| 304 | 331 | |
| 305 | 332 | {} |
| 306 | | - |
| 307 | | -# Window Type Settings |
| 308 | | -wintypes: |
| 309 | | -{{ |
| 310 | | - tooltip = {{ |
| 311 | | - fade = true; |
| 312 | | - shadow = false; |
| 313 | | - opacity = 0.95; |
| 314 | | - focus = true; |
| 315 | | - blur-background = false; |
| 316 | | - }}; |
| 317 | | - dock = {{ |
| 318 | | - shadow = false; |
| 319 | | - clip-shadow-above = true; |
| 320 | | - }}; |
| 321 | | - dnd = {{ |
| 322 | | - shadow = false; |
| 323 | | - }}; |
| 324 | | - popup_menu = {{ |
| 325 | | - opacity = 0.95; |
| 326 | | - shadow = false; |
| 327 | | - }}; |
| 328 | | - dropdown_menu = {{ |
| 329 | | - opacity = 0.95; |
| 330 | | - shadow = false; |
| 331 | | - }}; |
| 332 | | -}}; |
| 333 | 333 | "#, |
| 334 | 334 | self.picom_backend, |
| 335 | 335 | self.corner_radius, |