mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-01-11 14:40:25 +01:00
[PR #1224] [MERGED] Fix(bar): simplify bar config #1264
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/LGUG2Z/komorebi/pull/1224
Author: @alex-ds13
Created: 1/10/2025
Status: ✅ Merged
Merged: 1/23/2025
Merged by: @LGUG2Z
Base:
master← Head:fix(bar)/simplify-bar-config📝 Commits (2)
0093d82fix(bar): simplify config for bar45ffb89fix(bar): pass reconnect event to bar📊 Changes
7 files changed (+707 additions, -230 deletions)
View changed files
📝
docs/komorebi.bar.example.json(+1 -9)📝
komorebi-bar/src/bar.rs(+217 -54)📝
komorebi-bar/src/config.rs(+216 -3)📝
komorebi-bar/src/komorebi.rs(+80 -97)📝
komorebi-bar/src/main.rs(+34 -34)📝
komorebi-bar/src/render.rs(+7 -1)📝
schema.bar.json(+152 -32)📄 Description
Old users will still be able to use the old options, however it should be discouraged or even deprecated to use the following configs:
Configs to remove:
work_area_offsetinsidemonitorpositionframeIf you remove all the options above the bar will still show up with a default height of 50 and a default padding of 10 all around.
If you need to customize the bar height, padding or margin you should use these new options:
New Configs:
height: the height you want for the bar itselfmargin: this option allows you to set a margin around the bar (default: 0). You can either set it like this:or like this:
or like this (
verticalandhorizontalare optional you can set only one axis and the other will be left at default value):or even like this to specify each side individually:
padding: this option allows you to set a padding inside the bar (default: 10on all sides). The higher the padding the smaller the widgets will be, if the vertical padding is set at 0 the widgets will try to fill the entire height of the bar. This option can be set just like the margin above.Changed Configs:
monitor: the monitor config can now be simplified to use a number for the monitor index since you no longer need to specify thework_area_offset. So you can now do this:Using these new options after removing the old ones, the bar will automatically calculate the correct
work_area_offsetfor you and apply it. So you don't need to worry about it at all!Example:
Lets say you wanted a bar like this:

Notice that it has some margin on top, but on the bottom is just the normal
workspace_padding+container_paddingfrom komorebi. The bar has a height of 80. And a top margin of 10.BEFORE:
You would need to set the following:
full config
AFTER:
Now you only need this:
full config
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.