8000 Set border size values using percentages · Issue #1567 · polybar/polybar · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Set border size values using percentages #1567

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
douglasrizzo opened this issue Dec 31, 2018 · 1 comment
Closed

Set border size values using percentages #1567

douglasrizzo opened this issue Dec 31, 2018 · 1 comment
Labels

Comments

@douglasrizzo
Copy link

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

I am trying to set border size values using percentages. I use the same config file for multiple monitors, but since they have different resolutions, setting the border in pixels is not very useful.

Why does polybar need this feature?

Dimensions and offset can already be set using percentages, but the border cannot. This feature will be useful in the same way the aforementioned ones are, making configuration more flexible and specially useful for users with multiple monitors with different dimensions.

Describe the solution you'd like

To be able to set the values of border-{left|right|top|bottom}-size using percentages, for example:

border-left-size = 12%
border-right-size = 12%
border-top-size = 1
border-bottom}-size = 1

Percentages can be relative to the current dimensions of the bar or the display size.

Describe alternatives you've considered

I tried using the percentages, but currently they are treated as pixel values, e.g. border-left-size = 30% has the same behavior as border-left-size = 30.

Additional context

I have a display which is 1920 pixels wide and another one which is 1440 pixels wide. In the larger one, I set border-left-size and border-right-size to 300, but in the smaller one, these borders are too large. Using percentages instead of pixel values might help mitigate this problem.

@patrick96
Copy link
Member

Good idea.

I think this could be done quite easily. If we are already doing this, we could also add support for mixed percent/pixel values like we added for width and height in #1224 and #701 (e.g. border-size = 10%:-1).

All the changes would need to be made in src/components/bar.cpp.
We would appreciate a PR from you if you can, otherwise this will just go onto our backlog.

patrick96 pushed a commit that referenced this issue Jan 12, 2019
Uses the same X%:Z format as width, height and offset-*

Resolves #1567
doronbehar pushed a commit to doronbehar/polybar that referenced this issue Jun 16, 2019
Uses the same X%:Z format as width, height and offset-*

Resolves polybar#1567
doronbehar pushed a commit to doronbehar/polybar that referenced this issue Jun 16, 2019
Uses the same X%:Z format as width, height and offset-*

