Skip to content

Commit

Permalink
Merge branch 'master' into sway-hide-updated
Browse files Browse the repository at this point in the history
  • Loading branch information
emirror-de authored Oct 26, 2021
2 parents e276e61 + 562e415 commit c502e25
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
4 changes: 4 additions & 0 deletions man/waybar.5.scd.in
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ Also a minimal example configuration can be found on the at the bottom of this m
typeof: integer ++
Margins value without units.

*spacing* ++
typeof: integer ++
Size of gaps in between of the different modules.

*name* ++
typeof: string ++
Optional name added as a CSS class, for styling multiple waybars.
Expand Down
1 change: 1 addition & 0 deletions resources/config
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// "position": "bottom", // Waybar position (top|bottom|left|right)
"height": 30, // Waybar height (to be removed for auto height)
// "width": 1280, // Waybar width
"spacing": 4, // Gaps between modules (4px)
// Choose the order of the modules
"modules-left": ["sway/workspaces", "sway/mode", "custom/media"],
"modules-center": ["sway/window"],
Expand Down
1 change: 0 additions & 1 deletion resources/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ window#waybar.chromium {
#idle_inhibitor,
#mpd {
padding: 0 10px;
margin: 0 4px;
color: #ffffff;
}

Expand Down
7 changes: 7 additions & 0 deletions src/bar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,13 @@ waybar::Bar::Bar(struct waybar_output* w_output, const Json::Value& w_config)
center_.get_style_context()->add_class("modules-center");
right_.get_style_context()->add_class("modules-right");

if (config["spacing"].isInt()) {
int spacing = config["spacing"].asInt();
left_.set_spacing(spacing);
center_.set_spacing(spacing);
right_.set_spacing(spacing);
}

uint32_t height = config["height"].isUInt() ? config["height"].asUInt() : 0;
uint32_t width = config["width"].isUInt() ? config["width"].asUInt() : 0;

Expand Down

0 comments on commit c502e25

Please sign in to comment.