elkowar / eww

ElKowars wacky widgets
https://elkowar.github.io/eww
MIT License
8.78k stars 366 forks source link

[BUG] Transparent background styling is not applied for Cosmic compositor #1111

Open lavafroth opened 4 weeks ago

lavafroth commented 4 weeks ago

Checklist before submitting an issue

Description of the bug

I have a simple eww.yuck file that displays the output of a systemctl status command in the background (stacking bg). Even after setting the background-color css property to transparent, there's still the default gray background.

screenshot-2024-06-06-10-29-50

Reproducing the issue

eww.yuck

(deflisten home-manager-script :initial ""
      "python ~/.config/eww/main.py")
(defwindow home-manager
  :monitor 0
  :geometry (geometry :x "74%"
                      :y "44%"
                      :anchor "top left")
  :stacking "bg"
  (literal :content home-manager-script))

main.py

import subprocess

output = subprocess.check_output("systemctl status home-manager-h.service", shell=True).decode()
lines = [line.strip() for line in output.splitlines()]
output = "\\\\n".join(lines[:8])
output = f"(label :width 470 :height 100 :wrap true :text '{output or ''}')"
print(output)

eww.css

.home-manager {
  font-size: 20px;
  background-color: transparent;
  font-family: 'Terminess Nerd Font Propo';
  padding: 10px;
  color: #47b499;
}

eww logs

The eww logs show no errors or warnings.

 2024-06-06T10:22:58.877Z INFO  eww::server             > Reloaded config successfully
 2024-06-06T10:23:00.133Z INFO  eww::app                > Opening window home-manager as 'home-manager'
 2024-06-06T10:23:00.133Z INFO  eww::app                > Closing gtk window home-manager
 2024-06-06T10:23:26.215Z INFO  eww::app                > Opening window home-manager as 'home-manager'
 2024-06-06T10:23:26.215Z INFO  eww::app                > Closing gtk window home-manager
 2024-06-06T10:23:33.245Z INFO  eww::app                > Received close command, closing all windows
 2024-06-06T10:23:33.245Z INFO  eww::app                > Closing gtk window home-manager
 2024-06-06T10:23:34.025Z INFO  eww::app                > Opening window home-manager as 'home-manager'
 2024-06-06T10:23:46.099Z INFO  eww::app                > Opening window home-manager as 'home-manager'
 2024-06-06T10:23:46.099Z INFO  eww::app                > Closing gtk window home-manager

Expected behaviour

The background for the label should be transparent.

Additional context

Pasting the same CSS in eww inspector's CSS tab applies the transparency. screenshot-2024-06-06-10-38-50 I have also tried the same setup on Hyprland and that yields the same results. Like some of the previous issues have mentioned, I have tried * { all: unset } in the CSS but that does not help either.