Resolves polybar#1567
patrick96 added a commit to patrick96/polybar that referenced this issue Jun 28, 2019
* In the `internal/memory` module all of the megabyte values no longer have decimal places (polybar#1606).

**New Config Options**
The following config options were added:

In the `[bar/*]` section:

* `monitor-exact`, use exact name matching for monitors otherwise ignore dashes.

In formats:

* `format-NAME-font` to set the font for that format (same as `label-NAME-font`)

In `internal/bspwm`:

* `label-marked` for the new `marked` node flag introduced in baskerville/bspwm@d0138af

In `internal/xkeyboard`:

* `label-indicator-(on|off)` is uses once for every indicator (caps lock, etc.), supports `%name%` and `%icon%`
* `label-indicator-(on|off)-(capslock|numlock|scrolllock)` overwrites `label-indicator-(on|off)` for the given indicator
* `layout-icon-*` is a list that maps layout names to icons to be used with the `%icon%` token in `label-layout`
* `indicator-icon-*` is a list that maps indicator names to icons to be used with the `%icon%` token in `label-indicator-*`

In `internal/temperature`:

* `base-temperature` is the counterpart to `warn-temperature` and controls the lower bound for the ramp.

**Deprecations**

* xkeyboard: `label-indicator` is deprecated in favor of the new `label-indicator-on`

**Features**

* bar:
    * make exact monitor matching configurable (polybar#1533), see polybar#1532
    * `border-size` now supports the same mixed percentage/pixel sizes as `width` and `height` (polybar#1592), see polybar#1567
    * Use primary monitor if no monitor is specified (polybar#1426), polybar#1412
* bspwm: Support for the new `marked` node flag. (polybar#1557), see polybar#1552
* format: Formats now support the `-font` property just as labels (polybar#1602), see polybar#19
* network: Support for all tokens in all labels (polybar#1597)
* xkeyboard: Indicator names can be customized. Also adds icon mappings for layouts and indicators (polybar#1559, polybar#1048), see polybar#1558
* temperature: The ramp now starts at `base-temperature` instead of 0°C (polybar#1706), see polybar#1703
* battery: `%percentage_raw%` token that displays the real percentage regardless of `full-at` (polybar#1756), see polybar#1753

**Fixes**

* network: Display `N/A` when no IPv4 address can be found (polybar#1597)
* xworkspaces: Properly handle when desktops are removed from `_NET_DESKTOP_NAMES` (polybar#1713), see polybar#1710
* backlight: Read the right brightness value (polybar#1689), see polybar#1180
* pulseaudio: Allow volume increase when it is close to the maximum. Before it did not allow that when adding `interval` would go over the max. (polybar#1765)
* i3: fix workspace change for workspaces with special characters in the name  (polybar#1798), see polybar#1797
* font: Characters no longer vanish when the `size` or `pixelsize` property is 0 (polybar#1646)
* build:
    * Compilation error under gcc9 (polybar#1729), see polybar#1728
    * Compilation no longer fails when new flags are introduced that produce new warnings (polybar#1735)
patrick96 added a commit to patrick96/polybar that referenced this issue Jun 28, 2019
* In the `internal/memory` module all of the megabyte values no longer have decimal places (polybar#1606).

**New Config Options**
The following config options were added:

In the `[bar/*]` section:

* `monitor-exact`, use exact name matching for monitors otherwise ignore dashes.

In formats:

* `format-NAME-font` to set the font for that format (same as `label-NAME-font`)

In `internal/bspwm`:

* `label-marked` for the new `marked` node flag introduced in baskerville/bspwm@d0138af

In `internal/xkeyboard`:

* `label-indicator-(on|off)` is uses once for every indicator (caps lock, etc.), supports `%name%` and `%icon%`
* `label-indicator-(on|off)-(capslock|numlock|scrolllock)` overwrites `label-indicator-(on|off)` for the given indicator
* `layout-icon-*` is a list that maps layout names to icons to be used with the `%icon%` token in `label-layout`
* `indicator-icon-*` is a list that maps indicator names to icons to be used with the `%icon%` token in `label-indicator-*`

In `internal/temperature`:

* `base-temperature` is the counterpart to `warn-temperature` and controls the lower bound for the ramp.

**Deprecations**

* xkeyboard: `label-indicator` is deprecated in favor of the new `label-indicator-on`

**Features**

* bar:
    * make exact monitor matching configurable (polybar#1533), see polybar#1532
    * `border-size` now supports the same mixed percentage/pixel sizes as `width` and `height` (polybar#1592), see polybar#1567
    * Use primary monitor if no monitor is specified (polybar#1426), polybar#1412
* bspwm: Support for the new `marked` node flag. (polybar#1557), see polybar#1552
* format: Formats now support the `-font` property just as labels (polybar#1602), see polybar#19
* network: Support for all tokens in all labels (polybar#1597)
* xkeyboard: Indicator names can be customized. Also adds icon mappings for layouts and indicators (polybar#1559, polybar#1048), see polybar#1558
* temperature: The ramp now starts at `base-temperature` instead of 0°C (polybar#1706), see polybar#1703
* battery: `%percentage_raw%` token that displays the real percentage regardless of `full-at` (polybar#1756), see polybar#1753

**Fixes**

* network: Display `N/A` when no IPv4 address can be found (polybar#1597)
* xworkspaces: Properly handle when desktops are removed from `_NET_DESKTOP_NAMES` (polybar#1713), see polybar#1710
* backlight: Read the right brightness value (polybar#1689), see polybar#1180
* pulseaudio: Allow volume increase when it is close to the maximum. Before it did not allow that when adding `interval` would go over the max. (polybar#1765)
* i3: fix workspace change for workspaces with special characters in the name  (polybar#1798), see polybar#1797
* font: Characters no longer vanish when the `size` or `pixelsize` property is 0 (polybar#1646)
* build:
    * Compilation error under gcc9 (polybar#1729), see polybar#1728
    * Compilation no longer fails when new flags are introduced that produce new warnings (polybar#1735)
patrick96 added a commit to patrick96/polybar that referenced this issue Jun 29, 2019
Breaking Changes:

* In the `internal/memory` module all of the megabyte values no longer have decimal places (polybar#1606).

Changelog

**New Config Options**
The following config options were added:

In the `[bar/*]` section:

* `monitor-exact`, use exact name matching for monitors otherwise ignore dashes.

In formats:

* `format-NAME-font` to set the font for that format (same as `label-NAME-font`)

In `internal/bspwm`:

* `label-marked` for the new `marked` node flag introduced in baskerville/bspwm@d0138af

In `internal/xkeyboard`:

* `label-indicator-(on|off)` is used once for every indicator (caps lock, etc.), supports `%name%` and `%icon%`
* `label-indicator-(on|off)-(capslock|numlock|scrolllock)` overwrites `label-indicator-(on|off)` for the given indicator
* `layout-icon-*` is a list that maps layout names to icons to be used with the `%icon%` token in `label-layout`
* `indicator-icon-*` is a list that maps indicator names to icons to be used with the `%icon%` token in `label-indicator-*`

In `internal/temperature`:

* `base-temperature` is the counterpart to `warn-temperature` and controls the lower bound for the ramp.

**Deprecations**

* xkeyboard: `label-indicator` is deprecated in favor of the new `label-indicator-on`

**Features**

* bar:
    * make exact monitor matching configurable (polybar#1533), see polybar#1532
    * `border-size` now supports the same mixed percentage/pixel sizes as `width` and `height` (polybar#1592), see polybar#1567
    * Use primary monitor if no monitor is specified (polybar#1426), polybar#1412
* bspwm: Support for the new `marked` node flag. (polybar#1557), see polybar#1552
* format: Formats now support the `-font` property just as labels (polybar#1602), see polybar#19
* network: Support for all tokens in all labels (polybar#1597)
* xkeyboard: Indicator names can be customized. Also adds icon mappings for layouts and indicators (polybar#1559, polybar#1048), see polybar#1558
* temperature: The ramp now starts at `base-temperature` instead of 0°C (polybar#1706), see polybar#1703
* battery: `%percentage_raw%` token that displays the real percentage regardless of `full-at` (polybar#1756), see polybar#1753

**Fixes**

* network: Display `N/A` when no IPv4 address can be found (polybar#1597)
* xworkspaces: Properly handle when desktops are removed from `_NET_DESKTOP_NAMES` (polybar#1713), see polybar#1710
* backlight: Read the right brightness value (polybar#1689), see polybar#1180
* pulseaudio: Allow volume increase when it is close to the maximum. Before it did not allow that when adding `interval` would go over the max. (polybar#1765)
* i3: fix workspace change for workspaces with special characters in the name  (polybar#1798), see polybar#1797
* font: Characters no longer vanish when the `size` or `pixelsize` property is 0 (polybar#1646)
* build:
    * Compilation error under gcc9 (polybar#1729), see polybar#1728
    * Compilation no longer fails when new flags are introduced that produce new warnings (polybar#1735)
patrick96 added a commit that referenced this issue Jul 24, 2019
Breaking Changes:

* In the `internal/memory` module all of the megabyte values no longer have decimal places (#1606).

Changelog

**New Config Options**
The following config options were added:

In the `[bar/*]` section:

* `monitor-exact`, use exact name matching for monitors otherwise ignore dashes.

In formats:

* `format-NAME-font` to set the font for that format (same as `label-NAME-font`)

In `internal/bspwm`:

* `label-marked` for the new `marked` node flag introduced in baskerville/bspwm@d0138af

In `internal/xkeyboard`:

* `label-indicator-(on|off)` is used once for every indicator (caps lock, etc.), supports `%name%` and `%icon%`
* `label-indicator-(on|off)-(capslock|numlock|scrolllock)` overwrites `label-indicator-(on|off)` for the given indicator
* `layout-icon-*` is a list that maps layout names to icons to be used with the `%icon%` token in `label-layout`
* `indicator-icon-*` is a list that maps indicator names to icons to be used with the `%icon%` token in `label-indicator-*`

In `internal/temperature`:

* `base-temperature` is the counterpart to `warn-temperature` and controls the lower bound for the ramp.

**Deprecations**

* xkeyboard: `label-indicator` is deprecated in favor of the new `label-indicator-on`

**Features**

* bar:
    * make exact monitor matching configurable (#1533), see #1532
    * `border-size` now supports the same mixed percentage/pixel sizes as `width` and `height` (#1592), see #1567
    * Use primary monitor if no monitor is specified (#1426), #1412
* bspwm: Support for the new `marked` node flag. (#1557), see #1552
* format: Formats now support the `-font` property just as labels (#1602), see #19
* network: Support for all tokens in all labels (#1597)
* xkeyboard: Indicator names can be customized. Also adds icon mappings for layouts and indicators (#1559, #1048), see #1558
* temperature: The ramp now starts at `base-temperature` instead of 0°C (#1706), see #1703
* battery: `%percentage_raw%` token that displays the real percentage regardless of `full-at` (#1756), see #1753

**Fixes**

* network: Display `N/A` when no IPv4 address can be found (#1597)
* xworkspaces: Properly handle when desktops are removed from `_NET_DESKTOP_NAMES` (#1713), see #1710
* backlight: Read the right brightness value (#1689), see #1180
* pulseaudio: Allow volume increase when it is close to the maximum. Before it did not allow that when adding `interval` would go over the max. (#1765)
* i3: fix workspace change for workspaces with special characters in the name  (#1798), see #1797
* font: Characters no longer vanish when the `size` or `pixelsize` property is 0 (#1646)
* build:
    * Compilation error under gcc9 (#1729), see #1728
    * Compilation no longer fails when new flags are introduced that produce new warnings (#1735)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants
0