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

Defaults Collision with Custom Config #1419

Open
Indyandie opened this issue Feb 12, 2023 · 7 comments
Open

Defaults Collision with Custom Config #1419

Indyandie opened this issue Feb 12, 2023 · 7 comments
Labels

Comments

@Indyandie
Copy link

If a command (mod+key) is set in default.amethyst and the same command is reused in a custom configuration file neither will work.

To Reproduce

  1. create a custom config file at ~/.config/amethyst/amethyst.yml
  2. Add this to your file
    select-two-pane-layout:
      mod: mod1
      key: s
  3. Relaunch Amethyst
  4. press mod1+s
  5. Nothing happens...

Expected behavior
The custom configuration command should override the default without issues.

Versions:

  • macOS: 12.6.3
  • Amethyst: 0.17.0

Additional context
Initial discussion #1384

@vicmunoz
Copy link

vicmunoz commented Mar 25, 2023

In fact, all defaults are recreated on each relaunch if using custom configuration file ~/.amethyst.yml
To Repoduce:

  1. Set any custom configuration file without cycle-layout setting key
  2. Remove shortcut for cycle-layout via in-app preferences
  3. Relaunch amethyst
  4. Check shortcuts via in-app preferences and voilá, the shortcut for cycle-layout is set again to its default.

Expected behavior
updated shortcuts via in-app preferences should not be reseted to defaults on each relaunch

Versions:

  • macos 12.5.1
  • amthyst 0.19.0 (103)

final notes: this issue is not reproduced if there is no custom configuration file. shortcuts remains as unset after relaunch, despite has its default

maybe related with #1329

@roeeyn
Copy link

roeeyn commented Jun 21, 2023

Adding my 2 cents, I was struggling because I was trying to configure the 3Column Middle layout to work with mod1+s and thought it was related to this issue. Setting this (as the docs suggest) didn't work:

select-3column-middle-layout:
  mod: mod1
  key: s

But here, the issue is different. The root cause for this is that the layout is named '3Column Middle', but it has configured middle-wide as layoutKey as seen here.

Based on this, configuring the following snippet worked well:

# The default select-wide-layout keybinding is mod1+s, so I need to reassign
# it to another one, so I can later use the original.
select-wide-layout:
  mod: mod2
  key: x

# Assign the desired keybinding to the middle-layout.
# Make sure you have middle-wide in your layout list.
select-middle-wide-layout:
  mod: mod1
  key: s

I'm happy to add more details about this in the README if needed because there's info saying that "3Column Middle" was previously named "Middle Wide", but didn't find something saying that we should configure it that way in our configuration file.

@Indyandie
Copy link
Author

Thanks @roeeyn your solution helped me find a work around for my original issue.

By giving select-wide-layout a new shortcut, the default shortcut becomes available.

select-wide-layout:
  mod: mod1
  key: "0"

select-two-pane-layout:
  mod: mod1
  key: "s"

@ickc
Copy link

ickc commented Jan 21, 2024

I am probably experiencing a similar bug but mine isn't the same of the defaults, specifically, this is my file,

amethyst.yml.txt

To ensure the problem isn't stateful, defaults delete com.amethyst.Amethyst.plist is run and the following behavior would still occur:

Namely, I mapped mod1 + a,s,d,f to Select fullscreen layout, Select bsp layout, Select wide layout, Select floating layout respectively, and only the mod1 + s,d work but mod1 + a,f doesn't. The default of the latter is mapping to Select tall layout, Select column layout so it isn't the same as defaults (and in fact I didn't enable tall nor column in my layouts key.)

Even more strangely, at one point this (config file) actually works for mod1 + a,s,d,f, but it has other problems. Restarting Amethyst didn't help (mod2 + z wasn't even registered) and that's when I ran defaults delete com.amethyst.Amethyst.plist and after that I consistently see the above behavior.

Edit: probably unrelated to this issue. See #1419 (comment) for fixes in this particular case.

@cowboy-bebug
Copy link
Contributor

cowboy-bebug commented Jan 21, 2024

FYI, you can unset default values like:

focus-screen-1:
  mod: ""
  key: ""

@Indyandie using the above can you try:

select-wide-layout:
  mod: ""
  key: ""

select-two-pane-layout:
  mod: mod1
  key: s

ickc added a commit to ickc/dotfiles that referenced this issue Jan 22, 2024
@ickc
Copy link

ickc commented Jan 22, 2024

Perhaps that was replying to me?

Thanks. That works. Perhaps it is unrelated to this issue. Sorry for the noise.

@Indyandie
Copy link
Author

it worked for me. Thanks for the hint @cowboy-bebug!

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

6 participants