On the fly gaps/margins #2375
-
Hi everyone, def gaps(qtile, side, direction, value):
if (direction == "+"):
old_gap = #Gets current gap size
new_gap = old_gap + value
Screen(side = bar.Gap(new_gap))
# Refresh layout
elif (direction == "-"):
old_gap = #retrieve current size
new_gap = old_gap - value
Screen(side = bar.Gap(new_gap))
#Refresh layout followed by some lazy functions for specific gap sizes. I know the |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
I think you can modify Let's say you want to bind a key to increase the gap sizes by 10 pixels, you can change from libqtile import lazy
@lazy.function
def increase_gaps(qtile):
for gap in qtile.current_screen.gaps:
gap.size += 10
qtile.current_group.layout_all() Then bind that function you do other lazy things. NB untested! But maybe this works? |
Beta Was this translation helpful? Give feedback.
-
It looks like I can affect the current layout's margins with |
Beta Was this translation helpful? Give feedback.
I think you can modify
gap.size
directly.Let's say you want to bind a key to increase the gap sizes by 10 pixels, you can change
gap.size
values for the current screen, and then probably just reconfigure the group withgroup.layout_all
:Then bind that function you do other lazy things.
NB untested! But maybe this works?