Amethyst
Amethyst copied to clipboard
Defaults Collision with Custom Config
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
- create a custom config file at
~/.config/amethyst/amethyst.yml
- Add this to your file
select-two-pane-layout: mod: mod1 key: s
- Relaunch Amethyst
- press
mod1
+s
- 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
In fact, all defaults are recreated on each relaunch if using custom configuration file ~/.amethyst.yml
To Repoduce:
- Set any custom configuration file without cycle-layout setting key
- Remove shortcut for cycle-layout via in-app preferences
- Relaunch amethyst
- 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
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.
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"
I am probably experiencing a similar bug but mine isn't the same of the defaults, specifically, this is my file,
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 https://github.com/ianyh/Amethyst/issues/1419#issuecomment-1902810820 for fixes in this particular case.
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
Perhaps that was replying to me?
Thanks. That works. Perhaps it is unrelated to this issue. Sorry for the noise.
it worked for me. Thanks for the hint @cowboy-bebug!