Waybar icon indicating copy to clipboard operation
Waybar copied to clipboard

[sway/window] cannot style the application icon and module text together

Open ian-s-mcb opened this issue 2 years ago • 1 comments

Styling the sway/window module is a bit cumbersome because it doesn't have a CSS selector for the whole module. The part of that module has a selector is the text (label#window), which leaves out a way to style the icon part.

Below is the CSS hierarchy from waybar -l debug

window#waybar.background.top.eDP-1..mode-default:dir(ltr)
  decoration:dir(ltr)
  box.horizontal:dir(ltr)
    box.horizontal.modules-left:dir(ltr)
      widget:dir(ltr)
        box#workspaces.horizontal:dir(ltr)
      widget:dir(ltr)
        box.horizontal:dir(ltr)
          image:dir(ltr)
          label#window:dir(ltr)

Versions:

  • Waybar: v0.9.24
  • Sway: 1.8.1
  • Distro: Arch Linux

ian-s-mcb avatar Jan 13 '24 18:01 ian-s-mcb

I just ran into the same issue, which looks really bad with the way i want to have my setup to work.

cptn-cosmo avatar Jan 24 '24 10:01 cptn-cosmo

There's been a recent change to AIconLabel.cpp in #2973 (via Commit 16aced7f9ffcac1200473192712575afaa4e6513). The PR was for hyprland/window, but sway/window uses the same class for displaying icon and label.

The hierarchy now reads:

    box.horizontal.modules-center:dir(ltr)
      widget:dir(ltr)
        box#window.horizontal.module:dir(ltr)
          image:dir(ltr)
          label:dir(ltr)

So I assume this issue has been addressed in the meantime.

RobertMueller2 avatar Mar 13 '24 07:03 RobertMueller2