[GH-ISSUE #744] Set exclusive zone size. #5864

Closed
opened 2026-05-23 01:53:33 +01:00 by JakeStanger · 6 comments
Owner

Originally created by @DrVoidest on GitHub (Oct 8, 2024).
Original GitHub issue: https://github.com/JakeStanger/ironbar/issues/744

Is your feature request related to a problem? Please describe.

I prefer to have a bar always visible, but with a small exclusion zone around it.

Describe the solution you'd like

In config:

exclusive_zone_size = 2px 2px 2px 2px;

or

exclusive_zone_left = 2px;
exclusive_zone_right = 2px
exclusive_zone_top = 2px;
exclusive_zone_bottom = 2px;

Additional context

Current bar that I would like to change the exclusive zone for.
image

Originally created by @DrVoidest on GitHub (Oct 8, 2024). Original GitHub issue: https://github.com/JakeStanger/ironbar/issues/744 **Is your feature request related to a problem? Please describe.** I prefer to have a bar always visible, but with a small exclusion zone around it. **Describe the solution you'd like** In config: ``` exclusive_zone_size = 2px 2px 2px 2px; ``` or ``` exclusive_zone_left = 2px; exclusive_zone_right = 2px exclusive_zone_top = 2px; exclusive_zone_bottom = 2px; ``` **Additional context** Current bar that I would like to change the exclusive zone for. ![image](https://github.com/user-attachments/assets/f98ac328-cfbe-4240-b227-9e9c06b54576)
JakeStanger 2026-05-23 01:53:33 +01:00
Author
Owner

@JakeStanger commented on GitHub (Oct 8, 2024):

I think what you're looking for is the margin bar-level option

<!-- gh-comment-id:2400162667 --> @JakeStanger commented on GitHub (Oct 8, 2024): I think what you're looking for is the `margin` [bar-level option](https://github.com/JakeStanger/ironbar/wiki/configuration-guide#32-bar-level-options)
Author
Owner

@DrVoidest commented on GitHub (Oct 8, 2024):

I tried setting both padding and margin to zero which helps, but it still has that gap.
image

<!-- gh-comment-id:2400315114 --> @DrVoidest commented on GitHub (Oct 8, 2024): I tried setting both padding and margin to zero which helps, but it still has that gap. ![image](https://github.com/user-attachments/assets/da77f94a-0d7b-4e9d-adba-bdf51f0c6b7a)
Author
Owner

@JakeStanger commented on GitHub (Oct 8, 2024):

It's a config option, different from the CSS margin property. If you're still having problems, please share your config.

<!-- gh-comment-id:2400337027 --> @JakeStanger commented on GitHub (Oct 8, 2024): It's a config option, different from the CSS margin property. If you're still having problems, please share your config.
Author
Owner

@DrVoidest commented on GitHub (Oct 8, 2024):

Config.json

{
  "center": [
    {
      "bar": [
        {
          "label": "#weather_current",
          "on_click": "!zx /etc/nixos/modules/scripts/weather-iron-bar",
          "type": "button"
        }
      ],
      "class": "weather",
      "type": "custom"
    }
  ],
  "end": [
    {
      "icon_size": 30,
      "type": "tray"
    },
    {
      "format": "{icon} {percentage}%",
      "icons": {
        "muted": "󰝟",
        "volume_high": "󰕾",
        "volume_low": "󰕿",
        "volume_medium": "󰖀"
      },
      "max_volume": 100,
      "type": "volume"
    },
    {
      "format": "{percentage}%",
      "icon_size": 20,
      "type": "upower"
    },
    {
      "format": "%H:%M",
      "type": "clock"
    }
  ],
  "exclusive_zone": true,
  "height": 0,
  "icon_theme": "Papirus-Dark",
  "layer": "top",
  "margin": {
    "bottom": 0,
    "top": 0
  },
  "padding": {
    "bottom": 0,
    "top": 0
  },
  "popup_gap": 0,
  "position": "top",
  "start": [
    {
      "all_monitors": true,
      "type": "workspaces"
    }
  ]
}

style.css

*  {
      font-size: 11px;
      border: none;
      border-radius: 20px;
      background-color: rgba(0, 0, 0, 0);
      margin: 0px 0px 0px 0px;
      padding-bottom: 0px;
      padding-top: 0px;
     }
     .background {
        padding-bottom: 0px;
        padding-top: 0px;
	box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px 0px;
	margin: 0px 0px 0px 0px;
     }
     .tray {
       padding-bottom: 0px;
       padding-top: 0px;
       background-color: #302b25;
       margin: 0px 0px 0px 0px;
     }
     .popup {
       margin: 0px 0px 0px 0px;
       padding-bottom: 0px;
       padding-top: 0px;
       color: #e4d4c8;
       background-color: #302b25;
     }
     .clock {
       margin: 0px 0px 0px 0px;
       padding-bottom: 0px;
       padding-top: 0px;
       border: unset;
       border-radius: 20px;
       background-color: #302b25;
     }
     .upower .icon {
       margin: 0px 0px 0px 0px;
       padding-bottom: 0px;
       padding-top: 0px;
       color: #e4d4c8;
       box-shadow: #302b25 0px 0px 0px 0px;
     }
     .upower {
       margin: 0px 0px 0px 0px;
       padding-bottom: 0px;
       padding-top: 0px;
       border: unset;
       border-radius: 20px;
       color: #e4d4c8;
       background-color: #302b25;
     }
     .weather {
       margin: 0px 0px 0px 0px;
       padding-bottom: 0px;
       padding-top: 0px;
       background-color: #302b25;
     }
     .volume {
       margin: 0px 0px 0px 0px;
       padding-bottom: 0px;
       padding-top: 0px;
       background-color: #302b25;
       font-size: 12px
     }
     .workspaces {
       margin: 0px 0px 0px 0px;
       padding-bottom: 0px;
       padding-top: 0px;
       border-radius: 20px;
     }
     .workspaces .item {
       margin: 0px 0px 0px 0px;
       padding-bottom: 0px;
       padding-top: 0px;
       border: unset;
       border-radius: 20px;
       background-color: #302b25;
     }
<!-- gh-comment-id:2400820029 --> @DrVoidest commented on GitHub (Oct 8, 2024): Config.json ```json { "center": [ { "bar": [ { "label": "#weather_current", "on_click": "!zx /etc/nixos/modules/scripts/weather-iron-bar", "type": "button" } ], "class": "weather", "type": "custom" } ], "end": [ { "icon_size": 30, "type": "tray" }, { "format": "{icon} {percentage}%", "icons": { "muted": "󰝟", "volume_high": "󰕾", "volume_low": "󰕿", "volume_medium": "󰖀" }, "max_volume": 100, "type": "volume" }, { "format": "{percentage}%", "icon_size": 20, "type": "upower" }, { "format": "%H:%M", "type": "clock" } ], "exclusive_zone": true, "height": 0, "icon_theme": "Papirus-Dark", "layer": "top", "margin": { "bottom": 0, "top": 0 }, "padding": { "bottom": 0, "top": 0 }, "popup_gap": 0, "position": "top", "start": [ { "all_monitors": true, "type": "workspaces" } ] } ``` style.css ```css * { font-size: 11px; border: none; border-radius: 20px; background-color: rgba(0, 0, 0, 0); margin: 0px 0px 0px 0px; padding-bottom: 0px; padding-top: 0px; } .background { padding-bottom: 0px; padding-top: 0px; box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px 0px; margin: 0px 0px 0px 0px; } .tray { padding-bottom: 0px; padding-top: 0px; background-color: #302b25; margin: 0px 0px 0px 0px; } .popup { margin: 0px 0px 0px 0px; padding-bottom: 0px; padding-top: 0px; color: #e4d4c8; background-color: #302b25; } .clock { margin: 0px 0px 0px 0px; padding-bottom: 0px; padding-top: 0px; border: unset; border-radius: 20px; background-color: #302b25; } .upower .icon { margin: 0px 0px 0px 0px; padding-bottom: 0px; padding-top: 0px; color: #e4d4c8; box-shadow: #302b25 0px 0px 0px 0px; } .upower { margin: 0px 0px 0px 0px; padding-bottom: 0px; padding-top: 0px; border: unset; border-radius: 20px; color: #e4d4c8; background-color: #302b25; } .weather { margin: 0px 0px 0px 0px; padding-bottom: 0px; padding-top: 0px; background-color: #302b25; } .volume { margin: 0px 0px 0px 0px; padding-bottom: 0px; padding-top: 0px; background-color: #302b25; font-size: 12px } .workspaces { margin: 0px 0px 0px 0px; padding-bottom: 0px; padding-top: 0px; border-radius: 20px; } .workspaces .item { margin: 0px 0px 0px 0px; padding-bottom: 0px; padding-top: 0px; border: unset; border-radius: 20px; background-color: #302b25; } ```
Author
Owner

@JakeStanger commented on GitHub (Oct 9, 2024):

I can think of two possibilities here:

  • Setting height to 0 is causing some strange behaviour where GTK automatically grabs more space than it needs.
  • You've set padding on your compositor
<!-- gh-comment-id:2401680971 --> @JakeStanger commented on GitHub (Oct 9, 2024): I can think of two possibilities here: - Setting height to `0` is causing some strange behaviour where GTK automatically grabs more space than it needs. - You've set padding on your compositor
Author
Owner

@DrVoidest commented on GitHub (Oct 10, 2024):

Ok, thank you for your help sir.

<!-- gh-comment-id:2406068659 --> @DrVoidest commented on GitHub (Oct 10, 2024): Ok, thank you for your help sir.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
JakeStanger/ironbar#5864
No description provided.