Waybar icon indicating copy to clipboard operation
Waybar copied to clipboard

[SOLVED] Waybar expands from 29 pixels to 37 when wlr/taskbar module is added with identical icon size to other modules

Open Nilabb opened this issue 1 year ago • 1 comments

The modules hyprland/window and tray both work perfectly with an icon size of 24px, and with only those two modules the Waybar height is set to a 29px. As soon as I add wlr/taskbar, with an identical icon size, the bar expands to 35px.

There seems to be some padding, which isn't set through the config or css files, that is adding some padding to the top and bottom of icons which make the module bigger. The only sections of my config and css which include anything to do with wlr/taskbar are:

  • Config file:

    • "modules-center": [
          "wlr/taskbar"
      ],
      
    • "wlr/taskbar": {
          "format": "{icon}",
          "icon-size": 24,
          "tooltip": false,
       },
      
  • style.css file:

    • /* Configuring the taskbar */
      
      #taskbar {
          background-color: #303030;
          border-radius: 15px;
          padding-right: 5px;
          padding-left: 5px;
      }
      
      #taskbar button {
          border-radius: 15px;
      }
      
      #taskbar button.active {
          background-color: #64727D;
          border-radius: 15px;
      }
      

I thought this was due to a left over piece of code from the default config (no longer in the default config) that, on hovering, put a thick whit border underneath the icon, but this issue has persisted after deleting that. It probably looked something like this:

#taskbar button:hover {
    border-bottom: solid white 4px;
}

Small waybar, without wlr/taskabar:

  • image

Big wayabr, with wlr/taskbar:

  • image

Message when running waybar

  • [2024-06-06 13:10:27.930] [info] Using configuration file /home/Balls/.config/waybar/config
    [2024-06-06 13:10:27.931] [info] Unable to receive desktop appearance: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such interface “org.freedesktop.portal.Settings” on object at path /org/freedesktop/portal/desktop
    [2024-06-06 13:10:27.931] [info] Using CSS file /home/Balls/.config/waybar/style.css
    [2024-06-06 13:10:27.936] [info] Hyprland IPC starting
    [2024-06-06 13:10:27.937] [info] Loading persistent workspaces from Hyprland workspace rules
    [2024-06-06 13:10:27.939] [info] Loading persistent workspaces from Hyprland workspace rules
    [2024-06-06 13:10:28.009] [info] Bar configured (width: 1910, height: 37) for output: HDMI-A-1
    

It says height: 37 because one monitor has icons and one monitor doesn't. They aren't uniform height because I have added min-height: 0 to my style.css and as soon as I open an app on my first monitor the bar expands.

Nilabb avatar Jun 06 '24 03:06 Nilabb

I found the fix to this pretty quickly after I posted this, I guess I should've held back a bit before making an issue, but I swear I did this before posting.

I guess the wlr/taskbar module has some default settings that you don't have to define in style.css because the problem was solved only after I explicitly set padding: 0; under #taskbar button. This will put all your icons bunched together so add 'padding-left' and 'padding-right' after. Sorry for making the issue lmao

Nilabb avatar Jun 06 '24 08:06 Nilabb