Skip to content

Commit

Permalink
Treat false as disabling a command in config (#1736)
Browse files Browse the repository at this point in the history
  • Loading branch information
ianyh authored Jan 25, 2025
1 parent ede2990 commit b1562f9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Amethyst/Preferences/UserConfiguration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,9 @@ class UserConfiguration: NSObject {
var command: [String: String]? = configurationValue(forKeyValue: commandKey, fallbackToDefault: false)
if command != nil {
override = true
} else if let enabled: Bool = configurationValue(forKeyValue: commandKey, fallbackToDefault: false), !enabled {
override = true
command = nil
} else {
let mod1: [String]? = configurationValueForKey(.mod1, fallbackToDefault: false)
let mod2: [String]? = configurationValueForKey(.mod2, fallbackToDefault: false)
Expand Down
2 changes: 1 addition & 1 deletion docs/configuration-files.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Amethyst will pick up a config file located at `~/.amethyst.yml` or `~/.config/a

## Commands

Commands are defined at the root of the config file, and have a `mod` and a `key`.
Commands are defined at the root of the config file, as either an object with `mod` and `key` values to customize the command or is `false` to entirely disable it.

| Key | Description |
| --- | ----------- |
Expand Down

0 comments on commit b1562f9

Please sign in to comment.