Skip to content
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

How do I set the gap for a specific mode? #369

Closed
samholmes opened this issue Aug 11, 2024 · 4 comments
Closed

How do I set the gap for a specific mode? #369

samholmes opened this issue Aug 11, 2024 · 4 comments

Comments

@samholmes
Copy link

I'm a modal junkie, so I like my modal experiences. This mean's I prefer to have a single key-binding to change from main mode to an alt mode. In the alt mode I will have all my bindings for my commands as well as a binding to exit back to main. This minimizes chording in my keybindings.

However, I like modal experiences where I can show a clear indicator to whether I am in a particular mode. This visual indicator aids in communicating to the user what mode is currently activated. I figured the gap config would be perfect for this: I'd have gaps set to 0 in main mode, and 10 in my alt mode.

How do I configure the toml file such that the gap is set but only for a specific mode?

@nikitabobko
Copy link
Owner

Please keep and eye on #278 and #377. Once these two are implemented, the following will become possible:

[gaps]
outer.top = '''
if test "$(list-modes --active)" == main do
    echo 10
elif test "$(list-modes --active)" == service do
    echo 0
end
'''

@nikitabobko
Copy link
Owner

Alternatively if #355 gets fixed

[mode.main.binding]
alt-shift-semicolon = ['mode service', 'config --set gaps.outer.top 0']

[mode.service.binding]
esc = ['mode main', 'config --set gaps.outer.top 10']

[gaps]
outer.top = 'echo $GAPS || echo 0'

[mode.main.binding]
alt-shift-semicolon = ['mode service', 'set-env GAPS 0']

[mode.service.binding]
esc = ['mode main', 'set-env GAPS 10']

@alankritjoshi
Copy link

I had a similar need. I was trying to implement something like a "Zen Mode" by putting large left right gaps on a fullscreen window. So maybe the dynamic config setter would help with that.

# Zen Mode
z = [
  'fullscreen',
  'config --set gaps.outer.left 1200',
  'config --set gaps.outer.right 1200',
]

# Undo Zen mode
u = [
  'fullscreen',
  'config --set gaps.outer.left 10',
  'config --set gaps.outer.right 10',
]

@nikitabobko
Copy link
Owner

Closing in favor of #278, #377, #355

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

No branches or pull requests

3 participants