Skip to content
New issue

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

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

Already on GitHub? # to your account

Allow region_padding to have individual values for each side (css-like) #530

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hannenz
Copy link

@hannenz hannenz commented Sep 26, 2023

  • Changed region_padding from int to array

  • added config parsing like in css: Padding can be defined like in CSS, e.g.: val1 [val2 [val2 [val4]]] This also ensures backwards compatibility when only one value is given.

    region_padding = 16         # top, left, bottom and right padding: 16
    region_padding = 16 20      # top and bottom: 16, left and right: 20
    region_padding = 16 20 10   # top: 16, bottom: 10, left and right: 20
    region_padding = 16 20 10 0 # top: 16, right: 20, bottom 10: left: 0
  • Updated calculation in stack() method when adjusting stack area for region bar and padding.

- Changed region_padding from int to array

- added config parsing like in css:
    Padding can be defined like in CSS, e.g.: val1 [val2 [val2 [val4]]]
    This also ensures backwards compatibility when only one value is given.

```
    region_padding = 16         # top, left, bottom and right padding: 16
    region_padding = 16 20      # top and bottom: 16, left and right: 20
    region_padding = 16 20 10   # top: 16, bottom: 10, left and right: 20
    region_padding = 16 20 10 0 # top: 16, right: 20, bottom 10: left: 0
```

-  Updated calculation in `stack()` method when adjusting stack area for
   region bar and padding.
@hannenz
Copy link
Author

hannenz commented Sep 26, 2023

This pull request adds the ability to have individual region_padding values for each side (top, right, bottom, left). My motivation was that when using a 3rd party bar and want to make space for it, the only way to do so was to manually specify the region property in spectrwm.conf, which in turn meant that the screens will not be managed by xrandr but are hardcoded in the config file. Since I often change displays (mobile on laptop, homeoffice with 2 screens, office with 3 screens) I wished there was a way to keep autorandr handle the screens and have a possibility to make space for the bar and came up with this sollution. Would be glad to hear what you think of it. And thanks a lot for this great window manager!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant